0

WCF で SOAP 1.1 Web サービスを使用しようとしています。wsdl 定義から svcutil でプロキシを生成した後、すべての応答が null.

サービスは RPC リテラルを使用しているように見えるため、WCF は を使用するようにフォールバックしXmlSerializerます。wsdl の定義は次のとおりです。

<wsdl:definitions xmlns:typens="http://www.myservice.es/Schemas" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://www.myservice.es/Schemas">

<wsdl:types>
    <xsd:schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.myservice.es/Schemas">
        <xsd:include schemaLocation="../xsd/myservicetypes.xsd"/>           
    </xsd:schema>
</wsdl:types>
<message name="serviceRequest"/>
<message name="serviceResponse">
    <part name="serviceReturn" type="typens:DateTimeResponse"/>
</message>
<portType name="QueryServiceDateTimePort">
    <operation name="QueryServiceDateTime">
        <input message="typens:serviceRequest"/>
        <output message="typens:serviceResponse"/>
    </operation>
</portType>
<binding name="QueryServiceDateTimeBinding" type="typens:QueryServiceDateTimePort">
    <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
    <operation name="QueryServiceDateTime">
        <soap:operation soapAction="urn:QueryServiceDateTime"/>
        <input>
            <soap:body use="literal" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://www.myservice.es/Schemas"/>
        </input>
        <output>
            <soap:body use="literal" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://www.myservice.es/Schemas"/>
        </output>
    </operation>
</binding>
<service name="QueryServiceDateTimeService">
    <port name="QueryServiceDateTimePort" binding="typens:QueryServiceDateTimeBinding">
        <soap:address location="https://www.tests.com"/>
    </port>
</service>

ただし、サービスは次の応答を返します。

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
   <SOAP-ENV:Header/>
   <SOAP-ENV:Body>
      <serviceResponse>
         <serviceReturn>
            <DateTime v="2013-04-20T01:13:22.001" xmlns="http://www.myservice.es/Schemas"/>
         </serviceReturn>
      </serviceResponse>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

WCF と SoapUI はどちらも、QueryServiceDateTimeResponse代わりにまたは beforeという名前の要素を想定serviceResponseしているため、応答の逆シリアル化または検証に失敗します。

WCF にこの応答を調整させ、逆シリアル化させるにはどうすればよいですか? とにかくプロキシをマークして、その要素をアンラップできますか?

RPC - Literal と互換性がないため、このシナリオでは MessageContract を使用できないことに注意してください。

4

1 に答える 1