How do I provide information to the Web Service when the
information is required as a SOAP Header?
Answer / swapna
The key here is the Web Service proxy you created using
wsdl.exe or through Visual Studio .NET's Add Web Reference
menu option. If you happen to download a WSDL file for a
Web Service that requires a SOAP header, .NET will create a
SoapHeader class in the proxy source file. Using the
previous example:
public class Service1 :
System.Web.Services.Protocols.SoapHttpClientProtocol
{
public AuthToken AuthTokenValue;
[System.Xml.Serialization.XmlRootAttribute
(Namespace="http://tempuri.org/", IsNullable=false)]
public class AuthToken : SoapHeader {
public string Token; }}
In this case, when you create an instance of the proxy in
your main application file, you'll also create an instance
of the AuthToken class and assign the string:
Service1 objSvc = new Service1();
processingobjSvc.AuthTokenValue = new AuthToken();
objSvc.AuthTokenValue.Token = <ACTUAL token value>;
Web Servicestring strResult =
objSvc.MyBillableWebMethod();
| Is This Answer Correct ? | 0 Yes | 0 No |
Enlist some web testing tools.
What is Web architecture that are followed while doing online project and tell the samples of architecture?
Have you used sass? What’s good about it?
Difference between ASP and DHTML?
Which method is used to post a Web page to another Web page?
what are the differences between webpage and webservice?
What are the types of web testing security problems?
How to do continuous marquee.. Please send me the code
What is WSDL?
What are Firewalls how they are used for testing the webapplications?
Hi Guys.. Pls let me know the Web designing / Logo designing OR Software jobs openings immediately....... Im in urgent need of job... Pls help meee
What are the steps to follow to cache parts of web form?