简体   繁体   中英

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. 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 .

With POST I get

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 ):

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. The code works with other webservices (tried 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?

Thanks.

After analyzing and comparing the headers send by foxpro and working php client the only difference was this:

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...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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