vb.net consuming java webservice, error: found text/plain expected text/xml


New member
Jul 27, 2004
Programming Experience
Hi folks

This is a challenging and interesting topic. Need HELP on
this, would be good if some tips/techniques can be given
for the topic.

Using VB.NET client to connect to JavaWebserver. Don't
know how to use the 2-way SSL to communicate and make the
SSL handshake process( at Transport level https://)
transparent. Any .NET classes to make all the 2-way SSL
communication transparent between VB.Client(Webservice
consumer) and JavaWebserver(Webservice provider)???

My VB.NET Client is able to access the web service with
HTTP protocol BUT NOT HTTPS protocol(SSL port 443)

Where to add in the clientcert(X509) into the http object
request object ? And how to get the HTTP Response back to parse in the XML details? Any .NET classes to do all these with ease?

Some advice or technical samples please?

Thanks in advance.!!!

This is the code snippet of what we are trying to do. Would be great to get advise or technical solutions to help me out.

-------------- Begin of Code
Dim Store As X509CertificateStore
Dim cert As X509Certificate
Dim lCertName As String
Dim certoken As Microsoft.Web.Services2.Security.Tokens.X509SecurityToken
Dim objInBW As New WebServiceWSDLLink.InboundWS

' Open and read the certificate store for
' the local machine account.

Store = X509CertificateStore.CurrentUserStore(X509CertificateStore.MyStore)

' Search for all certificates and add all
' matching certificates to the certificate collection.
Dim x As Integer = 0
For Each cert In Store.Certificates

If InStr(cert.GetName(), "UserA") Then
MsgBox("Issued To= {0}" & cert.GetName())
x = 1
Exit For
End If

If x = 0 Then
MsgBox("Service is not able to encrypt the response")
End If

objInBW.UnsafeAuthenticatedConnectionSharing = True

Dim xcertoken As New X509SecurityToken(cert)
''create a new Signature object using the X509SecurityToken
''as a parameter for the Signature constructor
Dim signature1 As New MessageSignature(xcertoken)
''Along with the Tokens collection there is a SoapContext.Security.Elements
''collection that will allow you to add various WS-Security elements including
''a Signature element.

'we pull the certificate from the certificate store
'and add it to the Tokens collection. We then and add the Signature object
'to the Elements collection.

'Finally we are calling the webservice object like the 'following :

objretmsg = objInBW.processSingleMessage(objMsg)

------------- end of code------------------------------
Top Bottom