none
Change <SOAPAction>“”</SOAPAction> on request recieved in WCF RRS feed

  • Question

  • I have a WCF service implemented via custom wsdl. It simple have 5 methods as per wsdl. Call to My service from standard client works fine. Problem was in some old implementation which send SoapAction="" I wanted to change the soapAction to some value if i got empty. For that I have implemented CustomBehavior but even in it I can't able to hit AfterReceiveRequest method or any method in the behavior

    public class CustomInspectorBehavior : Attribute, IDispatchMessageInspector, 
            IClientMessageInspector, IEndpointBehavior, IServiceBehavior

    Any idea i can response even if i have SOAPAction="" in the request

    My other post o stackoverflow is as following

    http://stackoverflow.com/questions/34224657/change-soapaction-soapaction-on-request-recieved-in-wcf


    Kamran Shahid Application Developer (MCP,MCAD,MCSD.NET,MCTS,MCPD.net[web])

    Saturday, December 12, 2015 8:39 AM

Answers

  • Hi Kamran,

    You want to change the soapAction as shown below node?

    <soap12:operation soapAction="http://tempuri.org/ISubscriptionEvents/MyMethod" style="document"" />

    If so, you can change your code like this:

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

    Then it will shown as this :

    <soap12:operation soapAction="http://www.TextXYZ.com/FUNC/1/0/action/MyMethod" style="document" />

    Regards,

    Vince

    Thursday, December 24, 2015 11:06 AM