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" <> wrote in message
news:%...
> Hello Julian,
>
> > 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?
> >
>
> tempuri.org is actually the namespace that is used for the web service.
Your problem arises from this line:
>
> open "GET", "http://tempuri.org/TextData/TextData.asmx", False
>
> This line should actually read (assuming your webservice is hosted on the
local machine):
> Open "GET", "http://localhost/TextData/TextData.asmx", False
>
> Also, since your method is expecting a string you will want to pass this
along on the querystring (ie: TextData.asmx?name=Foo or use a POST method to
pass the parameter along.
>
> --
> Matt Berther
> http://www.mattberther.com