The service provider application is written in .Net and exposed their functionality through web services with https endpoint URL.
My application is written in java (jdk1.5) and using apache axis-1.4 to consume the service.
By using below mentioned stand alone program I am able to connect with third party .Net web services and getting response.
But when I implemented the same code in application and deployed the war on glassfish 2.1.1 server but I am getting an exception as
"PKIX path building failed” and “unable to find valid certification path to requested target".
Please let us know do I need any additional configuration changes to be done on Glassfish to consume the .Net webservices.
Stand alone Program:
==================
String endpoint = "https://thirdparty:8443/Orderservice.svc";
System.setProperty("javax.net.ssl.keyStoreType", "pkcs12");
System.setProperty("javax.net.ssl.keyStore","security_com.p12");
System.setProperty("javax.net.ssl.keyStorePassword", "sec2014!!");
System.setProperty("javax.net.debug", "ssl");
/*System.setProperty("javax.net.ssl.trustStore","sec.keystore");
System.setProperty("javax.net.ssl.trustStoreType", "jks");
System.setProperty("javax.net.ssl.trustStorePassword", "importkey");*/
try {
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress(new java.net.URL(endpoint));
QName qname = new QName(endpoint + "/", "OrderAction");
call.setOperationName(qname);
call.addParameter("Order", org.apache.axis.Constants.XSD_STRING,
javax.xml.rpc.ParameterMode.IN);
call.setReturnType(org.apache.axis.Constants.XSD_INT);
call.setSOAPActionURI("urn:LabelOrderIntf-ILabelOrder#OrderAction");
Object[] arg1 = new Object[] { "abc" };
Object result1 = call.invoke(arg1);
System.out.println("result1 --> " + result1);
} catch (MalformedURLException urlException) {
urlException.printStackTrace();
} catch (ServiceException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (AxisFault e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (RemoteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}