How do I add a HTTP header to forms-based VB WS client app messages?

reyazr

New member
Joined
Sep 1, 2006
Messages
2
Programming Experience
Beginner
I have a forms-based VB.NET Web Service client that I have written to consume a Web Service. The Web service needs the client to send some authentication info in its HTTP header. How do I do this ? I know in a Web-based vb app, I can use the Request object to do this, but I am clueless on how to do this with a forms-based app.
Thanks for any help
Reyaz
 
It depends really on how you have implemented the client-side of contacting the webservice. Have a look at using the
VB.NET:
Net.WebRequest
class, you can add custom headers onto this object a POST.

Ive used this in several desktop apps which contact webservers and authenticate themselves in the normal Cookie header manner.
 
>It depends really on how you have implemented the
>client-side of contacting the webservice

I am using VB in VS2005. I added a Web reference (the web service's wsdl file), into my project and am using RPC via the proxy class that was generated.

>Have a look at using the Net.WebRequest class

How do I use the Net.WebRequest class? Do I just instantiate an object of that class and add my header via Net.WebRequest.Headers.Add("myheader", "myHeaderValue") ?

I am new to coding Web Services/clients, so please excuse me if I am using the terminology incorrectly.
Thanks

Reyaz
 
Back
Top