I have a asp.net website in visual studio 2013. I added a webservice. I need to send authentication parameter (username and password) as SOAP header. But it cannot find the property RequestSoapContext.
I added using Microsoft.Web.Services3; in my code.
CCWS.Service proxy = new CCWS.Service();
UsernameToken userToken = new UsernameToken("", "", PasswordOption.SendPlainText);
proxy.RequestSoapContext.Security.Tokens.Add(token);
Some forum says to change reference type in reference.cs file. But I cannot find any such file in my solution. Can anyone please help?
This question is rather old but after searching around, it appears the solution is to hand modify the generated proxy code to inherit from Microsoft.Web.Services3.WebServicesClientProtocol
not System.Web.Services.Protocols.SoapHttpClientProtocol
.
Generate Code Using WseWsdl3.exe Locate the WseWsdl3.exe downloaded as part of wse 3.0 and execute the following command: C:\samples\wse>WseWsdl3.exe C:\samples\wse\us.wsdl /out:c:\samples\wse\myProxyClass.cs /protocol:SOAP /type:webClient
I guess this may help you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With