473,398 Members | 2,188 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

VB.NET Client accessing Webservice at JavaServerHost

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.X509Securi tyToken
Dim objInBW As New WebServiceWSDLLink.InboundWS
' Open and read the certificate store for
' the local machine account.

Store = X509CertificateStore.CurrentUserStore
(X509CertificateStore.MyStore)
Store.OpenRead()
' 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

Next
If x = 0 Then
MsgBox("Service is not able to encrypt the
response")
End If
objInBW.ClientCertificates.Add(cert)

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.
objInBW.RequestSoapContext.Security.Tokens.Add
(xcertoken)

objInBW.RequestSoapContext.Security.Elements.Add
(signature1)
'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------------------------------

Nov 20 '05 #1
1 3247
Hi Paul,

Did you know that there is a small however active newsgroup
Microsoft.public.dotnet.framework.webservices

I advice you to ask this question as well there.

Cor

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.X509Securi tyToken
Dim objInBW As New WebServiceWSDLLink.InboundWS
' Open and read the certificate store for
' the local machine account.

Store = X509CertificateStore.CurrentUserStore
(X509CertificateStore.MyStore)
Store.OpenRead()
' 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

Next
If x = 0 Then
MsgBox("Service is not able to encrypt the
response")
End If
objInBW.ClientCertificates.Add(cert)

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.
objInBW.RequestSoapContext.Security.Tokens.Add
(xcertoken)

objInBW.RequestSoapContext.Security.Elements.Add
(signature1)
'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------------------------------

Nov 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Andy | last post by:
Make the story short, I have a VB.NET client interface calling .NET webservice, written in VB.NET as well. I am trying to make the client as thin as possible so I let the webservice part to...
2
by: Miguel | last post by:
Hi, I'm developing an application in C# with Windows Forms for my company that is similar to the MSN Messenger. This application uses a webservice for registering users, etc... and as 2...
7
by: Nalaka | last post by:
Hi, I created a sinple web service that returns a dataSet. Then I created a client program that uses this web service (that returns the Dataset). My question is, how did the client figure...
1
by: Mike9900 | last post by:
I want to use an interface in both the webservice and its client. For example, the web service implements an interface and then the client cast that webservice to the inteface. It seems impossible,...
0
by: vijayalakshmi.venkataraman | last post by:
Hello, I have a .NET client that accesses a Java webservice. Let me first say that the client stub I got generated from the wsdl was incomplete and had to make changes to it manually to make it...
8
by: semedao | last post by:
Hi , I need to develop some feature of web service that can notify client - "Push" operation - and fast somebody know if it's possible , and how? When I say "Push" I mean - pure push :) , not...
0
by: vasu20in | last post by:
Hai, Help me out in accessing a webservice from smartclient application am using vs2005. Am able to access the webservice from smartclient but when the call is made to webservice from smart...
0
by: KranthiRemala | last post by:
Hi frens, I'm having a web service which will be residing inside a server. I have a layer called Interface which acts like a facade between the client and the server. Now, in the interface i need...
8
by: Scott Elgram | last post by:
Hello, I have a webservice designed in VS 2005 using C#. I would like to know the URL and the IP addresses of the people who are accessing my service. Is this a possibility? if so how? ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.