WCF 서비스에 기본 바인딩 인 &이 있습니다. 닷넷 클라이언트에서 잘 작동하지만 자바 클라이언트에서 같은 메소드를 호출 할 때 요청 객체의 critera 속성은 NULL이지만 wireshark에서 데이터가오고 있음을 알 수있다. .Net의 경우 웹 페이지에서 GET을 사용하지만 Java의 경우 POST를 사용합니다. 이뿐 만 아니라 OperationContext의 RequestMessage로 이동하면 xml을 볼 수 있습니다. .NET 클라이언트에서WCF : Request 개체의 다른 개체 유형 중 하나의 속성이 NULL이됩니다.
요청 메시지 : JAVA 클라이언트에서
RequestMessage {<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<To s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://mcac83101cj.us.maritz.net/CouponService/CouponService.svc</To>
<Action s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://tempuri.org/ICouponService/GetOrderByOrderId</Action>
</s:Header>
<s:Body>
<GetOrderByOrderId xmlns="http://tempuri.org/">
<orderRequest xmlns:a="http://schemas.datacontract.org/2004/07/CLinkService.Messages" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<AccessToken xmlns="http://schemas.datacontract.org/2004/07/CLinkService.MessageBase">c2bf6e1e-e6fd-4930-8a9e-da9d918bbdc4</AccessToken>
<Action xmlns="http://schemas.datacontract.org/2004/07/CLinkService.MessageBase">Read</Action>
<ClientTag xmlns="http://schemas.datacontract.org/2004/07/CLinkService.MessageBase">[email protected]$0</ClientTag>
<LoadOptions i:nil="true" xmlns="http://schemas.datacontract.org/2004/07/CLinkService.MessageBase" xmlns:b="http://schemas.microsoft.com/2003/10/Serialization/Arrays" />
<RequestId xmlns="http://schemas.datacontract.org/2004/07/CLinkService.MessageBase">93358933-7965-442f-bf38-9946ecfb3213</RequestId>
<Version i:nil="true" xmlns="http://schemas.datacontract.org/2004/07/CLinkService.MessageBase" />
<a:Criteria xmlns:b="http://schemas.datacontract.org/2004/07/CLinkService.Criteria">
<b:DealerCode i:nil="true" />
<b:Language i:nil="true" />
<b:SortExpression i:nil="true" />
<b:UserName i:nil="true" />
<b:Xslt>MPS</b:Xslt>
<b:OrderId>11</b:OrderId>
</a:Criteria>
<a:Order i:nil="true" xmlns:b="http://schemas.datacontract.org/2004/07/CLinkService.Dto" />
</orderRequest>
</GetOrderByOrderId>
</s:Body>
</s:Envelope>} System.ServiceModel.Channels.Message {System.ServiceModel.Channels.BufferedMessage}
요청 메시지 : 서버에 대한
RequestMessage {<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<To s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://mcac83101cj.us.maritz.net/CouponService/CouponService.svc</To>
<Action s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://tempuri.org/ICouponService/GetOrderByOrderId</Action>
</s:Header>
<S:Body>
<ns6:GetOrderByOrderId
xmlns:ns7="http://schemas.microsoft.com/2003/10/Serialization/"
xmlns:ns6="http://tempuri.org/"
xmlns:ns5="http://schemas.datacontract.org/2004/07/CLinkService.Dto"
xmlns:ns4="http://schemas.datacontract.org/2004/07/CLinkService.Messages"
xmlns:ns3="http://schemas.datacontract.org/2004/07/CLinkService.Criteria"
xmlns:ns2="http://schemas.microsoft.com/2003/10/Serialization/Arrays"
xmlns="http://schemas.datacontract.org/2004/07/CLinkService.MessageBase">
<ns6:orderRequest>
<Action>Read</Action>
<ClientTag>[email protected]$0</ClientTag>
<RequestId>200</RequestId>
<ns3:OrderCriteria>
<ns3:DealerCode>B0000</ns3:DealerCode>
<ns3:Language>FR</ns3:Language>
<ns3:Xslt>MPS</ns3:Xslt>
<ns3:OrderId>9</ns3:OrderId>
</ns3:OrderCriteria>
<ns5:OrderDto>
<ns5:DealerCode>B0000</ns5:DealerCode>
<ns5:Language>FR</ns5:Language>
<ns5:OrderId>11</ns5:OrderId>
</ns5:OrderDto>
</ns6:orderRequest>
</ns6:GetOrderByOrderId>
</S:Body>
</S:Envelope>} System.ServiceModel.Channels.Message {System.ServiceModel.Channels.BufferedMessage}
의 Web.config은 다음과 같습니다 :
<system.serviceModel>
<services>
<service behaviorConfiguration="CLinkService.CouponServiceBehavior" name="CLinkService.ServiceImplementations.CouponService">
<endpoint name="wsHttpBinding" address="secure" binding="wsHttpBinding" bindingConfiguration="wsBindingAction" contract="CLinkService.ServiceContracts.ICouponService">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<endpoint name="basicHttpBinding" address="" binding="basicHttpBinding" bindingConfiguration="basicBindingAction" contract="CLinkService.ServiceContracts.ICouponService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="CLinkService.CouponServiceBehavior">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<wsHttpBinding>
<binding name="wsBindingAction" transactionFlow="false" sendTimeout="00:30:00" receiveTimeout="00:30:00" maxReceivedMessageSize="524288" maxBufferPoolSize="524288">
<reliableSession enabled="true"/>
<security mode="None">
</security>
</binding>
</wsHttpBinding>
<basicHttpBinding>
<binding name="basicBindingAction" sendTimeout="00:30:00" receiveTimeout="00:30:00" maxReceivedMessageSize="524288" maxBufferPoolSize="524288">
<security mode="None">
</security>
</binding>
</basicHttpBinding>
</bindings>
</system.serviceModel>
.NET 요청은 GET에서 가져 왔습니까? GET 요청에는 본문이 포함될 수 없으므로 게시 한 예는 실제로 가질 수 없습니다. – carlosfigueira