locked
Multiple web service ref in a solution with SoapExtensionType RRS feed

  • Question

  • User-1623675128 posted

    Hello,

    We have a project whihc has to call a web service with soapextenionType which we have added in  app.config file of the startup rpoject nad its working great.

    But the problem now is, in the same project we have to call another webservice#2 which doenst have any soap extension type; When we are debugging this the call is not going to webservice#2 as before making a call to service#2 its calling soapextenions class of service#1.

    How to avoid this getting first service soap extenion into second client.

    our confi looks like below..

    <system.web> 
        <webServices> 
        <soapExtensionTypes> 
          <add type="InterfaceLibrary.XXXClientExtension,InterfaceLibrary" priority="1" group="Low"/>  

        </soapExtensionTypes> 
      </webServices> 
      </system.web>

    the second service is in different namespace all together if we comapre with forst one.

     

    Friday, September 27, 2013 12:47 AM

Answers

  • User-742633084 posted

    Hi ramana123,

    For ASP.NET webservice, if you want to apply SoapExtension to them, there are two approaches:

    1. Register the SoapExtension in app.config file. This approach will make the SoapExtension apply to all webservices in the same .NET application
    2. Register the SoapExntension via custom Attribute on the certain webservice method. This approach will make the SoapExtension only take effect on specific web methods.

    #SOAP Message Modification Using SOAP Extensions 
    http://msdn.microsoft.com/en-us/library/esw638yk(v=vs.85).aspx

    So for your scenario, I think you can consider switching to use the attribute based approach for registering SoapExtension.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, October 2, 2013 3:10 AM

All replies

  • User-1623675128 posted

    any insight on this? we are really stuck with this!

    Tuesday, October 1, 2013 8:14 AM
  • User-742633084 posted

    Hi ramana123,

    For ASP.NET webservice, if you want to apply SoapExtension to them, there are two approaches:

    1. Register the SoapExtension in app.config file. This approach will make the SoapExtension apply to all webservices in the same .NET application
    2. Register the SoapExntension via custom Attribute on the certain webservice method. This approach will make the SoapExtension only take effect on specific web methods.

    #SOAP Message Modification Using SOAP Extensions 
    http://msdn.microsoft.com/en-us/library/esw638yk(v=vs.85).aspx

    So for your scenario, I think you can consider switching to use the attribute based approach for registering SoapExtension.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, October 2, 2013 3:10 AM