Solved

How to add something to the soap header in VB.NET

Posted on 2004-08-30
3
458 Views
Last Modified: 2009-12-16
I'm developing a web service client application in VB.Net. I have added a web reference and able to invoke the service & get the back the response. But now I need to add following line to the http header in the request:
Cookie: xyz=somevalue

By default header part contains:
SOAPAction: ""
User-Agent: SOAPscope
Content-Type: text/xml; charset=UTF-8

I need to append "Cookie: xyz=somevalue" to above.

I tried adding element to cookieContainer but seems its not working. Is there a way to just append a line of text to the http header in the request?
Please help.
Thanks in advance.
0
Comment
Question by:kbalaraju
3 Comments
 
LVL 10

Accepted Solution

by:
123654789987 earned 125 total points
ID: 11941094
U can do this by adding a SoapExtension to your webservice. By having a SoapExtension u can do some processing before calling the webservice

Then we can add SoapHeader Like this
[SoapExtensions]
[SoapHeaderAttribute("XYZ", Direction=SoapHeaderDirection.InOut)]


For this u need a property called XYZ in the Class derived from SoapHeader. There the value of XYZ is get-set
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now