Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Manually setting the namespace for a Service Reference

When a Web Reference is added in Visual Studio the generated proxy class automatically uses a default namespace which consists of the application’s default namespace together with the web reference name. the problem is i have a profile web service which all my projects use that in order to authenticate. Because of the namespace i cant add a profile class as a link. Now I wonder if there is any way to manually set the Reference name? (or maybe there is a better way which could solve my problem.) So far I've found this:

1- Go to the service Reference.cs and then rename the namespace.(the problem is every time i update the service the namespace goes back to the default)

2- I found this :Manually setting the namespace for a web service proxy class in Visual Studio(the problem is i have to change the build event which it could cause the unexpected errors.)

like image 346
Mohammad Avatar asked Nov 09 '22 19:11

Mohammad


1 Answers

Use "Custom Tool" option with wsdl.exe and give the required parameters. Whenever you want to update the service reference run the custom tool by using below mentioned option.

/n[amespace]:namespace

For more information visit https://msdn.microsoft.com/en-us/library/7h3ystb6%28VS.80%29.aspx

like image 127
Sathik Khan Avatar answered Nov 14 '22 22:11

Sathik Khan