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 )

上記はサービスの説明 (Deployed Services samples_echo_service.php Available Operations echoString) をstatus = 200と で返します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 のクライアント サンプルは問題なく動作しています。コードは他の Web サービスで動作します ( http://webservicex.net/periodictable.asmxを試しました) 。

この問題を解決するには助けが必要です。

また、WSO2 WSF/PHP から Web サービスを複雑に使用する場合、Visual Foxpro で動作する PHP の代替手段はありますか?

ありがとう。

4

1 に答える 1

0

foxpro と動作している php クライアントによって送信されたヘッダーを分析および比較した後、唯一の違いは次のとおりです。

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

content-type を置き換えることで問題は解決しましたが、まだ soapclient を使用できません...

于 2013-01-30T19:04:10.717 に答える