German Wear Discount Shop - Click Here Write for Dotnet-friends and earn for your each submission [Dot]Net-Friends
Skip Navigation Links
Home
Latest
Fast Code
Articles
Tutorials
Online Resources
Forums
Login   | Hi, Guest


Adding Web Reference to a Web Service from a Virtual IP URL

Written by s2a2n2 on May 10, 2008
When we add Web Reference to a Web Service from local client Application, the port number of the proxy server (for ex 6098 ) is attached to the actual VIP URL in the

Explaination:

When we add Web Reference to a Web Service from local client Application, the port number of the proxy server (for ex 6098 ) is attached to the actaul VIP URL in the client proxy class instead of Listener port number of the actual proxy server (VIP URL in our case). This is the reason why port number 6098 is appended to the VIP  and not allowing to call the remote WebService. 

 when we use direct URL instead of VIP, there are no issues. 

 

Workaround for this: 

 

1) Use wsdl.exe tool of Visual Studio to generate the proxy class instead of using Add Web Reference wizard, modify the URL in the proxy class constructor to remove the port number at the end, compile it and add reference to this assembly in the Client application as reference to a normal assembly instead of Web Reference (Internally Add Web Reference wizard also uses wsdl.exe to create proxy class). 

(or) 

 

2) While adding Web Reference for the service, instead of specifying direct URL, specify URL?wsdl and then add the Web Reference. 

 

Ex: Type -->http://VIPURL/ --> -->MyWebService --> -->/ --> -->MyWebService --> -->.asmx -->?wsdl in the URL field instead of -->http://VIPURL/ --> -->MyWebService --> -->/ --> -->MyWebService --> -->.asmx --> -->x --> 

 

After adding the Web Reference, modify the web.config to change the URL to remove the port number at the end. 

 

Modify the appSettings entry of the Web.Config 

<add key=" -->VIPURL -->. -->MyWebService -->" value="http:// -->VIPURL -->:6098/ -->MyWebService -->/ -->MyWebService -->.asmx"/> 

to 

<add key=" -->VIPURL -->. -->MyWebService -->"
value
=" -->http:// --> -->VIPURL --> -->/ --> -->MyWebService --> -->/ --> -->MyWebService --> -->.asmx -->"/>
Visitors/Readers Comments
(for questions please use The Forum)



Jorg

Thanks for your guidence. It is what we were looking for. I was just tired of searching from two days :)

wish you good luck man!

10/05/2008 10:06:32 UTC

sunny
Its really a great article which I have been struggling for almost a week to find out the solution for this in my organization. thanks a lot!

11/05/2008 22:19:40 UTC

kamal
Really fantastic work...keep going and bring in more articles of this kind

14/05/2008 06:13:53 UTC




Add your Comments

Name:  
Message:
Note: For faster response please use Forums >> for your questions instead of the comments area! (Admin)