You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Su...@thomsonreuters.com on 2009/11/16 15:51:38 UTC

Creating Web Service client using HTTPS from wsdl files

Hi 

I need to invoke a set of web services through HTTPS. The WSDL files and
the XSD files are provided. I was able to get the token from the client
with the Authentication web service. But when I invoke the other web
service I get a SocketException: Connection Reset. As I'm new to Java
and web service I'm not sure where has it gone wrong. 

If I invoke the web service without providing the token, its hitting the
server. But when I provide the token I get the above mentioned error.
Could anyone help me with the issue? Also may be if anyone has a sample
program for HTTPS it will be helpful. Please help

Thanks,

Suma
 
SUMA (Sumathi Musuwathi Subramanian)
Software Engineer


Thomson Reuters 

Phone: (314)468-2565


suma.subramanian@reuters.com
thomsonreuters.com


 


This email was sent to you by Thomson Reuters, the global news and information company.
Any views expressed in this message are those of the individual sender, except where the sender specifically states them to be the views of Thomson Reuters.


RE: Creating Web Service client using HTTPS from wsdl files

Posted by Vadim Letitchevski <vl...@teledyne.com>.
I don't get it. I am the client. The server is on the other side. I can test/connect to the server using OpenSSL which by the way takes all these parameters (certificate, key, truststore, protocol, cipher).


Thanks
Vadim.
(310)765-3812



________________________________
From: Thilina Mahesh Buddhika [mailto:thilinamb@gmail.com]
Sent: Wednesday, December 09, 2009 10:28 AM
To: axis-user@ws.apache.org
Subject: Re: Creating Web Service client using HTTPS from wsdl files

AFAIK these configuration needs to be happen at the transport level and it depends on the app server you are using for the deployment. The related documentation of that app server will give you a thorough insight into these configuration options.

thanks.
/thilina

Thilina Mahesh Buddhika
http://blog.thilinamb.com


On Wed, Dec 9, 2009 at 10:03 PM, Vadim Letitchevski <vl...@teledyne.com>> wrote:
Thank you Thhilina.
What about the rest of it - protocol and cipher?

Thanks
Vadim.


________________________________
From: Thilina Mahesh Buddhika [mailto:thilinamb@gmail.com<ma...@gmail.com>]
Sent: Wednesday, December 09, 2009 5:13 AM

To: axis-user@ws.apache.org<ma...@ws.apache.org>
Subject: Re: Creating Web Service client using HTTPS from wsdl files

hi,

Some of the properties you mentioned, like two-way authentication has to be enabled in the SSL settings in  the app-server where the Axis2 is deployed.

For example, in Tomcat following configuration segment available in server.xml holds some of these parameters.

<Connector port="8443" maxHttpHeaderSize="8192" SSLEnabled="true"
               maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
               enableLookups="false" disableUploadTimeout="true"
               acceptCount="100" scheme="https" secure="true"
               clientAuth="false" sslProtocol="TLS"
               keystoreFile="keystore.jks"
               keystorePass="wso2carbon" />

It depends on the app server you are using. Some times it is required to set some system variables to support these parameters. For example, if you have enabled clientAuth(two-way authentication), then you have to set "javax.net.ssl.keyStore" and "javax.net.ssl.keyStorePassword" system properties.

thanks.
/thilina

Thilina Mahesh Buddhika
http://blog.thilinamb.com


On Wed, Dec 9, 2009 at 6:50 AM, Vadim Letitchevski <vl...@teledyne.com>> wrote:
I am trying to configure my client auto-generated from WSDL to use SSL.
I have read already the recommendations to set these:
System.setProperty("javax.net.ssl.trustStore", "/path/to/.keystore");
System.setProperty("javax.net.ssl.trustStorePassword", "changeit");

Unfortunately this is not all I need to set. I care about using only TLS1, only NULL-SHA Cipher, two way authentication and keep-alive.
The problem is, I can't find any mentioning of the property names which are needed for me, neither a full list of supported ssl properties and their values which can be set with System.setProperty() as well.


Thanks
Vadim.
(310)765-3812






Re: Creating Web Service client using HTTPS from wsdl files

Posted by Thilina Mahesh Buddhika <th...@gmail.com>.
AFAIK these configuration needs to be happen at the transport level and it
depends on the app server you are using for the deployment. The related
documentation of that app server will give you a thorough insight into these
configuration options.

thanks.
/thilina

Thilina Mahesh Buddhika
http://blog.thilinamb.com


On Wed, Dec 9, 2009 at 10:03 PM, Vadim Letitchevski <
vletitchevski@teledyne.com> wrote:

>  Thank you Thhilina.
> What about the rest of it - protocol and cipher?
>
> Thanks
> Vadim.
>
>
>  ------------------------------
> *From:* Thilina Mahesh Buddhika [mailto:thilinamb@gmail.com]
> *Sent:* Wednesday, December 09, 2009 5:13 AM
>
> *To:* axis-user@ws.apache.org
> *Subject:* Re: Creating Web Service client using HTTPS from wsdl files
>
>  hi,
>
> Some of the properties you mentioned, like two-way authentication has to be
> enabled in the SSL settings in  the app-server where the Axis2 is deployed.
>
> For example, in Tomcat following configuration segment available in
> server.xml holds some of these parameters.
>
>  <Connector port="8443" maxHttpHeaderSize="8192" SSLEnabled="true"
>                maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
>                enableLookups="false" disableUploadTimeout="true"
>                acceptCount="100" scheme="https" secure="true"
>                clientAuth="false" sslProtocol="TLS"
>                keystoreFile="keystore.jks"
>                keystorePass="wso2carbon" />
>
> It depends on the app server you are using. Some times it is required to
> set some system variables to support these parameters. For example, if you
> have enabled clientAuth(two-way authentication), then you have to set
> "javax.net.ssl.keyStore" and "javax.net.ssl.keyStorePassword" system
> properties.
>
> thanks.
> /thilina
>
> Thilina Mahesh Buddhika
> http://blog.thilinamb.com
>
>
> On Wed, Dec 9, 2009 at 6:50 AM, Vadim Letitchevski <
> vletitchevski@teledyne.com> wrote:
>
>>  I am trying to configure my client auto-generated from WSDL to use SSL.
>> I have read already the recommendations to set these:
>>  System.setProperty("javax.net.ssl.trustStore", "/path/to/.keystore");
>> System.setProperty("javax.net.ssl.trustStorePassword", "changeit");
>>
>> Unfortunately this is not all I need to set. I care about using only TLS1,
>> only NULL-SHA Cipher, two way authentication and keep-alive.
>> The problem is, I can't find any mentioning of the property names which
>> are needed for me, neither a full list of supported ssl properties and their
>> values which can be set with System.setProperty() as well.
>>
>>
>> Thanks
>> Vadim.
>> (310)765-3812
>>
>>
>>
>

RE: Creating Web Service client using HTTPS from wsdl files

Posted by Vadim Letitchevski <vl...@teledyne.com>.
Thank you Thhilina.
What about the rest of it - protocol and cipher?

Thanks
Vadim.


________________________________
From: Thilina Mahesh Buddhika [mailto:thilinamb@gmail.com]
Sent: Wednesday, December 09, 2009 5:13 AM
To: axis-user@ws.apache.org
Subject: Re: Creating Web Service client using HTTPS from wsdl files

hi,

Some of the properties you mentioned, like two-way authentication has to be enabled in the SSL settings in  the app-server where the Axis2 is deployed.

For example, in Tomcat following configuration segment available in server.xml holds some of these parameters.

<Connector port="8443" maxHttpHeaderSize="8192" SSLEnabled="true"
               maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
               enableLookups="false" disableUploadTimeout="true"
               acceptCount="100" scheme="https" secure="true"
               clientAuth="false" sslProtocol="TLS"
               keystoreFile="keystore.jks"
               keystorePass="wso2carbon" />

It depends on the app server you are using. Some times it is required to set some system variables to support these parameters. For example, if you have enabled clientAuth(two-way authentication), then you have to set "javax.net.ssl.keyStore" and "javax.net.ssl.keyStorePassword" system properties.

thanks.
/thilina

Thilina Mahesh Buddhika
http://blog.thilinamb.com


On Wed, Dec 9, 2009 at 6:50 AM, Vadim Letitchevski <vl...@teledyne.com>> wrote:
I am trying to configure my client auto-generated from WSDL to use SSL.
I have read already the recommendations to set these:
System.setProperty("javax.net.ssl.trustStore", "/path/to/.keystore");
System.setProperty("javax.net.ssl.trustStorePassword", "changeit");

Unfortunately this is not all I need to set. I care about using only TLS1, only NULL-SHA Cipher, two way authentication and keep-alive.
The problem is, I can't find any mentioning of the property names which are needed for me, neither a full list of supported ssl properties and their values which can be set with System.setProperty() as well.


Thanks
Vadim.
(310)765-3812





Re: Creating Web Service client using HTTPS from wsdl files

Posted by Thilina Mahesh Buddhika <th...@gmail.com>.
hi,

Some of the properties you mentioned, like two-way authentication has to be
enabled in the SSL settings in  the app-server where the Axis2 is deployed.

For example, in Tomcat following configuration segment available in
server.xml holds some of these parameters.

<Connector port="8443" maxHttpHeaderSize="8192" SSLEnabled="true"
               maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
               enableLookups="false" disableUploadTimeout="true"
               acceptCount="100" scheme="https" secure="true"
               clientAuth="false" sslProtocol="TLS"
               keystoreFile="keystore.jks"
               keystorePass="wso2carbon" />

It depends on the app server you are using. Some times it is required to set
some system variables to support these parameters. For example, if you have
enabled clientAuth(two-way authentication), then you have to set
"javax.net.ssl.keyStore" and "javax.net.ssl.keyStorePassword" system
properties.

thanks.
/thilina

Thilina Mahesh Buddhika
http://blog.thilinamb.com


On Wed, Dec 9, 2009 at 6:50 AM, Vadim Letitchevski <
vletitchevski@teledyne.com> wrote:

>  I am trying to configure my client auto-generated from WSDL to use SSL.
> I have read already the recommendations to set these:
> System.setProperty("javax.net.ssl.trustStore", "/path/to/.keystore");
> System.setProperty("javax.net.ssl.trustStorePassword", "changeit");
>
> Unfortunately this is not all I need to set. I care about using only TLS1,
> only NULL-SHA Cipher, two way authentication and keep-alive.
> The problem is, I can't find any mentioning of the property names which are
> needed for me, neither a full list of supported ssl properties and their
> values which can be set with System.setProperty() as well.
>
>
> Thanks
> Vadim.
> (310)765-3812
>
>
>

Creating Web Service client using HTTPS from wsdl files

Posted by Vadim Letitchevski <vl...@teledyne.com>.
I am trying to configure my client auto-generated from WSDL to use SSL.
I have read already the recommendations to set these:
System.setProperty("javax.net.ssl.trustStore", "/path/to/.keystore");
System.setProperty("javax.net.ssl.trustStorePassword", "changeit");

Unfortunately this is not all I need to set. I care about using only TLS1, only NULL-SHA Cipher, two way authentication and keep-alive.
The problem is, I can't find any mentioning of the property names which are needed for me, neither a full list of supported ssl properties and their values which can be set with System.setProperty() as well.


Thanks
Vadim.
(310)765-3812




RE: Creating Web Service client using HTTPS from wsdl files

Posted by Jaime Hablutzel Egoavil <ha...@hotmail.com>.
I think that I've see that about connection reset because of the missing keystore javax.net.ssl.trustStore property

System.setProperty("javax.net.ssl.trustStore", "/path/to/.keystore");
System.setProperty("javax.net.ssl.trustStorePassword", "changeit");

                ConfigurationContext ctx = ConfigurationContextFactory.createConfigurationContextFromFileSystem(null);
                authStub = new EmrAuthWsStub(ctx, "https://172.17.0.24:8443/emrws" + "/services/emrAuthWs.emrAuthWsHttpSoap12Endpoint");

/* 
//SUpport for username token (wss)
               ServiceClient sc = authStub._getServiceClient();
                sc.engageModule("rampart");
                Options options = sc.getOptions();
                options.setUserName("user");
                options.setPassword("password");
*/


then you have an authStub that supports calls over https, check the port https://172.17.0.24:8443/..., you have to copy it from your wsdl, and change http for https and the port too.
You can generate the .keystore using, keytool.exe but I'm not pretty sure, I just copied the one generated for the server side, but I suppose it is not the best way.

Jaime Hablutzel | 9-8964-0369

 

(tildes omitidas intencionalmente)


 





> Date: Mon, 16 Nov 2009 16:24:45 -0500
> From: Suma.Subramanian@thomsonreuters.com
> Subject: RE: Creating Web Service client using HTTPS from wsdl files
> To: axis-user@ws.apache.org
> 
> Hi Prabath,
> 
>    Sorry, I don't think I have permission to expose the client code. But
> someone who had tried a similar scenario, please help.
> 
> Thanks,
> Suma
> 
> -----Original Message-----
> From: Prabath Siriwardena [mailto:prabath@wso2.com] 
> Sent: Monday, November 16, 2009 1:52 PM
> To: axis-user@ws.apache.org
> Subject: Re: Creating Web Service client using HTTPS from wsdl files
> 
> Can you please attach your client code ?
> 
> Thanks& regards.
> -Prabath
> 
> Suma.Subramanian@thomsonreuters.com wrote:
> >
> > Hi
> >
> > I need to invoke a set of web services through HTTPS. The WSDL files 
> > and the XSD files are provided. I was able to get the token from the 
> > client with the Authentication web service. But when I invoke the 
> > other web service I get a SocketException: Connection Reset. As I'm 
> > new to Java and web service I'm not sure where has it gone wrong.
> >
> > If I invoke the web service without providing the token, its hitting 
> > the server. But when I provide the token I get the above mentioned 
> > error. Could anyone help me with the issue? Also may be if anyone has 
> > a sample program for HTTPS it will be helpful. Please help
> >
> > Thanks,
> >
> > Suma
> >  
> > *SUMA (Sumathi Musuwathi Subramanian)* Software Engineer
> >
> > *Thomson Reuters*
> >
> > Phone: (314)468-2565
> >
> > suma.subramanian@reuters.com
> > thomsonreuters.com
> >
> >  
> >
> > This email was sent to you by Thomson Reuters, the global news and 
> > information company.
> > Any views expressed in this message are those of the individual 
> > sender, except where the sender specifically states them to be the 
> > views of Thomson Reuters.
> 
> 
> 
> This email was sent to you by Thomson Reuters, the global news and information company.
> Any views expressed in this message are those of the individual sender, except where the sender specifically states them to be the views of Thomson Reuters.
> 
> 
 		 	   		  
_________________________________________________________________


RE: Creating Web Service client using HTTPS from wsdl files

Posted by Su...@thomsonreuters.com.
Hi Prabath,

   Sorry, I don't think I have permission to expose the client code. But
someone who had tried a similar scenario, please help.

Thanks,
Suma

-----Original Message-----
From: Prabath Siriwardena [mailto:prabath@wso2.com] 
Sent: Monday, November 16, 2009 1:52 PM
To: axis-user@ws.apache.org
Subject: Re: Creating Web Service client using HTTPS from wsdl files

Can you please attach your client code ?

Thanks& regards.
-Prabath

Suma.Subramanian@thomsonreuters.com wrote:
>
> Hi
>
> I need to invoke a set of web services through HTTPS. The WSDL files 
> and the XSD files are provided. I was able to get the token from the 
> client with the Authentication web service. But when I invoke the 
> other web service I get a SocketException: Connection Reset. As I'm 
> new to Java and web service I'm not sure where has it gone wrong.
>
> If I invoke the web service without providing the token, its hitting 
> the server. But when I provide the token I get the above mentioned 
> error. Could anyone help me with the issue? Also may be if anyone has 
> a sample program for HTTPS it will be helpful. Please help
>
> Thanks,
>
> Suma
>  
> *SUMA (Sumathi Musuwathi Subramanian)* Software Engineer
>
> *Thomson Reuters*
>
> Phone: (314)468-2565
>
> suma.subramanian@reuters.com
> thomsonreuters.com
>
>  
>
> This email was sent to you by Thomson Reuters, the global news and 
> information company.
> Any views expressed in this message are those of the individual 
> sender, except where the sender specifically states them to be the 
> views of Thomson Reuters.



This email was sent to you by Thomson Reuters, the global news and information company.
Any views expressed in this message are those of the individual sender, except where the sender specifically states them to be the views of Thomson Reuters.



Re: Creating Web Service client using HTTPS from wsdl files

Posted by Prabath Siriwardena <pr...@wso2.com>.
Can you please attach your client code ?

Thanks& regards.
-Prabath

Suma.Subramanian@thomsonreuters.com wrote:
>
> Hi
>
> I need to invoke a set of web services through HTTPS. The WSDL files 
> and the XSD files are provided. I was able to get the token from the 
> client with the Authentication web service. But when I invoke the 
> other web service I get a SocketException: Connection Reset. As I'm 
> new to Java and web service I'm not sure where has it gone wrong.
>
> If I invoke the web service without providing the token, its hitting 
> the server. But when I provide the token I get the above mentioned 
> error. Could anyone help me with the issue? Also may be if anyone has 
> a sample program for HTTPS it will be helpful. Please help
>
> Thanks,
>
> Suma
>  
> *SUMA (Sumathi Musuwathi Subramanian)*
> Software Engineer
>
> *Thomson Reuters*
>
> Phone: (314)468-2565
>
> suma.subramanian@reuters.com
> thomsonreuters.com
>
>  
>
> This email was sent to you by Thomson Reuters, the global news and 
> information company.
> Any views expressed in this message are those of the individual 
> sender, except where the sender specifically states them to be the 
> views of Thomson Reuters.