You are viewing a plain text version of this content. The canonical link for it is here.
Posted to wss4j-dev@ws.apache.org by Nicolas Guaneme <ni...@avisortech.com> on 2006/01/27 17:53:13 UTC

Problem Sign Client

  Hello All,
I'm trying to do a client whit AXIS-Server, I need consuming a web 
services with digital sign, when I make the client I can't include the 
digital signature for consuming the web service.
I have been read your article and seem that I'm include something wrong.
This is my client:

import java.io.FileInputStream;
import java.io.InputStream;
import java.io.Reader;
import java.io.StringReader;
import java.io.StringWriter;
import javax.security.cert.X509Certificate;
import org.apache.axis.Constants;
import org.apache.axis.Message;
import org.apache.axis.MessageContext;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.encoding.SerializationContext;
import org.apache.axis.message.SOAPBodyElement;
import org.apache.axis.message.SOAPEnvelope;
import org.apache.axis.message.SOAPHeader;
import org.apache.axis.utils.Mapping;
import org.apache.axis.utils.XMLUtils;
import org.apache.axis.wsdl.symbolTable.Element;
import org.w3c.dom.Document;
import org.xml.sax.InputSource;

public class ClienteAxis {
    public static void main(String[] args) {
        try{
        String endpoint = "https://192.168.2.13/mainservices.asmx?WSDL";
           InputStream inStream = new FileInputStream("ACHexpDerX509.cer");
           X509Certificate cert = X509Certificate.getInstance(inStream);
           Service  service = new Service();
           Call     call    = (Call) service.createCall();
           call.setTargetEndpointAddress( new java.net.URL(endpoint) 
);            
           SOAPEnvelope env = new SOAPEnvelope();
           SOAPBodyElement sbe = new 
SOAPBodyElement(XMLUtils.StringToElement("https://192.168.2.13/mainservices.asmx?WSDL","getBankList",""));
           env.addBodyElement(sbe);               
           call.invoke(env);   
           MessageContext mc = call.getMessageContext();
           Message response = mc.getResponseMessage();
           env.addMapping(new 
Mapping("http://schemas.xmlsoap.org/soap/security/2000-12",
"SOAP-SEC"));
           env.addAttribute(Constants.URI_SOAP11_ENV, "actor", "some-uri");
           env.addAttribute(Constants.URI_SOAP11_ENV, "mustUnderstand", 
"1");
           StringWriter writer = new StringWriter();
           SerializationContext serializeContext = new 
SerializationContext(writer, null);
           env.output(serializeContext);
           writer.close();
           Reader reader = new StringReader(writer.getBuffer().toString());
           Document doc = XMLUtils.newDocument(new 
InputSource(reader));         
           String ret = (String) call.invoke( new Object[] { "100200" });
           System.out.println("Resultado : " + ret);
        }catch(Exception e){
            e.printStackTrace();
        }
    }

}

but seem that axis not proccess the soap petition. When I try to run 
this class show me this error:

AxisFault
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
 faultSubcode:
 faultString: javax.net.ssl.SSLHandshakeException: 
sun.security.validator.ValidatorException: PKIX path building failed: 
sun.security.provider.certpath.SunCertPathBuilderException: unable to 
find valid certification path to requested target
 faultActor:
 faultNode:
 faultDetail:
    
{http://xml.apache.org/axis/}stackTrace:javax.net.ssl.SSLHandshakeException: 
sun.security.validator.ValidatorException: PKIX path building failed: 
sun.security.provider.certpath.SunCertPathBuilderException: unable to 
find valid certification path to requested target
    at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Unknown Source)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(Unknown Source)
    at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Unknown Source)
    at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Unknown Source)
    at 
com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(Unknown 
Source)
    at 
com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(Unknown Source)
    at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Unknown Source)
    at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Unknown 
Source)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown Source)
    at 
com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(Unknown 
Source)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(Unknown 
Source)
    at 
org.apache.axis.components.net.JSSESocketFactory.create(JSSESocketFactory.java:186)
    at 
org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java:191)
    at 
org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:404)
    at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138)
    at 
org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
    at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
    at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
    at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
    at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
    at org.apache.axis.client.Call.invoke(Call.java:2767)
    at org.apache.axis.client.Call.invoke(Call.java:1910)
    at co.com.avisortech.ClienteAxis.main(ClienteAxis.java:50)
Caused by: sun.security.validator.ValidatorException: PKIX path building 
failed: sun.security.provider.certpath.SunCertPathBuilderException: 
unable to find valid certification path to requested target
    at sun.security.validator.PKIXValidator.doBuild(Unknown Source)
    at sun.security.validator.PKIXValidator.engineValidate(Unknown Source)
    at sun.security.validator.Validator.validate(Unknown Source)
    at 
com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown 
Source)
    at 
com.sun.net.ssl.internal.ssl.JsseX509TrustManager.checkServerTrusted(Unknown 
Source)
    ... 19 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: 
unable to find valid certification path to requested target
    at 
sun.security.provider.certpath.SunCertPathBuilder.engineBuild(Unknown 
Source)
    at java.security.cert.CertPathBuilder.build(Unknown Source)
    ... 24 more
    {http://xml.apache.org/axis/}hostname:avisortech02
javax.net.ssl.SSLHandshakeException: 
sun.security.validator.ValidatorException: PKIX path building failed: 
sun.security.provider.certpath.SunCertPathBuilderException: unable to 
find valid certification path to requested target
    at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
    at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:154)
    at 
org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
    at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
    at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
    at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
    at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
    at org.apache.axis.client.Call.invoke(Call.java:2767)
    at org.apache.axis.client.Call.invoke(Call.java:1910)
    at co.com.avisortech.ClienteAxis.main(ClienteAxis.java:50)
Caused by: javax.net.ssl.SSLHandshakeException: 
sun.security.validator.ValidatorException: PKIX path building failed: 
sun.security.provider.certpath.SunCertPathBuilderException: unable to 
find valid certification path to requested target
    at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Unknown Source)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(Unknown Source)
    at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Unknown Source)
    at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Unknown Source)
    at 
com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(Unknown 
Source)
    at 
com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(Unknown Source)
    at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Unknown Source)
    at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Unknown 
Source)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown Source)
    at 
com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(Unknown 
Source)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(Unknown 
Source)
    at 
org.apache.axis.components.net.JSSESocketFactory.create(JSSESocketFactory.java:186)
    at 
org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java:191)
    at 
org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:404)
    at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138)
    ... 8 more
Caused by: sun.security.validator.ValidatorException: PKIX path building 
failed: sun.security.provider.certpath.SunCertPathBuilderException: 
unable to find valid certification path to requested target
    at sun.security.validator.PKIXValidator.doBuild(Unknown Source)
    at sun.security.validator.PKIXValidator.engineValidate(Unknown Source)
    at sun.security.validator.Validator.validate(Unknown Source)
    at 
com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown 
Source)
    at 
com.sun.net.ssl.internal.ssl.JsseX509TrustManager.checkServerTrusted(Unknown 
Source)
    ... 19 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: 
unable to find valid certification path to requested target
    at 
sun.security.provider.certpath.SunCertPathBuilder.engineBuild(Unknown 
Source)
    at java.security.cert.CertPathBuilder.build(Unknown Source)
    ... 24 more

I need to do this client very quikly, please if you have a little free 
time, Could you do me a favor to said me how I must to do for resolved 
this problem.

Thanks very much
Regards.

Nicolás G. Rico

Re: Problem Sign Client

Posted by Christian Müller <ch...@gmail.com>.
Nicolás,

i think you have trouble with the https connection. The server requested
your client to give him the ssl-certificate-entry.
You have two options:
1) Add the certificate in the java keystore 'cacerts', located under
<JAVA_HOME>/lib/security (if you point JAVA_HOME to an JRE) or
<JAVA_HOME>/jre/lib/security (if you point JAVA_HOME to an SDK).

2. Tell your client, how he can find the keystore and truststore. Set the
folowing system properties:
- javax.net.ssl.keyStore
- javax.net.ssl.keyStorePassword
- javax.net.ssl.trustStore
- javax.net.ssl.trustStorePassword

See http://java.sun.com/products/jsse/INSTALL.html

Regards,
Christian

On 1/27/06, Nicolas Guaneme <ni...@avisortech.com> wrote:
>
>  Hello All,
> I'm trying to do a client whit AXIS-Server, I need consuming a web
> services with digital sign, when I make the client I can't include the
> digital signature for consuming the web service.
> I have been read your article and seem that I'm include something wrong.
> This is my client:
>
> import java.io.FileInputStream;
> import java.io.InputStream;
> import java.io.Reader;
> import java.io.StringReader;
> import java.io.StringWriter;
> import javax.security.cert.X509Certificate;
> import org.apache.axis.Constants;
> import org.apache.axis.Message;
> import org.apache.axis.MessageContext;
> import org.apache.axis.client.Call;
> import org.apache.axis.client.Service;
> import org.apache.axis.encoding.SerializationContext;
> import org.apache.axis.message.SOAPBodyElement;
> import org.apache.axis.message.SOAPEnvelope;
> import org.apache.axis.message.SOAPHeader;
> import org.apache.axis.utils.Mapping;
> import org.apache.axis.utils.XMLUtils;
> import org.apache.axis.wsdl.symbolTable.Element;
> import org.w3c.dom.Document;
> import org.xml.sax.InputSource;
>
> public class ClienteAxis {
>     public static void main(String[] args) {
>         try{
>         String endpoint = "https://192.168.2.13/mainservices.asmx?WSDL"<https://192.168.2.13/mainservices.asmx?WSDL>
> ;
>            InputStream inStream = new FileInputStream("ACHexpDerX509.cer
> ");
>            X509Certificate cert = X509Certificate.getInstance(inStream);
>            Service  service = new Service();
>            Call     call    = (Call) service.createCall();
>            call.setTargetEndpointAddress( new java.net.URL(endpoint) );
>
>            SOAPEnvelope env = new SOAPEnvelope();
>            SOAPBodyElement sbe = new SOAPBodyElement(
> XMLUtils.StringToElement("https://192.168.2.13/mainservices.asmx?WSDL"<https://192.168.2.13/mainservices.asmx?WSDL>
> ,"getBankList",""));
>            env.addBodyElement(sbe);
>            call.invoke(env);
>            MessageContext mc = call.getMessageContext();
>            Message response = mc.getResponseMessage();
>            env.addMapping(new Mapping(
> "http://schemas.xmlsoap.org/soap/security/2000-12"<http://schemas.xmlsoap.org/soap/security/2000-12>,
>
> "SOAP-SEC"));
>            env.addAttribute(Constants.URI_SOAP11_ENV, "actor",
> "some-uri");
>            env.addAttribute(Constants.URI_SOAP11_ENV, "mustUnderstand",
> "1");
>            StringWriter writer = new StringWriter();
>            SerializationContext serializeContext = new
> SerializationContext(writer, null);
>            env.output(serializeContext);
>            writer.close();
>            Reader reader = new StringReader(writer.getBuffer
> ().toString());
>            Document doc = XMLUtils.newDocument(new
> InputSource(reader));
>            String ret = (String) call.invoke( new Object[] { "100200" });
>            System.out.println("Resultado : " + ret);
>         }catch(Exception e){
>             e.printStackTrace();
>         }
>     }
>
> }
>
> but seem that axis not proccess the soap petition. When I try to run this
> class show me this error:
>
> AxisFault
>  faultCode: {http://schemas.xmlsoap.org/soap/envelope/
> }Server.userException
>  faultSubcode:
>  faultString: javax.net.ssl.SSLHandshakeException:
> sun.security.validator.ValidatorException: PKIX path building failed:
> sun.security.provider.certpath.SunCertPathBuilderException: unable to find
> valid certification path to requested target
>  faultActor:
>  faultNode:
>  faultDetail:
>     {http://xml.apache.org/axis/}stackTrace:
> javax.net.ssl.SSLHandshakeException:
> sun.security.validator.ValidatorException: PKIX path building failed:
> sun.security.provider.certpath.SunCertPathBuilderException: unable to find
> valid certification path to requested target
>     at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Unknown Source)
>     at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(Unknown Source)
>     at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Unknown Source)
>     at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Unknown Source)
>     at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(Unknown
> Source)
>     at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(Unknown
> Source)
>     at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Unknown Source)
>     at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Unknown
> Source)
>     at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown
> Source)
>     at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(Unknown
> Source)
>     at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(Unknown
> Source)
>     at org.apache.axis.components.net.JSSESocketFactory.create(
> JSSESocketFactory.java:186)
>     at org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java
> :191)
>     at org.apache.axis.transport.http.HTTPSender.writeToSocket(
> HTTPSender.java:404)
>     at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java
> :138)
>     at org.apache.axis.strategies.InvocationStrategy.visit(
> InvocationStrategy.java:32)
>     at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
>     at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
>     at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
>     at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
>     at org.apache.axis.client.Call.invoke(Call.java:2767)
>     at org.apache.axis.client.Call.invoke(Call.java:1910)
>     at co.com.avisortech.ClienteAxis.main(ClienteAxis.java:50)
> Caused by: sun.security.validator.ValidatorException: PKIX path building
> failed: sun.security.provider.certpath.SunCertPathBuilderException: unable
> to find valid certification path to requested target
>     at sun.security.validator.PKIXValidator.doBuild(Unknown Source)
>     at sun.security.validator.PKIXValidator.engineValidate(Unknown Source)
>     at sun.security.validator.Validator.validate(Unknown Source)
>     at
> com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown
> Source)
>     at
> com.sun.net.ssl.internal.ssl.JsseX509TrustManager.checkServerTrusted(Unknown
> Source)
>     ... 19 more
> Caused by: sun.security.provider.certpath.SunCertPathBuilderException:
> unable to find valid certification path to requested target
>     at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(Unknown
> Source)
>     at java.security.cert.CertPathBuilder.build(Unknown Source)
>     ... 24 more
>     {http://xml.apache.org/axis/}hostname:avisortech02
> javax.net.ssl.SSLHandshakeException:
> sun.security.validator.ValidatorException: PKIX path building failed:
> sun.security.provider.certpath.SunCertPathBuilderException: unable to find
> valid certification path to requested target
>     at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
>     at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java
> :154)
>     at org.apache.axis.strategies.InvocationStrategy.visit(
> InvocationStrategy.java:32)
>     at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
>     at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
>     at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
>     at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
>     at org.apache.axis.client.Call.invoke(Call.java:2767)
>     at org.apache.axis.client.Call.invoke(Call.java:1910)
>     at co.com.avisortech.ClienteAxis.main(ClienteAxis.java:50)
> Caused by: javax.net.ssl.SSLHandshakeException:
> sun.security.validator.ValidatorException: PKIX path building failed:
> sun.security.provider.certpath.SunCertPathBuilderException: unable to find
> valid certification path to requested target
>     at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Unknown Source)
>     at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(Unknown Source)
>     at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Unknown Source)
>     at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Unknown Source)
>     at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(Unknown
> Source)
>     at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(Unknown
> Source)
>     at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Unknown Source)
>     at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Unknown
> Source)
>     at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown
> Source)
>     at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(Unknown
> Source)
>     at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(Unknown
> Source)
>     at org.apache.axis.components.net.JSSESocketFactory.create(
> JSSESocketFactory.java:186)
>     at org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java
> :191)
>     at org.apache.axis.transport.http.HTTPSender.writeToSocket(
> HTTPSender.java:404)
>     at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java
> :138)
>     ... 8 more
> Caused by: sun.security.validator.ValidatorException: PKIX path building
> failed: sun.security.provider.certpath.SunCertPathBuilderException: unable
> to find valid certification path to requested target
>     at sun.security.validator.PKIXValidator.doBuild(Unknown Source)
>     at sun.security.validator.PKIXValidator.engineValidate(Unknown Source)
>     at sun.security.validator.Validator.validate(Unknown Source)
>     at
> com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown
> Source)
>     at
> com.sun.net.ssl.internal.ssl.JsseX509TrustManager.checkServerTrusted(Unknown
> Source)
>     ... 19 more
> Caused by: sun.security.provider.certpath.SunCertPathBuilderException:
> unable to find valid certification path to requested target
>     at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(Unknown
> Source)
>     at java.security.cert.CertPathBuilder.build(Unknown Source)
>     ... 24 more
>
> I need to do this client very quikly, please if you have a little free
> time, Could you do me a favor to said me how I must to do for resolved this
> problem.
>
> Thanks very much
> Regards.
>
> Nicolás G. Rico
>

Re: Problem Sign Client

Posted by Christian Müller <ch...@gmail.com>.
Nicolás,

i think you have trouble with the https connection. The server requested
your client to give him the ssl-certificate-entry.
You have two options:
1) Add the certificate in the java keystore 'cacerts', located under
<JAVA_HOME>/lib/security (if you point JAVA_HOME to an JRE) or
<JAVA_HOME>/jre/lib/security (if you point JAVA_HOME to an SDK).

2. Tell your client, how he can find the keystore and truststore. Set the
folowing system properties:
- javax.net.ssl.keyStore
- javax.net.ssl.keyStorePassword
- javax.net.ssl.trustStore
- javax.net.ssl.trustStorePassword

See http://java.sun.com/products/jsse/INSTALL.html

Regards,
Christian

On 1/27/06, Nicolas Guaneme <ni...@avisortech.com> wrote:
>
>  Hello All,
> I'm trying to do a client whit AXIS-Server, I need consuming a web
> services with digital sign, when I make the client I can't include the
> digital signature for consuming the web service.
> I have been read your article and seem that I'm include something wrong.
> This is my client:
>
> import java.io.FileInputStream;
> import java.io.InputStream;
> import java.io.Reader;
> import java.io.StringReader;
> import java.io.StringWriter;
> import javax.security.cert.X509Certificate;
> import org.apache.axis.Constants;
> import org.apache.axis.Message;
> import org.apache.axis.MessageContext;
> import org.apache.axis.client.Call;
> import org.apache.axis.client.Service;
> import org.apache.axis.encoding.SerializationContext;
> import org.apache.axis.message.SOAPBodyElement;
> import org.apache.axis.message.SOAPEnvelope;
> import org.apache.axis.message.SOAPHeader;
> import org.apache.axis.utils.Mapping;
> import org.apache.axis.utils.XMLUtils;
> import org.apache.axis.wsdl.symbolTable.Element;
> import org.w3c.dom.Document;
> import org.xml.sax.InputSource;
>
> public class ClienteAxis {
>     public static void main(String[] args) {
>         try{
>         String endpoint = "https://192.168.2.13/mainservices.asmx?WSDL"<https://192.168.2.13/mainservices.asmx?WSDL>
> ;
>            InputStream inStream = new FileInputStream("ACHexpDerX509.cer
> ");
>            X509Certificate cert = X509Certificate.getInstance(inStream);
>            Service  service = new Service();
>            Call     call    = (Call) service.createCall();
>            call.setTargetEndpointAddress( new java.net.URL(endpoint) );
>
>            SOAPEnvelope env = new SOAPEnvelope();
>            SOAPBodyElement sbe = new SOAPBodyElement(
> XMLUtils.StringToElement("https://192.168.2.13/mainservices.asmx?WSDL"<https://192.168.2.13/mainservices.asmx?WSDL>
> ,"getBankList",""));
>            env.addBodyElement(sbe);
>            call.invoke(env);
>            MessageContext mc = call.getMessageContext();
>            Message response = mc.getResponseMessage();
>            env.addMapping(new Mapping(
> "http://schemas.xmlsoap.org/soap/security/2000-12"<http://schemas.xmlsoap.org/soap/security/2000-12>,
>
> "SOAP-SEC"));
>            env.addAttribute(Constants.URI_SOAP11_ENV, "actor",
> "some-uri");
>            env.addAttribute(Constants.URI_SOAP11_ENV, "mustUnderstand",
> "1");
>            StringWriter writer = new StringWriter();
>            SerializationContext serializeContext = new
> SerializationContext(writer, null);
>            env.output(serializeContext);
>            writer.close();
>            Reader reader = new StringReader(writer.getBuffer
> ().toString());
>            Document doc = XMLUtils.newDocument(new
> InputSource(reader));
>            String ret = (String) call.invoke( new Object[] { "100200" });
>            System.out.println("Resultado : " + ret);
>         }catch(Exception e){
>             e.printStackTrace();
>         }
>     }
>
> }
>
> but seem that axis not proccess the soap petition. When I try to run this
> class show me this error:
>
> AxisFault
>  faultCode: {http://schemas.xmlsoap.org/soap/envelope/
> }Server.userException
>  faultSubcode:
>  faultString: javax.net.ssl.SSLHandshakeException:
> sun.security.validator.ValidatorException: PKIX path building failed:
> sun.security.provider.certpath.SunCertPathBuilderException: unable to find
> valid certification path to requested target
>  faultActor:
>  faultNode:
>  faultDetail:
>     {http://xml.apache.org/axis/}stackTrace:
> javax.net.ssl.SSLHandshakeException:
> sun.security.validator.ValidatorException: PKIX path building failed:
> sun.security.provider.certpath.SunCertPathBuilderException: unable to find
> valid certification path to requested target
>     at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Unknown Source)
>     at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(Unknown Source)
>     at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Unknown Source)
>     at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Unknown Source)
>     at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(Unknown
> Source)
>     at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(Unknown
> Source)
>     at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Unknown Source)
>     at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Unknown
> Source)
>     at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown
> Source)
>     at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(Unknown
> Source)
>     at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(Unknown
> Source)
>     at org.apache.axis.components.net.JSSESocketFactory.create(
> JSSESocketFactory.java:186)
>     at org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java
> :191)
>     at org.apache.axis.transport.http.HTTPSender.writeToSocket(
> HTTPSender.java:404)
>     at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java
> :138)
>     at org.apache.axis.strategies.InvocationStrategy.visit(
> InvocationStrategy.java:32)
>     at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
>     at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
>     at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
>     at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
>     at org.apache.axis.client.Call.invoke(Call.java:2767)
>     at org.apache.axis.client.Call.invoke(Call.java:1910)
>     at co.com.avisortech.ClienteAxis.main(ClienteAxis.java:50)
> Caused by: sun.security.validator.ValidatorException: PKIX path building
> failed: sun.security.provider.certpath.SunCertPathBuilderException: unable
> to find valid certification path to requested target
>     at sun.security.validator.PKIXValidator.doBuild(Unknown Source)
>     at sun.security.validator.PKIXValidator.engineValidate(Unknown Source)
>     at sun.security.validator.Validator.validate(Unknown Source)
>     at
> com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown
> Source)
>     at
> com.sun.net.ssl.internal.ssl.JsseX509TrustManager.checkServerTrusted(Unknown
> Source)
>     ... 19 more
> Caused by: sun.security.provider.certpath.SunCertPathBuilderException:
> unable to find valid certification path to requested target
>     at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(Unknown
> Source)
>     at java.security.cert.CertPathBuilder.build(Unknown Source)
>     ... 24 more
>     {http://xml.apache.org/axis/}hostname:avisortech02
> javax.net.ssl.SSLHandshakeException:
> sun.security.validator.ValidatorException: PKIX path building failed:
> sun.security.provider.certpath.SunCertPathBuilderException: unable to find
> valid certification path to requested target
>     at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
>     at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java
> :154)
>     at org.apache.axis.strategies.InvocationStrategy.visit(
> InvocationStrategy.java:32)
>     at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
>     at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
>     at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
>     at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
>     at org.apache.axis.client.Call.invoke(Call.java:2767)
>     at org.apache.axis.client.Call.invoke(Call.java:1910)
>     at co.com.avisortech.ClienteAxis.main(ClienteAxis.java:50)
> Caused by: javax.net.ssl.SSLHandshakeException:
> sun.security.validator.ValidatorException: PKIX path building failed:
> sun.security.provider.certpath.SunCertPathBuilderException: unable to find
> valid certification path to requested target
>     at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Unknown Source)
>     at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(Unknown Source)
>     at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Unknown Source)
>     at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Unknown Source)
>     at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(Unknown
> Source)
>     at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(Unknown
> Source)
>     at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Unknown Source)
>     at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Unknown
> Source)
>     at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown
> Source)
>     at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(Unknown
> Source)
>     at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(Unknown
> Source)
>     at org.apache.axis.components.net.JSSESocketFactory.create(
> JSSESocketFactory.java:186)
>     at org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java
> :191)
>     at org.apache.axis.transport.http.HTTPSender.writeToSocket(
> HTTPSender.java:404)
>     at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java
> :138)
>     ... 8 more
> Caused by: sun.security.validator.ValidatorException: PKIX path building
> failed: sun.security.provider.certpath.SunCertPathBuilderException: unable
> to find valid certification path to requested target
>     at sun.security.validator.PKIXValidator.doBuild(Unknown Source)
>     at sun.security.validator.PKIXValidator.engineValidate(Unknown Source)
>     at sun.security.validator.Validator.validate(Unknown Source)
>     at
> com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown
> Source)
>     at
> com.sun.net.ssl.internal.ssl.JsseX509TrustManager.checkServerTrusted(Unknown
> Source)
>     ... 19 more
> Caused by: sun.security.provider.certpath.SunCertPathBuilderException:
> unable to find valid certification path to requested target
>     at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(Unknown
> Source)
>     at java.security.cert.CertPathBuilder.build(Unknown Source)
>     ... 24 more
>
> I need to do this client very quikly, please if you have a little free
> time, Could you do me a favor to said me how I must to do for resolved this
> problem.
>
> Thanks very much
> Regards.
>
> Nicolás G. Rico
>