My customer has a PHP web service, that they want me to use. It’s PHP-based, while my web is ASP-based.
The ASP code looks like this:
Dim soapclient WSDL_URL = 'http://xxx.xxxx.xx/index.php?Action=service' set soapclient = Server.CreateObject('MSSOAP.SoapClient30') soapclient.ClientProperty('ServerHTTPRequest') = True
on error resume next
soapclient.mssoapinit WSDL_URL ‘ error here
Is ASP able to call a PHP-based soap service?
or
What should I adjust?
Thanks a lot!
We find a way to solve this question is not use ‘MSSOAP.SoapClient30’ to ask web service, but ‘Msxml2.ServerXMLHTTP.4.0’.
Sample code like this:
url = ‘http://xxx.xxx.xx/xxx.php‘
SoapRequest='<?xml version=’&CHR(34)&’1.0’&CHR(34)&’ encoding=’&CHR(34)&’utf-8’&CHR(34)&’?>’ ‘<soap:Envelope xmlns:xsi=’&CHR(34)&’http://www.w3.org/2001/XMLSchema-instance‘&CHR(34)&’ xmlns:xsd=’&CHR(34)&’http://www.w3.org/2001/XMLSchema‘&CHR(34)&’ xmlns:soap=’&CHR(34)&’http://schemas.xmlsoap.org/soap/envelope/‘&CHR(34)&’><soap:Body><getList></getList></soap:Body></soap:Envelope>’
Set xmlhttp = server.CreateObject(‘Msxml2.ServerXMLHTTP.4.0’)
xmlhttp.Open ‘POST’,url,false
xmlhttp.setRequestHeader ‘Content-Type’, ‘text/xml;charset=utf-8’
xmlhttp.setRequestHeader ‘Content-Length’,LEN(SoapRequest)
xmlhttp.Send(SoapRequest)
Response.Write xmlhttp.responseText
Set xmlhttp = Nothing