Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / May 2006

Tip: Looking for answers? Try searching our database.

using WSDL.exe programmatically

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Pierre - 24 May 2006 14:26 GMT
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
Gaurav Vaish (EduJini.IN) - 25 May 2006 09:48 GMT
Right click on the project...
and select "Add Web Reference..."
and point to the WSDL

You are done!

Signature

Happy Hacking,
Gaurav Vaish
http://www.mastergaurav.org
http://www.edujini.in
-------------------

> Hi all,
>
[quoted text clipped - 17 lines]
>
> Pierre
Pierre - 26 May 2006 11:00 GMT
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.
Robert Wilczynski - 26 May 2006 12:41 GMT
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,
>
[quoted text clipped - 13 lines]
> achieve the same in another way) I'd be gratful if this person could
> share this knowledge.
Gaurav Vaish (EduJini.IN) - 27 May 2006 14:56 GMT
>                        "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.

Signature

Happy Hacking,
Gaurav Vaish
http://www.mastergaurav.org
http://www.edujini.in
-------------------

Kirk Allen Evans - 26 May 2006 21:07 GMT
Here's an approach using
System.Web.Services.Description.ServiceDescriptionImporter:

http://blogs.msdn.com/kaevans/archive/2006/04/27/585013.aspx

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

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

> Hi and thx for the answer Gaurav,
>
[quoted text clipped - 13 lines]
> achieve the same in another way) I'd be gratful if this person could
> share this knowledge.
Pierre - 30 May 2006 11:21 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.