Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Server Side

VB
<ServiceContract(Name:="Services")> _
Public Interface ICPServices

    <OperationContract(Action:="urn:abc", Name:="abc")> _
    Function abc(nameAs String) As String

End Interface


web.config

XML
<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
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
XML
<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?
Posted
Updated 17-Oct-13 22:25pm
v4

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900