RPCエンコードされたPHP Webサービスがあり、ブール型のデータ型を持つ単純なSOAPエンベロープを返します。クライアント側のトレースを行う場合、それはWCFプロキシに入る前に、SOAPエンベロープは、この右のようになります。WCFクライアントプロキシが誤ってSOAPエンベロープを返す
<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="http://sample.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org
/soap/encoding/">
<SOAP-ENV:Body>
<ns1:ServiceMessageResponse>
<outgoingVar1>true</outgoingVar1>
</ns1:ServiceMessageResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
返される値は、プロキシの反対側から出てくるときしかし、それがfalseに変更されています。私はxsi:type = "xsd:boolean"をoutgoingVar1に追加しようとしましたが、それは役に立ちません。石鹸の封筒自体は、クライアントが期待していたはずのものですが、何らかの理由でそれを正しく消費しません。これはPHP Webサービスの設定やWCFプロキシの設定と関係がありますか? PHPのWebサービスは、単純にこのように設定されています
ini_set('soap.wsdl_cache_enabled', '0');
ini_set('soap.wsdl_cache_ttl', '0');
$soapServer = new SoapServer('wsdl/sample.wsdl', array('soap_version' => SOAP_1_1));
$soapServer->addFunction('Service');
$soapServer->handle();
と機能はシンプルで終わる「trueを返します;」ライン。ここでは何も複雑ではありません。どのような問題がありますか?
注釈付きのWSDL(些細な名前空間を削除し、実際のものを修正)は次のようになります。
<wsdl:definitions name="IJLSoapResponse" targetNamespace="http://casey.com"
tns="http://casey.com" xmlns:samp="http://sample.com" ...>
<wsdl:types>
<xsd:schema targetNamespace="http://casey.com" ...>
<xsd:element name="incomingVar1" type="xsd:string" nillable="true"/>
<xsd:element name="incomingVar2" type="xsd:string" nillable="true"/>
</xsd:schema>
<xsd:schema targetNamespace="http://sample.com" ...>
<xsd:element name="outgoingVar1" type="xsd:boolean" nillable="true"/>
</xsd:schema>
</wsdl:types>
<wsdl:message name="ServiceInput">
<wsdl:part name="incomingVar1" element="tns:incomingVar1"/>
<wsdl:part name="incomingVar2" element="tns:incomingVar2"/>
</wsdl:message>
<wsdl:message name="ServiceOutput">
<wsdl:part name="outgoingVar1" element="samp:outgoingVar1"/>
</wsdl:message>
<wsdl:portType name="ServicePortType">
<wsdl:operation name="ServiceMessage" parameterOrder="incomingVar1 incomingVar2">
<wsdl:input name="ServiceMessageRequest" message="tns:ServiceInput"/>
<wsdl:output name="ServiceMessageResponse" message="tns:ServiceOutput"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="ServiceBinding" type="tns:ServicePortType">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="ServiceMessage">
<soap:operation soapAction="http://casey.com/soap/Service"/>
<wsdl:input name="ServiceMessageRequest">
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://casey.com"/>
</wsdl:input>
<wsdl:output name="ServiceMessageResponse">
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://sample.com"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="ServiceService">
<wsdl:port name="ServicePort" binding="tns:ServiceBinding">
<soap:address location="http://casey.com/soap/Service"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
これは、あなたが明確に何かが必要な場合は私に知らせて...物事が宣言されているかを確認するために十分でなければなりません。ご協力いただきありがとうございます!
WCF側の契約はどうですか? – tomasr
@caseycrites:ここで2と2をまとめるには、WCFコードの一部を参照する必要があります。私はこれをいくつかの他の人に伝えます。 – RSolberg
WCF契約はパートナーのコードなので、私はそれを手に入れることはできないと思います。申し訳ありません... –