locked
How to configure a consumed SOAP webservice while moving .net website to production RRS feed

  • Question

  • User1707585736 posted

    Hi All,

    I have a .net website where I am accessing a SOAP Webservice.

    I have tested everything and it is time to move to UAT environment.

    IN UAT environment the SOAP webservices are in a different IP.

    I changed the the IP in web.config but I dont find the webservices getting updated to point new location.

    When I add this by adding webreference things are working.

    But my client is not ready to remove and add webreference, but want to make changes in web.config only.

     

    Any help?

    Thanks,

    Swapna.

    Monday, January 7, 2013 6:50 AM

Answers

  • User-663458986 posted

    Yes you need to change in those files.

    i am not able to find any authentic reading material for this, its just from my past experience with webservices.

    actually what happens is, when we add a webreference to VS project, it creates a proxy class and keeps the URL inside wsdl & disco files.

    there is one more approach i used long time ago.

    before you consume the method of your webservice, change the URL of your service in object.

    for e;g,

    ServiceNamespace.Class obj = new ServiceNamespace.Class();

    obj.Url = "New URL\service.asmx";

    obj.ConsumeYourMethod();

    for testing pupose execute, Response.Write(obj.Url); before and after changing the URL. ofcourse make sure you have same webservices deployed at different locations. otherwise you'll encounter soap exceptions.

    i am not a Gru in this area, but this has worked for me. may be somebuddy else can share a good reading material. 

    http://social.msdn.microsoft.com/Forums/en-US/asmxandxml/thread/b3445454-fee1-48ea-a256-919082069489/

    http://dotnet-magic.blogspot.com/2008/09/dynamically-change-url-of-web-service.html

    http://stackoverflow.com/questions/7483917/how-to-change-web-service-url-dynamically

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, January 8, 2013 5:42 AM

All replies

  • User-663458986 posted

    if i am not wrong you need to change the Service URL in disco and wdl files of published version.

    Monday, January 7, 2013 7:58 AM
  • User1707585736 posted

    Hi Furry,

    Thanks for the response. That means I need to change the ips in wsdl file and disco file generated by visual studio when we do add webreference?

    Is there any white paper refering this issue and I can show this to my client as proof?

    Thanks for any help,

    Swapna.

     

    Tuesday, January 8, 2013 3:23 AM
  • User-663458986 posted

    Yes you need to change in those files.

    i am not able to find any authentic reading material for this, its just from my past experience with webservices.

    actually what happens is, when we add a webreference to VS project, it creates a proxy class and keeps the URL inside wsdl & disco files.

    there is one more approach i used long time ago.

    before you consume the method of your webservice, change the URL of your service in object.

    for e;g,

    ServiceNamespace.Class obj = new ServiceNamespace.Class();

    obj.Url = "New URL\service.asmx";

    obj.ConsumeYourMethod();

    for testing pupose execute, Response.Write(obj.Url); before and after changing the URL. ofcourse make sure you have same webservices deployed at different locations. otherwise you'll encounter soap exceptions.

    i am not a Gru in this area, but this has worked for me. may be somebuddy else can share a good reading material. 

    http://social.msdn.microsoft.com/Forums/en-US/asmxandxml/thread/b3445454-fee1-48ea-a256-919082069489/

    http://dotnet-magic.blogspot.com/2008/09/dynamically-change-url-of-web-service.html

    http://stackoverflow.com/questions/7483917/how-to-change-web-service-url-dynamically

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, January 8, 2013 5:42 AM