我想從PHP調用經典ASP Web服務。從PHP調用經典ASP Web服務
這裏的服務:
<%
Response.Buffer = True
Response.ContentType = "text/xml"
Set xmldom = Server.CreateObject("Microsoft.XMLDOM")
Set xmlhttp = Server.CreateObject("MSXML2.ServerXMLHTTP")
Sub Test()
returnXML = ""
returnXML = returnXML & "<SOAP:Envelope xmlns:SOAP=""urn:schemas-xmlsoap-org:soap.v1"">"
returnXML = returnXML & "<SOAP:Body>"
returnXML = returnXML & "<message>"
returnXML = returnXML & "<theword>Hello</theword>"
returnXML = returnXML & "</message>"
returnXML = returnXML & "</SOAP:Body>"
returnXML = returnXML & "</SOAP:Envelope>"
Response.Write(returnXML)
End Sub
Set xmldom = Nothing
Set xmlhttp = Nothing
%>
我想打電話從PHP以非WSDL模式這項服務。我怎樣才能做到這一點?如何在服務中調用特定的功能?
這裏是我想從PHP調用服務:
<?php
$client = new SoapClient(
null, array(
'location' => "http://server/folder/server.asp",
'uri' => "http://test-uri/",
'style' => SOAP_DOCUMENT,
'use' => SOAP_LITERAL,
'trace'=>1
)
);
$result = $client->Test();
$client->__getLastResponse();
?>
謝謝...
如果您可以控制服務器和客戶端,並且它們是ASP和PHP,那麼爲什麼不使用自己的通信API而不是SOAP呢?另外,我相信在那裏有傳統的ASP SOAP Web服務的庫。 – mellamokb 2011-02-17 22:29:03