【问题标题】:WSO2 WSF/PHP server with visual foxpro clientWSO2 WSF/PHP 服务器与可视化 foxpro 客户端
【发布时间】:2013-01-30 16:31:55
【问题描述】:

我正在使用 WSO2 WSF/PHP (wamp),并且正在尝试使用来自 foxpro 客户端的示例 Web 服务 (echo_service.php)。 我试过这段代码没有成功:

TEXT TO requestPayloadString NOSHOW
<?xml version='1.0' encoding='utf-8'?>
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
   <soapenv:Header/>
   <soapenv:Body>
     <ns1:echoString xmlns:ns1="http://wso2.org/wsfphp/samples">
         <text>Hello World!</text>
     </ns1:echoString>
    </soapenv:Body>
</soapenv:Envelope>
ENDTEXT

LOCAL httpRequest
httpRequest = CREATEOBJECT("WinHttp.WinHttpRequest.5.1")

httpRequest.Open("GET", "http://192.168.56.101/samples/echo_service.php", .F.)
httpRequest.SetRequestHeader("Content-Type", "text/xml; charset=utf-8")
httpRequest.SetRequestHeader("SOAPAction", "http://wso2.org/wsfphp/samples/echoString")
httpRequest.Send(requestPayloadString)

? httpRequest.ResponseText 
? TRANSFORM( httpRequest.Status )
? TRANSFORM( httpRequest.StatusText )

以上返回服务描述(已部署的服务 samples_echo_service.php 可用操作 echoString),带有 status = 200statustext = OK

POST 我明白了

Transport identified SOAP version does not match with SOAP message version
status=500 statustext=Internal Server Error

下一个代码返回一个OLE error (Error 1429):

SoapMapper:Restoring data into SoapMapper returnVal failed HRESULT=0x80070057:
The parameter is incorrect.
   - Client:Unspecified client error. HRESULT=0x80070057: The parameter is incorrect.

lcWSDL = "http://192.168.56.101/samples/echo_service.php?wsdl"
loSoap = Createobject("mssoap.soapclient30")
loSoap.MSSoapInit(lcWSDL)
loSoap.echoString("hello")

php 中的客户端示例工作正常。 该代码适用于其他网络服务(已尝试http://webservicex.net/periodictable.asmx

需要任何帮助来解决这个问题。

另外,如果使用 WSO2 WSF/PHP 中的 Web 服务过于复杂,是否有任何 PHP 替代方案可以与 Visual Foxpro 一起使用?

谢谢。

【问题讨论】:

    标签: php web-services wso2 foxpro wsh


    【解决方案1】:

    在分析和比较了 foxpro 和工作 php 客户端发送的标头之后,唯一的区别是:

    httpRequest.SetRequestHeader("Content-Type", "application/soap+xml;charset=UTF-8")
    

    更换内容类型解决了问题,但我仍然无法使用soapclient...

    【讨论】:

      猜你喜欢
      • 2016-02-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-07-25
      • 2019-03-18
      • 1970-01-01
      • 2011-08-18
      相关资源
      最近更新 更多