【问题标题】:Nusoap, server side (php) and client side ASP classicNusoap、服务器端 (php) 和客户端 ASP 经典
【发布时间】:2011-04-07 22:33:13
【问题描述】:

我正在尝试调用 网络服务 (使用 nusoap),当 我用 php 客户端 调用它。 它返回一个邮件地址列表。

(网上有很多关于 php/php 或 php/asp.net 等的例子……)

但是,我现在希望能够调用这个网络 使用经典 ASP 的服务

到目前为止,我什么也没找到, 有没有人成功实现过这样的 Web 服务组合:php(服务器)/asp 经典(客户端)? 或者知道怎么做? 如果答案是肯定的, 我很想听听你是怎么做到的! 非常感谢。

【问题讨论】:

  • 为什么将经典 ASP 称为“客户端”?
  • 嗯,philfreo,如果你对 web 服务有一点了解,你肯定知道有一个客户端调用 web 服务。这里的客户端是用 ASP(经典 .NET)编写的,就是这样。
  • 如果我们有帮助,请奖励答案:)

标签: php web-services asp-classic nusoap


【解决方案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

【讨论】:

    【解决方案2】:

    您可以下载Microsoft SOAP Tookit 3.0,但我不推荐它,因为根据我的经验,这是一种痛苦。

    还有this article in CodeProject,不过我没用过,不推荐。

    【讨论】:

    • 感谢爱德华多!我去看看。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-07-09
    • 2016-04-12
    • 1970-01-01
    • 1970-01-01
    • 2016-10-16
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多