Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Some sites work with "http://allinterview.com" but for some sites we need to specify "www" - like "http://www.allinterview.com". Why?

1676


what is the Need for CSS ?

1984


What are the available environments on the web?

895


How does CGI work? Can I use 'C' language to write a CGI?

2131


Have you ever used more than one external style sheet and if so, how did you use it?

1972


How to create virtual directory in IIS?

1862


How to test whether the navigation i.e. from one page to another is working r not using QTP for web based application

1642


Difference between null and undefined?

869


If we force XML for web design, the browzer size will reduce. How?

1955


What is Code Base, Style Sheets?

3534


what is stub in weblogic? dont give me a defination , iwant full ans with example? also tell what is replica-aware stubs.. ok bye send ans as soon as possible

4455


Explain the functioning of dynamic pages in a website?

831


what are the general webtesting questions and how to respond them in generally in interview point of them

1989


Can you save a website to your desktop?

857


What is a Complex Element?

927