How do I provide information to the Web Service when the
information is required as a SOAP Header?
Answer Posted / 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 |
Post New Answer View All Answers
Is it right way to earn revenue through google adsense? Is it Possible?
What are dynamic pages?
when my application is overloaded?
1. How can u know that the DB has connected to ur WLS? 2. What happen when u deploy a ear file in web applications? 3. What happen when ur DB and proxy server(Apache) are down n ur weblogic server is up? 4. How can u configure ur proxy server(Apache)? 5. How can the proxy server(Apache) communicate with ur WLS? 6. How the request process to ur WLS through the Proxy server(Apache)? 7. How can u know that ur heap memory is full? 8. When will u do garbage collection?
What are differences between DTDs and Schema?
Suppose there are two requests for 2 different pages of same site and from 2 different browsers, How Web server recognise the different request and send result to the exact sender browsers.
If you have an issue with your page, how do you debug it, what tools do you use?
What all information does a URL contain?
What is frame level testing and how do we test it?
Who has experience with epik or datafeedscripts.net? What better use for working with Shopzilla API?
How to test iBackup and storage products?
Some sites work with "http://allinterview.com" but for some sites we need to specify "www" - like "http://www.allinterview.com". Why?
If we force XML for web design, the browzer size will reduce. How?
If i have a form, and 1 part of the form needs to use validator framework and the other part need not use, how will i ensure that?
What is user application?