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 mathieu fabre <ma...@gmail.com> on 2008/04/28 09:36:08 UTC

question about CommonHTTPTransportSender

Hi,

I work on a webapp and i use Axis2 to expose my services.

my webapp is managed by jetty (like tomcat but lightweight).
Jetty listen on port 8443 with HTTPS (SSL) and on port 8080 with HTTP (no
SSL)
I wrote a little client which create a RPCServiceClient to send a request.

Here a piece of code :

//Create an empty configuration context
config =
ConfigurationContextFactory.createConfigurationContextFromFileSystem(null,
null);
// Create a transport out description
TransportOutDescription transpOut = new
TransportOutDescription(Constants.TRANSPORT_HTTP);
transpOut.addParameter(new Parameter(HTTPConstants.PROTOCOL_VERSION,
"HTTP/1.1"));
//create the HTTP sender
CommonsHTTPTransportSender sender = new CommonsHTTPTransportSender();
//initialize the sender
sender.init(config, transpOut);
transpOut.setSender(sender);
config.getAxisConfiguration().addTransportOut(transpOut);
//create the RPCServiceClient
RPCServiceClient serviceClient = new RPCServiceClient(config, null);
Options options = serviceClient.getOptions();
EndpointReference targetEPR = new EndpointReference(url);
options.setTo(targetEPR);
....
run the request with invokeBlocking....
....

with HTTP, it work correctly, but i don't know what to do in order to use
HTTPS
The server does not expect to authenticate the client for the moment.
If i try to view the wsd of on of my services with mozilla, it's working (i
accept the certificate)
So i would like to do the same in the code

Do you know what i must do ...?

Thanks,

Mat

Re: question about CommonHTTPTransportSender

Posted by Upul Godage <up...@gmail.com>.
It should be the same way as in the https transport receiver, I think.

        <parameter name="keystore" locked="false">
            <KeyStore>
                <Location>identity.jks</Location>
                <Type>JKS</Type>
                <Password>password</Password>
                <KeyPassword>password</KeyPassword>
            </KeyStore>
        </parameter>
        <parameter name="truststore" locked="false">
            <TrustStore>
                <Location>trust.jks</Location>
                <Type>JKS</Type>
                <Password>password</Password>
            </TrustStore>
        </parameter>

On Thu, May 8, 2008 at 10:32 PM, Beth Ayres <Be...@sas.com> wrote:

>  Can the keystore, truststore, and password be set in the axis2.xml
> config?  If so, what is the syntax?
>
>
>
> *From:* Upul Godage [mailto:upulg.dev@gmail.com]
> *Sent:* Monday, April 28, 2008 5:39 AM
> *To:* axis-user@ws.apache.org
> *Subject:* Re: question about CommonHTTPTransportSender
>
>
>
> Like the "http" transport sender, there is an "https" transport sender
> defined in the axis2.xml. You may need to set the key stores.
>
> Upul
>
>  On Mon, Apr 28, 2008 at 1:06 PM, mathieu fabre <ma...@gmail.com>
> wrote:
>
> Hi,
>
> I work on a webapp and i use Axis2 to expose my services.
>
> my webapp is managed by jetty (like tomcat but lightweight).
> Jetty listen on port 8443 with HTTPS (SSL) and on port 8080 with HTTP (no
> SSL)
> I wrote a little client which create a RPCServiceClient to send a request.
>
> Here a piece of code :
>
> //Create an empty configuration context
> config =
> ConfigurationContextFactory.createConfigurationContextFromFileSystem(null,
> null);
> // Create a transport out description
> TransportOutDescription transpOut = new
> TransportOutDescription(Constants.TRANSPORT_HTTP);
> transpOut.addParameter(new Parameter(HTTPConstants.PROTOCOL_VERSION,
> "HTTP/1.1"));
> //create the HTTP sender
> CommonsHTTPTransportSender sender = new CommonsHTTPTransportSender();
> //initialize the sender
> sender.init(config, transpOut);
> transpOut.setSender(sender);
> config.getAxisConfiguration().addTransportOut(transpOut);
> //create the RPCServiceClient
> RPCServiceClient serviceClient = new RPCServiceClient(config, null);
> Options options = serviceClient.getOptions();
> EndpointReference targetEPR = new EndpointReference(url);
> options.setTo(targetEPR);
> ....
> run the request with invokeBlocking....
> ....
>
> with HTTP, it work correctly, but i don't know what to do in order to use
> HTTPS
> The server does not expect to authenticate the client for the moment.
> If i try to view the wsd of on of my services with mozilla, it's working (i
> accept the certificate)
> So i would like to do the same in the code
>
> Do you know what i must do ...?
>
> Thanks,
>
> Mat
>
>
>

RE: question about CommonHTTPTransportSender

Posted by Beth Ayres <Be...@sas.com>.
Can the keystore, truststore, and password be set in the axis2.xml config?  If so, what is the syntax?

From: Upul Godage [mailto:upulg.dev@gmail.com]
Sent: Monday, April 28, 2008 5:39 AM
To: axis-user@ws.apache.org
Subject: Re: question about CommonHTTPTransportSender

Like the "http" transport sender, there is an "https" transport sender defined in the axis2.xml. You may need to set the key stores.

Upul

On Mon, Apr 28, 2008 at 1:06 PM, mathieu fabre <ma...@gmail.com>> wrote:
Hi,

I work on a webapp and i use Axis2 to expose my services.

my webapp is managed by jetty (like tomcat but lightweight).
Jetty listen on port 8443 with HTTPS (SSL) and on port 8080 with HTTP (no SSL)
I wrote a little client which create a RPCServiceClient to send a request.

Here a piece of code :

//Create an empty configuration context
config = ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null);
// Create a transport out description
TransportOutDescription transpOut = new TransportOutDescription(Constants.TRANSPORT_HTTP);
transpOut.addParameter(new Parameter(HTTPConstants.PROTOCOL_VERSION, "HTTP/1.1"));
//create the HTTP sender
CommonsHTTPTransportSender sender = new CommonsHTTPTransportSender();
//initialize the sender
sender.init(config, transpOut);
transpOut.setSender(sender);
config.getAxisConfiguration().addTransportOut(transpOut);
//create the RPCServiceClient
RPCServiceClient serviceClient = new RPCServiceClient(config, null);
Options options = serviceClient.getOptions();
EndpointReference targetEPR = new EndpointReference(url);
options.setTo(targetEPR);
....
run the request with invokeBlocking....
....

with HTTP, it work correctly, but i don't know what to do in order to use HTTPS
The server does not expect to authenticate the client for the moment.
If i try to view the wsd of on of my services with mozilla, it's working (i accept the certificate)
So i would like to do the same in the code

Do you know what i must do ...?

Thanks,

Mat


Re: question about CommonHTTPTransportSender

Posted by Upul Godage <up...@gmail.com>.
Like the "http" transport sender, there is an "https" transport sender
defined in the axis2.xml. You may need to set the key stores.

Upul


On Mon, Apr 28, 2008 at 1:06 PM, mathieu fabre <ma...@gmail.com> wrote:

> Hi,
>
> I work on a webapp and i use Axis2 to expose my services.
>
> my webapp is managed by jetty (like tomcat but lightweight).
> Jetty listen on port 8443 with HTTPS (SSL) and on port 8080 with HTTP (no
> SSL)
> I wrote a little client which create a RPCServiceClient to send a request.
>
> Here a piece of code :
>
> //Create an empty configuration context
> config =
> ConfigurationContextFactory.createConfigurationContextFromFileSystem(null,
> null);
> // Create a transport out description
> TransportOutDescription transpOut = new
> TransportOutDescription(Constants.TRANSPORT_HTTP);
> transpOut.addParameter(new Parameter(HTTPConstants.PROTOCOL_VERSION,
> "HTTP/1.1"));
> //create the HTTP sender
> CommonsHTTPTransportSender sender = new CommonsHTTPTransportSender();
> //initialize the sender
> sender.init(config, transpOut);
> transpOut.setSender(sender);
> config.getAxisConfiguration().addTransportOut(transpOut);
> //create the RPCServiceClient
> RPCServiceClient serviceClient = new RPCServiceClient(config, null);
> Options options = serviceClient.getOptions();
> EndpointReference targetEPR = new EndpointReference(url);
> options.setTo(targetEPR);
> ....
> run the request with invokeBlocking....
> ....
>
> with HTTP, it work correctly, but i don't know what to do in order to use
> HTTPS
> The server does not expect to authenticate the client for the moment.
> If i try to view the wsd of on of my services with mozilla, it's working
> (i accept the certificate)
> So i would like to do the same in the code
>
> Do you know what i must do ...?
>
> Thanks,
>
> Mat
>