470,815 Members | 1,042 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,815 developers. It's quick & easy.

using WSDL.exe programmatically

Hi all,

I'm building a small app that allows users to create proxys by clicking
on an interface (web, winform).

I started my project, imported wsdl.exe (add reference) and tried to
figure out a way to use it programmatically (throught object browser,
research engines, msdn...).

But I have to admit it looks a bit opaque to me.

If anybody has some tips/knowledge on how to simply convert a command
line: wsdl.exe /l:CS /edb /n:My.Company.Namespace /sharetypes
http://someserver/someservices.asmx into an app with a user interface,
I'll be very happy to hear about it.

Looking forward to hear from you.

Best regards,

Pierre

May 24 '06 #1
6 2545
Right click on the project...
and select "Add Web Reference..."
and point to the WSDL

You are done!
--
Happy Hacking,
Gaurav Vaish
http://www.mastergaurav.org
http://www.edujini.in
-------------------
"Pierre" <bu****@no-log.org> wrote in message
news:11**********************@i39g2000cwa.googlegr oups.com...
Hi all,

I'm building a small app that allows users to create proxys by clicking
on an interface (web, winform).

I started my project, imported wsdl.exe (add reference) and tried to
figure out a way to use it programmatically (throught object browser,
research engines, msdn...).

But I have to admit it looks a bit opaque to me.

If anybody has some tips/knowledge on how to simply convert a command
line: wsdl.exe /l:CS /edb /n:My.Company.Namespace /sharetypes
http://someserver/someservices.asmx into an app with a user interface,
I'll be very happy to hear about it.

Looking forward to hear from you.

Best regards,

Pierre

May 25 '06 #2
Hi and thx for the answer Gaurav,

Unfortunatly I have around 20 WSs to link this way and some are
added/modified on a regular basis (quite a nightmare I admit).

The idea is to build a tool that builds 1 proxy for all these WSs using
1 namespace...(i'll pass all the advantages given by using wsdl.exe
against using the Add Web Reference).

If the user has to click on 1 button instead of asking me to do the
proxy I could save up some time to do more interesting things. I have
done a .bat, but the exe not being at the same path on every computers,
it's a rather limited approach.

Once more if anyone knows how to use WSDL.exe programmatically (or to
achieve the same in another way) I'd be gratful if this person could
share this knowledge.

May 26 '06 #3
Hi Pierre,

You may want to try the following:

System.Diagnostics.ProcessStartInfo wsdlExeStartInfo = new System.Diagnostics.ProcessStartInfo(
"wsdl.exe", "/l:CS /edb /n:My.Company.Namespace /sharetypes
http://someserver/someservices.asmx");
System.Diagnostics.Process wsdlExe = System.Diagnostics.Process.Start(wsdlExeStartInfo) ;

You can of course wrap it in a method and parameterize the arguments passed
to wsdl.exe.
I believe you cannot redistribute wsdl.exe with your applications so you
will have to somehow locate it on the client machine and include .Net SDK
as a prerequisite for your application.

Does that help?

Best regards,
Robert Wilczynski.
Hi and thx for the answer Gaurav,

Unfortunatly I have around 20 WSs to link this way and some are
added/modified on a regular basis (quite a nightmare I admit).

The idea is to build a tool that builds 1 proxy for all these WSs
using 1 namespace...(i'll pass all the advantages given by using
wsdl.exe against using the Add Web Reference).

If the user has to click on 1 button instead of asking me to do the
proxy I could save up some time to do more interesting things. I have
done a .bat, but the exe not being at the same path on every
computers, it's a rather limited approach.

Once more if anyone knows how to use WSDL.exe programmatically (or to
achieve the same in another way) I'd be gratful if this person could
share this knowledge.

May 26 '06 #4
Here's an approach using
System.Web.Services.Description.ServiceDescription Importer:

http://blogs.msdn.com/kaevans/archiv...27/585013.aspx

Kirk Allen Evans [msft]
blogs.msdn.com/kaevans

====Provided As-Is and Implies no Warranty====

"Pierre" <bu****@no-log.org> wrote in message
news:11*********************@38g2000cwa.googlegrou ps.com...
Hi and thx for the answer Gaurav,

Unfortunatly I have around 20 WSs to link this way and some are
added/modified on a regular basis (quite a nightmare I admit).

The idea is to build a tool that builds 1 proxy for all these WSs using
1 namespace...(i'll pass all the advantages given by using wsdl.exe
against using the Add Web Reference).

If the user has to click on 1 button instead of asking me to do the
proxy I could save up some time to do more interesting things. I have
done a .bat, but the exe not being at the same path on every computers,
it's a rather limited approach.

Once more if anyone knows how to use WSDL.exe programmatically (or to
achieve the same in another way) I'd be gratful if this person could
share this knowledge.


May 26 '06 #5
> "wsdl.exe", "/l:CS /edb /n:My.Company.Namespace
/sharetypes http://someserver/someservices.asmx");
System.Diagnostics.Process wsdlExe =
System.Diagnostics.Process.Start(wsdlExeStartInfo) ;


Would like to add just one modification, based on Piere's requirements.

0. Create a file services.txt with list of all asmx/services, one per line
1. Invoke the code above in a loop and replace the hard-coded location with
what you read from the file.
--
Happy Hacking,
Gaurav Vaish
http://www.mastergaurav.org
http://www.edujini.in
-------------------
May 27 '06 #6
Thank you for the fast and helpful answers guys,

Very nice article you've written there Kirk, that's what I needed.

Thank you again I appreciate the help.

Pierre

May 30 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Daniel Thune, MCSE | last post: by
1 post views Thread by Savas Ates | last post: by
2 posts views Thread by Anbu | last post: by
5 posts views Thread by Pete Wittig | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.