none
How To Post to WCF SOAP Service RRS feed

  • Question

  • Hi all,

    I have a really dumb question but my brain isn't working today.

    I developing a consumer service that is being called by another service. The other service provided a WSDL which I reference and implement the interface.

    Their tester is posting directly to the service name and not the method. The funny thing is, the method isn't even exposed...meaning I don't see it in SOAP UI. They are not getting back the SOAP response because it's not posting to the method.

    How to set or route a default method to the service so that if someone posts to the servicename only, it will know to pass to a default method?

    Thanks,

    Adam


    Try to look ahead so you're not forced to look behind.

    Friday, September 1, 2017 3:02 PM

Answers

  • Hi Adam,

    >>Their tester is posting directly to the service name and not the method. The funny thing is, the method isn't even exposed

    What do you mean by that tester did not send method, and the method is not exposed? Did the tester test your service or the other service?

    >>How to set or route a default method to the service so that if someone posts to the servicename only, it will know to pass to a default method?

    Do you want to achieve this requirement in your service or the other service? If you mean other service, you need to confirm with the developer.

    If you mean your service, what is your service type?

    For a SOAP Service, the method is required, and as far as I know, there is no default setting for SOAP Service to enable default method. You may consider routing by IIS like URL Redirect or set up a proxy.

    For a Rest Service, you could try to set UriTemplate as empty.

    Here is a simple code.

       [ServiceContract]
        public interface ITestService
        {
            [OperationContract]
            [WebGet(UriTemplate = "")]
            Stream DefaultMethod();
        }

    Best Regards,

    Edward


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Adam_Turner Tuesday, October 3, 2017 7:18 PM
    Monday, September 4, 2017 2:40 AM