drdyszuy488152 2013-01-30 16:31
浏览 93

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

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.

  • 写回答

1条回答 默认 最新

  • douluo1330 2013-01-30 19:04
    关注

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

    评论

报告相同问题?

悬赏问题

  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突
  • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大
  • ¥15 import arcpy出现importing _arcgisscripting 找不到相关程序