When I try to call a [Java] web service from .NET, I am getting what appears to be a security credentials issue.
CWWSS5509E: A security token whose type is [http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#UsernameToken] is required.
Is it even picking up the credentials that I am trying to pass? At this point, I just want to make contact with the web service and get access. In my example, ServiceReference1 is a generated Web proxy class.
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim myLocateProfileBySourceSystemId As New ServiceReference1.locateProfileBySourceSystemId
Dim myLocateProfileBySourceSystemIdRequestType As New ServiceReference1.LocateProfileBySourceSystemIdRequestType
myLocateProfileBySourceSystemIdRequestType.includeEmailAddress = True
myLocateProfileBySourceSystemId.locateProfileBySourceSystemId1 = myLocateProfileBySourceSystemIdRequestType
System.Net.ServicePointManager.ServerCertificateValidationCallback = New System.Net.Security.RemoteCertificateValidationCallback(AddressOf ValidateRemoteCertificate)
Dim myNetworkCredential As New System.Net.NetworkCredential
myNetworkCredential.UserName = "MyUsernameGoesHere"
myNetworkCredential.Password = "MyPasswordGoesHere"
Dim myWebProxy As New WebProxy()
myWebProxy.Credentials = myNetworkCredential
WebRequest.DefaultWebProxy.Credentials = myNetworkCredential
Dim myIndividualProfileSoapClient As New ServiceReference1.IndividualProfileSoapClient
Dim myLocateProfileBySourceSystemIdResponse As ServiceReference1.locateProfileBySourceSystemIdResponse = myIndividualProfileSoapClient.locateProfileBySourceSystemId(myLocateProfileBySourceSystemId)
End Sub
Private Shared Function ValidateRemoteCertificate(ByVal sender As Object,
ByVal certificate As X509Certificate,
ByVal chain As X509Chain,
ByVal policyErrors As SslPolicyErrors) As Boolean
' allow any old dodgy certificate...
Return True
End Function
What should my App.Config settings be?
<security mode="Transport">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>