Solved

How to pass username/password to svcutil.exe?

Posted on 2011-03-23
8
3,918 Views
Last Modified: 2013-11-19
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
Comment
Question by:develc
  • 6
  • 2
8 Comments
 
LVL 18

Assisted Solution

by:DarrenD
DarrenD earned 200 total points
ID: 35205391
Hi,

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

Cheers,

Darren
0
 
LVL 1

Author Comment

by:develc
ID: 35205598
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
 
LVL 1

Author Comment

by:develc
ID: 35239312
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
 
LVL 18

Expert Comment

by:DarrenD
ID: 35239381
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 1

Author Comment

by:develc
ID: 35239595
This has to be done programatically. I can't use a browser.
0
 
LVL 1

Accepted Solution

by:
develc earned 0 total points
ID: 35276521
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
 
LVL 1

Author Comment

by:develc
ID: 35312816
This link helped a lot too:
Dynamic Programming with WCF
0
 
LVL 1

Author Closing Comment

by:develc
ID: 35321649
Found the solution
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Please explain "Multi-Tenant Services" 5 65
Vb.net dynamic formulas in runtime 11 63
System.Speech 2 17
C#  Radio button search for Date not DateTime 4 35
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now