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 |
What are different Layers in TCP/IP?
How have you used ActionScript in your Flash development? To what length?
If My Application is down what are the resonations?
What is frame level testing and how do we test it?
How to test whether the navigation i.e. from one page to another is working r not using QTP for web based application
What do you understand by client-server testing?
Have you used sass? What’s good about it?
Can you get a virus from website?
Explain Working of Proxy Server, Cookies, types of cookies?
Enlist some important test scenarios for testing a website.
Differentiate between static and dynamic website.
Who is ui/ux developer? What he does?