Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Missing credentials in soap message
Message
From
08/10/2008 21:27:18
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
 
 
To
07/10/2008 16:42:46
General information
Forum:
ASP.NET
Category:
Web Services
Environment versions
Environment:
VB 9.0
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01353449
Message ID:
01353729
Views:
16
Gary,

>I am trying to link to a 3rd party WebService, I have setup the credentials, however if I use Fiddler2 to monitor the SOAP message the credentials are missing and the server rejects my connection, any ideas?
>
>My code looks like this:
>
>Public Class WebLink
>  Public WebServiceLink As WebService.HTNGListenerSoap = New WebService.HTNGListenerSoap
>
>  Function BuildCredentials(ByVal UserName As String, ByVal Password As String)
>    Dim myCache As New CredentialCache
>    myCache.Add(New Uri(WebServiceLink.Url), "basic", New NetworkCredential(UserName, Password))
>    WebServiceLink.Credentials = myCache.GetCredential(New Uri(WebServiceLink.Url), "basic")
>    WebServiceLink.PreAuthenticate = True
>    Return True
>  End Function
>
>  Function ReceiveMessageAsync(ByRef XmlString)
>    Dim Result As String = "Success"
>    Try
>      WebServiceLink.ReceiveMessageAsync(XmlString)
>    Catch loExc As Exception
>      Me.exception = loExc
>      Result = loExc.Message
>    End Try
>    Return Result
>  End Function
>
>  Function Connect(ByVal UserName As String, ByVal Password As String)    
>    Return Me.BuildCredentials(UserName, Password)
>  End Function
>
>End Class
>
>I call the Connect function and then the ReceiveMessageAsync, however, when I look at the soap message:
>
>
>POST /interface/<HostASMX>HTTP/1.1
>User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 2.0.50727.1433)
>Content-Type: text/xml; charset=utf-8
>SOAPAction: "http://htng.org/1.1/Listener.Wsdl#ReceiveMessageAsync"
>Host: <HostName>
>Content-Length: 6887
>Expect: 100-continue
>Connection: Keep-Alive
>
><?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><Request xmlns="http://htng.org/1.1/Listener.Wsdl"><?xml version="1.0" encoding="UTF-8"?
>
>
>There appears no header and no username or password?
>
>
>Regards
>
>Gary.

This isn't really my area of expertise, but is it possible it is because the CredentialCache is falling out of scope after leaving the BuildCredentials() method?
Tim
Timothy Bryan
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform