Solved

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

Posted on 2004-08-30
3
455 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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 …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

757 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

17 Experts available now in Live!

Get 1:1 Help Now