Hi Matt.
I changed my ASP page as you told me and it worked, thanks. That's my final
code but I would like your help one more time:
<%Option Explicit
Dim objRequest, objXMLDoc, objXmlNode
Dim strRet, strError, strNome
strName = "Julian"
Set objRequest = Server.createobject("MSXML2.XMLHTTP")
With objRequest
.open "GET", "http://localhost/TextData/TextData.asmx/GetName?sName=" &
strName, False
.setRequestHeader "Content-Type", "text/xml"
.setRequestHeader "SOAPAction", "HTTP://localhost/TextData/GetName"
.send
End With
Set objXMLDoc = Server.createobject("MSXML2.DOMDocument")
objXmlDoc.async = false
Response.Write(objRequest.ResponseXml)
'If objXmlDoc.LoadXml(objRequest.ResponseXml.Xml) Then
' Set objXmlNode = objXmlDoc.SelectSingleNode("GetNameResponse")
' If Not objXmlNode Is Nothing Then
' strRet = objXmlNode.NodeTypedvalue
' Response.Write(strRet)
' End If
'Else
' strError = objXmlDoc.parseError.reason
' Response.write(strError)
'End If
%>
I see the entire response in xml. How can I extract only the sName parameter
from the returned xml? The commented code does not work :-(
Thanks,
Julian
"Matt Berther" <mberther@hotmail.com> wrote in message
news:%23MZiBp2IEHA.1944@TK2MSFTNGP11.phx.gbl...[color=blue]
> Hello Julian,
>[color=green]
> > What do I need to do in order to consume this web service in a classic
> > ASP page? And why do I need to use tempuri.org instead of localhost,
> > in my Request?
> >[/color]
>
> tempuri.org is actually the namespace that is used for the web service.[/color]
Your problem arises from this line:[color=blue]
>
> open "GET", "http://tempuri.org/TextData/TextData.asmx", False
>
> This line should actually read (assuming your webservice is hosted on the[/color]
local machine):[color=blue]
> Open "GET", "http://localhost/TextData/TextData.asmx", False
>
> Also, since your method is expecting a string you will want to pass this[/color]
along on the querystring (ie: TextData.asmx?name=Foo or use a POST method to
pass the parameter along.[color=blue]
>
> --
> Matt Berther
>
http://www.mattberther.com[/color]