简体   繁体   English

带有可视foxpro客户端的WSO2 WSF / PHP服务器

[英]WSO2 WSF/PHP server with visual foxpro client

I'm using WSO2 WSF/PHP (wamp) and I'm trying to consume the sample web service (echo_service.php) from a foxpro client. 我正在使用WSO2 WSF / PHP(沼泽),并且试图从foxpro客户端使用样本Web服务(echo_service.php)。 I have tried this code with no success: 我尝试了以下代码,但没有成功:

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 )

The above returns the service description (Deployed Services samples_echo_service.php Available Operations echoString) with status = 200 and statustext = OK . 上面的代码返回status = 200statustext = OK的服务描述(Deployed Services samples_echo_service.php可用操作echoString)。

With POST I get 使用POST我得到

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

The next code return an OLE error ( Error 1429 ): 下一个代码返回一个OLE errorError 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")

The client samples in php are working ok. php中的客户端示例工作正常。 The code works with other webservices (tried http://webservicex.net/periodictable.asmx ) 该代码可与其他Web服务一起使用(尝试http://webservicex.net/periodictable.asmx

Need any help to solve this problem. 需要任何帮助来解决此问题。

Also, if consuming web service from WSO2 WSF/PHP in too complicated, any PHP alternatives that works with Visual Foxpro? 另外,如果以太复杂的方式使用WSO2 WSF / PHP的Web服务,是否有任何与Visual Foxpro兼容的PHP替代品?

Thanks. 谢谢。

After analyzing and comparing the headers send by foxpro and working php client the only difference was this: 在分析和比较由foxpro和工作的php客户端发送的标头之后,唯一的区别是:

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

Replacing the content-type resolved the issue, but I'm still unable to use soapclient... 替换内容类型可以解决此问题,但是我仍然无法使用soapclient ...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM