2009-10-26 149 views
1

我想打电话给 (使用的NuSOAP),当 我有PHP客户端称之为其工作做好的Web服务。 它返回一个邮件地址列表。的NuSOAP,服务器端(PHP)和客户端ASP经典

(有很多围绕关于PHP/PHP或php/asp.net等在网络上的例子......)

但是,我现在希望能够把这种网络 服务与传统的ASP

我没有发现任何迄今为止, 有没有人已经成功地实施这样的Web服务组合:PHP(服务器)/ ASP经典(客户端)? 还是知道该怎么做? 如果答案是肯定的, 我很想听听你是怎么做到的! 非常感谢。

+0

你为什么打电话指传统的ASP为“客户端”? – philfreo 2009-10-31 06:00:26

+0

恩, philfreo,如果你对webservices有一点了解, 你肯定知道有一个客户端调用web服务。 这里的客户端是用ASP(经典的<> .NET)编写的, 就是这样。 – Tom 2009-11-03 17:07:05

+0

如果我们有帮助,请授予答案:) – 2009-11-12 01:45:58

回答

1

我找到了解决我的问题的方法。此代码为我工作

url = "http://dev_api/service.php" 

SOAPParameters = "" 
SOAPParameters = " <param1>text1</param1>" 
SOAPParameters = SOAPParameters & " <param2>text2</param2>" 
SOAPParameters = SOAPParameters & " <param3>text3</param3>" 

SOAPRequest = "<?xml version='1.0' encoding='utf-8'?>" 
SOAPRequest = SOAPRequest & "<soap:Envelope xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/"">" 
SOAPRequest = SOAPRequest & " <soap:Body>" 
SOAPRequest = SOAPRequest & " <search>" 
SOAPRequest = SOAPRequest & SOAPParameters 
SOAPRequest = SOAPRequest & " </search>" 
SOAPRequest = SOAPRequest & " </soap:Body>" 
SOAPRequest = SOAPRequest & " </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.setRequestHeader "SOAPAction", "http://dev_api/service.php" 
xmlhttp.Send (SOAPRequest) 
Response.Write xmlhttp.responseXML.xml