none
WCF not submitting SOAPAction in HTTP header RRS feed

  • Question

  • I'm trying to call a webservice hosted on a Java platform.

    If i make the call without any security it works fine.

    If i sign the message I get this error response:

     

    FaultException
    no SOAPAction header!
    {http://xml.apache.org/axis/}hostname:tssdemo2

     

    I have traced the communication with WireShark and found that SOAPAction in fact is not submitted on the signed message.
    The service uses soap1.1


    if i change messageVersion in app.config from

              <textMessageEncoding messageVersion="Soap11" />

    to one of the following:
              <textMessageEncoding messageVersion="Soap11WSAddressing10" />

              <textMessageEncoding messageVersion="Soap11WSAddressingAugust2004" />

    SOAPAction header is provided


    POST http://www....... HTTP/1.1

    Content-Type: text/xml; charset=utf-8

    SOAPAction: ""

    Host: www.....

    Content-Length: 7970

    Expect: 100-continue

    Accept-Encoding: gzip, deflate

    Proxy-Connection: Keep-Alive

     

    But I also gets some unwanted tags in the soap header:
    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
    <s:Header>
     <Action a:mustUnderstand="1" u:Id="_2" xmlns="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:a="http://schemas.xmlsoap.org/soap/envelope/"/>
     <MessageID u:Id="_3" xmlns="urn:uuid:507711a2-57cb-465f-97ac-8b427c2df215</MessageID">http://schemas.xmlsoap.org/ws/2004/08/addressing">urn:uuid:507711a2-57cb-465f-97ac-8b427c2df215</MessageID>
     <ReplyTo u:Id="_4" xmlns="http://schemas.xmlsoap.org/ws/2004/08/addressing">
      <Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</Address>
     </ReplyTo>

    The webservice in the other end then rejects the message

    Acording to this document: http://www.w3.org/TR/2000/NOTE-SOAP-20000508/#_Toc478383528

    SOAPAction is required when using Soap11

    Is this a matter of configuration of the client or a fault in the WCF implementation of soap ?

    Here is the app.config:

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
      <startup>
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
      </startup>

      <system.serviceModel>
        <extensions>
          <bindingElementExtensions>
            <add name="StrippingChannel" type="POC005_StrippingChannel.StrippingChannelBindingElementExtensionElement, POC005"/>
          </bindingElementExtensions>
        </extensions>


        <bindings>

          <customBinding>
            <binding name="MyCustomBinding">
              <textMessageEncoding messageVersion="Soap11" />
              <security allowSerializedSigningTokenOnReply="true"
                        authenticationMode="MutualCertificate"
                        requireDerivedKeys="false"
                        securityHeaderLayout="Lax"
                        includeTimestamp="false"
                        enableUnsecuredResponse="true"
                        keyEntropyMode="ClientEntropy"
                        messageProtectionOrder="SignBeforeEncrypt"
      messageSecurityVersion="WSSecurity10WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10">
                <localClientSettings detectReplays="false"/>
                <localServiceSettings detectReplays="false"/>
                <secureConversationBootstrap>
                  <localClientSettings detectReplays="false"/>
                  <localServiceSettings detectReplays="false"/>
                </secureConversationBootstrap>
              </security>
              <StrippingChannel />
             
              <httpTransport>
                <extendedProtectionPolicy policyEnforcement="Never"  />

              </httpTransport>
            </binding>
          </customBinding>


        </bindings>
        <behaviors>
          <endpointBehaviors>
            <behavior name="endpointCredentialsBehavior">
              <clientCredentials>
                <clientCertificate findValue="d0dcfe968a6920e5db7c8829b04eceba6f1aecb6"
                                   storeLocation="CurrentUser"
                                   storeName="My"
                                   x509FindType="FindByThumbprint" />
                <serviceCertificate>
                  <defaultCertificate findValue="86123784c4746cc2c3085a7cbd8a5e95ea4405a9"
                                   storeLocation="CurrentUser"
                                   storeName="My"
                                   x509FindType="FindByThumbprint" />
                </serviceCertificate>
              </clientCredentials>
            </behavior>

          </endpointBehaviors>
        </behaviors>

        <client>
          <endpoint address="http://www......"
                    binding="customBinding"
                    bindingConfiguration="MyCustomBinding"
                    contract="PAServicePortType"
                    name="PAServicePort"
                    behaviorConfiguration="endpointCredentialsBehavior"
                    >
            <identity>
              <dns value="Identity replace"/>
            </identity>
          </endpoint>
        </client>
      </system.serviceModel>
    </configuration>

    Wednesday, June 25, 2014 2:08 PM

All replies

  • Hi,

    Maybe you can create your custom SoapAction for WCF as following:

    We can specify the Action property on the operation contract:

    [ServiceContract]
    public interface IMyServiceContract
    {
        [OperationContract(Action = "http://www.TextXYZ.com/FUNC/1/0/action/MyMethod")]
        void MyMethod();
    }

    We can also set the ReplyAction if you need to.

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, June 26, 2014 6:51 AM
    Moderator
  • Hi,

    Maybe you can create your custom SoapAction for WCF as following:

    We can specify the Action property on the operation contract:

    [ServiceContract]
    public interface IMyServiceContract
    {
        [OperationContract(Action = "http://www.TextXYZ.com/FUNC/1/0/action/MyMethod")]
        void MyMethod();
    }

    We can also set the ReplyAction if you need to.

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    I'm working on the client side and have not access to the serverside. Serverside is not to be changed by vendor.

    SOAPAction is expected to look like this: SOAPAction: ""

    Serverside is running something unknown to me called Axis, Apache and Java.

    I have tried to mess with the wsdl to simulate the decorations You provided, but with no success

    Thursday, June 26, 2014 8:05 AM
  • It seems that your service is a java web service.

    Try check (How to add SOAP action to the webservice in java?)

    Thanks.

    Wednesday, July 9, 2014 10:03 AM