Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Missing credentials in soap message
Message
From
14/10/2008 16:03:29
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, United States
 
 
To
14/10/2008 15:56:49
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:
01354961
Views:
15
You are correct. If there is no return value, it should be declared as a Sub.

>Gary,
>
>I know zilch about VB, but don't you have to indicate that you're returning something? IOW, shouldn't your Connect Function have an As String at the end, since you're attempting to return a string? Or is VB.NET substantially different from old VB 6 in this respect?
>
>
>  Function Connect(ByVal UserName As String, ByVal Password As String) As String   
>    Return Me.BuildCredentials(UserName, Password)
>  End Function
>
>
>~~Bonnie
>
>
>
>
>
>
>>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.
Very fitting: http://xkcd.com/386/
Previous
Reply
Map
View

Click here to load this message in the networking platform