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

What's the difference between a *.WSDL file and a *.DISCO file?

3375


Can you get a virus from website?

743


If My Application is down what are the resonations?

1481


I want to crate my personal website. I am having my website on webs.com which provide some space but it templete based. I want to gain free web space and plz tell me how to custmize it....plz suggest me... Thanks...

2109


Who is ui/ux developer? What he does?

829


What is Firewall?

1984


What do you understand by client-server testing?

823


On a scale of 1 to 10 rate your proficiency in CSS, JavaScript, PhotoShop, Illustrator, Flash, ActionScript, HTML, DHTML.

2432


What is the result of “20” + 20;

878


What are the steps to follow to cache parts of web form?

869


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

1904


How do you know how many users are online on a website?

843


What are the test case formats in case of a static website and dynamic website?

792


how to connect application to database by using the command?

1535


How do you troubleshoot when a website displays '404:Page Not Found;'. what are the various steps that you take to diplay the page requested?

2610