Solved

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

Posted on 2004-08-30
3
465 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
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…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

710 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