Thanks for the reply. I should have provided more detail. I am trying to set "allowCookies" for the HttpClient. Additionally, I am trying to consume a REST service which was not written in .Net. I am also using the WCF REST Starter Kit, as I am not that familiar with WCF.
Here is the code I'm trying to execute. This function works and is suppose to return a cookie to maintain state information. It should be passed on a subsequent "Get" call. However, the service is returning an error stating that there is no login information on a subsequent "Get" call. I used fiddler and cannot see the cookie being passed in the Request Header for the "Get".
Public Sub Login()
Static serviceOmnicastLoginUri As String = "http://localhost:3000/xml "
Dim client As New HttpClient
Dim _omnicastLoginType As New OmnicastLoginType.login
_omnicastLoginType.username = "userid"
_omnicastLoginType.password = "passowrd"
System.Net.ServicePointManager.Expect100Continue = False
Using response As HttpResponseMessage = client.Post(serviceOmnicastLoginUri, httpContentExtensions.CreateXmlSerializable(_omnicastLoginType))
'Throws an exception if not OK
response.EnsureStatusIs(HttpStatusCode.OK)
Dim omnicastAboutType = response.Content.ReadAsXmlSerializable(Of OmnicastAboutType.result)()
End Using
I also tried updating the app.config file to provide the parameters. However, I dont' know what the service contract is suppose to be for a REST Service. I was using "xml" as this part of the uri I'm calling.
<system.serviceModel>
<bindings>
<webHttpBinding>
<binding name="Omnicast" allowCookies="true">
</binding>
</webHttpBinding>
</bindings>
<client>
<endpoint address="http//localhost:3000"
binding="Omnicast"
contract="xml">
</endpoint>
</client>
</system.serviceModel>