Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Missing credentials in soap message
Message
De
07/10/2008 16:42:46
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Web Services
Titre:
Missing credentials in soap message
Versions des environnements
Environment:
VB 9.0
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Divers
Thread ID:
01353449
Message ID:
01353449
Vues:
84
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.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform