0

我正在使用 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 )

status = 200上面返回带有和的服务描述(部署的服务 samples_echo_service.php 可用操作 echoString)statustext = 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 一起使用?

谢谢。

4

1 回答 1

0

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

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

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

于 2013-01-30T19:04:10.717 回答