0
を持っているにもかかわらず、私はこの非常に簡単な方法でWCFクライアントを使用している、ヌル値で応答を受け取る:WCFクライアント応答がデータ
using (var client = new ExampleService_TestClient())
{
client.ClientCredentials.UserName.UserName = "user";
client.ClientCredentials.UserName.Password = "pass";
var request = new ExampleService_TestRequest(requestData);
var response = client.ExampleService_Test(request);
// response.Response_MT is null
// when it should have errorMsg="OK"
}
データが正しく送信されます。
応答プロパティerrorMsgはnullです。ここで
は封筒です:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Inbound_MT xmlns="https://example.com/ExampeService/">
<event_id xmlns="">1</event_id>
<event_name xmlns="">insert</event_name>
<event_date xmlns="">2017-06-22 16:09</event_date>
<employee_number xmlns="">666</employee_number>
<employee_first_name xmlns="">Chuck</employee_first_name>
<employee_last_name xmlns="">Inserted Norris</employee_last_name>
</Inbound_MT>
</s:Body>
</s:Envelope>
私はシオマネキ使用して参照応答:あなたのリターンがXMLであるように見えるあなたのWSDLに基づいて
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:p1="https://example.com/ExampeService/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" targetNamespace="https://example.com/ExampeService/">
<wsdl:types>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="https://example.com/ExampeService/" targetNamespace="https://example.com/ExampeService/">
<xsd:element name="Inbound_MT" type="Inbound_DT" />
<xsd:element name="Response_MT" type="Response_DT" />
<xsd:complexType name="Inbound_DT">
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" name="event_id" type="xsd:integer" />
<xsd:element maxOccurs="1" minOccurs="1" name="event_name" type="xsd:string" />
<xsd:element maxOccurs="1" minOccurs="1" name="event_date" type="xsd:string" />
<xsd:element maxOccurs="1" minOccurs="1" name="employee_number" type="xsd:string" />
<xsd:element maxOccurs="1" minOccurs="0" name="employee_first_name" type="xsd:string" />
<xsd:element maxOccurs="1" minOccurs="0" name="employee_last_name" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="Response_DT">
<xsd:sequence>
<xsd:element name="errorMsg" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</wsdl:types>
<wsdl:message name="Inbound_MT">
<wsdl:documentation />
<wsdl:part element="p1:Inbound_MT" name="Inbound_MT" />
</wsdl:message>
<wsdl:message name="Response_MT">
<wsdl:documentation />
<wsdl:part element="p1:Response_MT" name="Response_MT" />
</wsdl:message>
<wsdl:portType name="ExampleService_Test">
<wsdl:documentation />
<wsdl:operation name="ExampleService_Test">
<wsdl:documentation />
<wsdl:input message="p1:Inbound_MT" />
<wsdl:output message="p1:Response_MT" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="ExampleService_TestBinding" type="p1:ExampleService_Test">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
<wsp:Policy>
<wsp:PolicyReference URI="#BN__binding" />
</wsp:Policy>
<wsdl:operation name="ExampleService_Test">
<soap:operation soapAction="https://example.com/ExampeService//ExampleService_Test" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="SOME_GREAT_SERVICE">
<wsdl:documentation>WS_GS</wsdl:documentation>
<wsdl:port binding="p1:ExampleService_TestBinding" name="ExampleService_Test">
<soap:address location="https://endpointaddress/cxf/ExampleService_Test" />
</wsdl:port>
</wsdl:service>
<wsp:UsingPolicy required="true" />
<wsp:Policy wsu:Id="BN__binding">
<wsp:ExactlyOne>
<wsp:All>
<sp:TransportBinding xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
<wsp:Policy>
<sp:TransportToken>
<wsp:Policy>
<sp:HttpsToken>
<wsp:Policy>
<wsp:ExactlyOne>
<sp:HttpBasicAuthentication />
<sp:RequireClientCertificate />
</wsp:ExactlyOne>
</wsp:Policy>
</sp:HttpsToken>
</wsp:Policy>
</sp:TransportToken>
<sp:AlgorithmSuite>
<wsp:Policy>
<wsp:ExactlyOne>
<sp:Basic256 />
<sp:Basic192 />
<sp:Basic128 />
<sp:TripleDes />
<sp:Basic256Rsa15 />
<sp:Basic192Rsa15 />
<sp:Basic128Rsa15 />
<sp:TripleDesRsa15 />
<sp:Basic256Sha256 />
<sp:Basic192Sha256 />
<sp:Basic128Sha256 />
<sp:TripleDesSha256 />
<sp:Basic256Sha256Rsa15 />
<sp:Basic192Sha256Rsa15 />
<sp:Basic128Sha256Rsa15 />
<sp:TripleDesSha256Rsa15 />
</wsp:ExactlyOne>
</wsp:Policy>
</sp:AlgorithmSuite>
<sp:Layout>
<wsp:Policy>
<sp:Strict />
</wsp:Policy>
</sp:Layout>
</wsp:Policy>
</sp:TransportBinding>
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
</wsdl:definitions>