Server Side
<ServiceContract(Name:="Services")> _
Public Interface ICPServices
<OperationContract(Action:="urn:abc", Name:="abc")> _
Function abc(nameAs String) As String
End Interface
web.config
<bindings>
<wsHttpBinding>
<binding name="ws">
<security mode="None"></security>
</binding>
</wsHttpBinding>
</bindings>
<service name="CPServices.CPServices" >
<endpoint address="" binding="wsHttpBinding" contract="CPServices.ICPServices" bindingConfiguration="ws">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
Client side send
Raw
POST http://localhost/CPServices.CPServices.svc/mex HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: application/soap+xml;charset=UTF-8;action="urn:abc"
Content-Length: 1230
Host: 117.53.152.172:81
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)'
Xml
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:typ="http://abc.com">
<soap:Header/>
<soap:Body>
<typ:abc>
<typ:name>?</typ:name>
</typ:abc>
</soap:Body>
</soap:Envelope>
Error
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing">
<s:Header>
<a:Action s:mustUnderstand="1">http://www.w3.org/2005/08/addressing/fault</a:Action>
</s:Header>
<s:Body>
<s:Fault>
<s:Code>
<s:Value>s:Sender</s:Value>
<s:Subcode>
<s:Value>a:ActionMismatch</s:Value>
</s:Subcode>
</s:Code>
<s:Reason>
<s:Text xml:lang="en-US">The SOAP action specified on the message, '', does not match the HTTP SOAP Action, 'urn:abc'.</s:Text>
</s:Reason>
<s:Detail>
<a:ProblemHeaderQName>a:Action</a:ProblemHeaderQName>
</s:Detail>
</s:Fault>
</s:Body>
</s:Envelope>
Isn't I setting wrong thing and cause it can't get soap action? Any solution?