[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4509
  • Last Modified:

How to pass username/password to svcutil.exe?

Hello Experts,

I have several  WCF services which use custom Basic HTTP authentication.
These are third party services and the only thing I know about them is the address of the contracts and the binding (mostly httpsBasic).

How can I pass username/password to svcutil.exe tool so it can be run against this service to generate a client?

I can't see any /username and /password command line switches like wsdl.exe has.
Probably it can be done using configuration file and /svcutilConfig switch, but I can't figure out what config section should I use to specify username/password.

Can anybody help me with this?
Thank you.
0
develc
Asked:
develc
  • 6
  • 2
2 Solutions
 
DarrenDCommented:
Hi,

Can't you just save the WSDL file and create it from that?

Cheers,

Darren
0
 
develcAuthor Commented:
Hello Darren,

I need not only the wsdl but the xsd files too and I don't know how many of them will be.

Example:
http://localhost:6857/Service1.svc?wsdl
http://localhost:6857/Service1.svc?xsd=xsd0
http://localhost:6857/Service1.svc?xsd=xsd1
http://localhost:6857/Service1.svc?xsd=xsd2
... etc.
0
 
develcAuthor Commented:
I didn't find any solution yet.
Could I save the wsdl and the related xsd files somehow, so I could use them with svcutil.exe locally?
I can save the wsdl with the help of HttpWebRequest, but how can i attach the xsd files too?
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
DarrenDCommented:
Hi again,

If you save the WSDL the locations of the XSD files will be in the WSDL file. From there you can see what XSD files you need and download them by copying the URL in the WCDL file into a browser and saving them locally.

Hope this helps,

Darren
0
 
develcAuthor Commented:
This has to be done programatically. I can't use a browser.
0
 
develcAuthor Commented:
I found a solution to the problem. I can save the wsdl and the xsd-s locally with DiscoveryClientProtocol and after that I can use svcutil on them.
Here is the link, where the solution for this problem is:
http://mikehadlow.blogspot.com/2007/04/resolving-mutipart-wsdl-documents-with.html
0
 
develcAuthor Commented:
This link helped a lot too:
Dynamic Programming with WCF
0
 
develcAuthor Commented:
Found the solution
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 6
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now