Solved

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

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

773 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