How to add a basic soap request to WSDL

How can I use AUTH BASIC soap for WSDL, so who ever reads WSDL knows that I need this operation for a specific method?

+2
source share
2 answers

Using the example below, I was able to pass a basic SOAP alert to the php web service on the other end. PHP.net/Soapclient has a simple working example, but in csharp I found this link to solve my problem.

link

Michaelis.MockService is an extracted Webservice library, you can see an example of how to do this: link Mono project website.

Michaelis.MockService service = new Michaelis.MockService();

// Create the network credentials and assign
// them to the service credentials
NetworkCredential netCredential = new NetworkCredential("Inigo.Montoya", "Ykmfptd");
Uri uri = new Uri(service.Url);
ICredentials credentials = netCredential.GetCredential(uri, "Basic");
service.Credentials = credentials;

// Be sure to set PreAuthenticate to true or else
// authentication will not be sent.
service.PreAuthenticate = true;

// Make the web service call.
service.Method();
+1
source

, .

0

All Articles