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 Oliver Schoenwald <ol...@FernUni-Hagen.de> on 2005/11/17 08:27:44 UTC

call.invoke(...) and authenticating with client certificate

Hi,

I'm using Tomcat 5.5.4 and using the following code to connect to a 
soap-server (called from a
servlet):

---snip! ---
        String wsAddress = 
"https://mysoapserver.anywhere.org/soap/index.php";
        String wsMethod   = "get_data";
        Service service    = new Service();
        Call    call       = (Call)service.createCall();
        call.setTargetEndpointAddress( new URL(wsAddress) );
        call.setOperationName( wsMethod );
        return call.invoke( new Object[] { userID, "urn:get", 
"urn:get#get_data"} );
--- snip! ---

At the moment that server accepts client certificates optionally for 
test purposes,
but is ought to be set to make client certification-based authentication 
obligatory for security
reasons.

How do I set my environment to use a client certificate when connecting 
to a system
requiring? I have a 'pem'-certificate file but where I got that 
certificate I can get any other
necessary format.

Thank you in advance,

Oliver Schoenwald
University Hagen


Re: call.invoke(...) and authenticating with client certificate

Posted by Mariano Eloy Fernández <fe...@gva.es>.
I guess it is TLS protocol for Tomcat with Client-auth enabled.
Before calling the webservice, in that Java code, add System.properties
to make reference to your certificate.

Something like:

        System.setProperty("javax.net.ssl.keyStore", 
"/usr/home/mycert.pem");

There are further properties like this to set the keyStoreType etc.
Search the java.sun.com for these properties.

Regards,

Mariano.



Guy Rixon escribió:

>If the server implements WS-Security checks (based on metadata in the SOAP
>header) then you need to deploy in the client the handler from Apache WSS4J.
>If the server is using TLS then the solution is different and I don't know how
>to do it with Axis.
>
>On Thu, 17 Nov 2005, Oliver Schoenwald wrote:
>
>  
>
>>Hi,
>>
>>I'm using Tomcat 5.5.4 and using the following code to connect to a
>>soap-server (called from a
>>servlet):
>>
>>---snip! ---
>>        String wsAddress =
>>"https://mysoapserver.anywhere.org/soap/index.php";
>>        String wsMethod   = "get_data";
>>        Service service    = new Service();
>>        Call    call       = (Call)service.createCall();
>>        call.setTargetEndpointAddress( new URL(wsAddress) );
>>        call.setOperationName( wsMethod );
>>        return call.invoke( new Object[] { userID, "urn:get",
>>"urn:get#get_data"} );
>>--- snip! ---
>>
>>At the moment that server accepts client certificates optionally for
>>test purposes,
>>but is ought to be set to make client certification-based authentication
>>obligatory for security
>>reasons.
>>
>>How do I set my environment to use a client certificate when connecting
>>to a system
>>requiring? I have a 'pem'-certificate file but where I got that
>>certificate I can get any other
>>necessary format.
>>
>>Thank you in advance,
>>
>>Oliver Schoenwald
>>University Hagen
>>
>>    
>>
>
>Guy Rixon 				        gtr@ast.cam.ac.uk
>Institute of Astronomy   	                Tel: +44-1223-337542
>Madingley Road, Cambridge, UK, CB3 0HA		Fax: +44-1223-337523
>
>  
>


Re: call.invoke(...) and authenticating with client certificate

Posted by Guy Rixon <gt...@ast.cam.ac.uk>.
If the server implements WS-Security checks (based on metadata in the SOAP
header) then you need to deploy in the client the handler from Apache WSS4J.
If the server is using TLS then the solution is different and I don't know how
to do it with Axis.

On Thu, 17 Nov 2005, Oliver Schoenwald wrote:

> Hi,
>
> I'm using Tomcat 5.5.4 and using the following code to connect to a
> soap-server (called from a
> servlet):
>
> ---snip! ---
>         String wsAddress =
> "https://mysoapserver.anywhere.org/soap/index.php";
>         String wsMethod   = "get_data";
>         Service service    = new Service();
>         Call    call       = (Call)service.createCall();
>         call.setTargetEndpointAddress( new URL(wsAddress) );
>         call.setOperationName( wsMethod );
>         return call.invoke( new Object[] { userID, "urn:get",
> "urn:get#get_data"} );
> --- snip! ---
>
> At the moment that server accepts client certificates optionally for
> test purposes,
> but is ought to be set to make client certification-based authentication
> obligatory for security
> reasons.
>
> How do I set my environment to use a client certificate when connecting
> to a system
> requiring? I have a 'pem'-certificate file but where I got that
> certificate I can get any other
> necessary format.
>
> Thank you in advance,
>
> Oliver Schoenwald
> University Hagen
>

Guy Rixon 				        gtr@ast.cam.ac.uk
Institute of Astronomy   	                Tel: +44-1223-337542
Madingley Road, Cambridge, UK, CB3 0HA		Fax: +44-1223-337523