我正在使用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
和statustext = OK
返回服务描述(Deployed Services samples_echo_service.php可用操作echoString)。
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中的客户端示例正常运行。 该代码适用于其他Web服务(已尝试http://webservicex.net/periodictable.asmx)
需要任何帮助来解决这个问题。
另外,如果从WSO2 WSF / PHP中使用Web服务过于复杂,那么任何可以与Visual Foxpro一起使用的PHP替代方案?
感谢。
答案 0 :(得分:0)
在分析和比较foxpro和工作php客户端发送的标题后,唯一的区别是:
httpRequest.SetRequestHeader("Content-Type", "application/soap+xml;charset=UTF-8")
替换内容类型解决了问题,但我仍然无法使用soapclient ......