try { //code for passing the proxy System.setProperty("http.proxySet", "true"); System.setProperty("http.proxyUser", "user name"); System.setProperty("http.proxyPassword", "password of user"); System.setProperty("http.proxyHost", "hostid"); System.setProperty("http.proxyPort", "port"); System.out.println("Before connection"); String endPoint = "https://siteurl";
//code for setting the fake trust factory so that SSL site does not find problem with Security Cerificate System.setProperty( "java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol"); Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider()); AxisProperties.setProperty( "axis.socketSecureFactory", "org.apache.axis.components.net.SunFakeTrustSocketFactory");
//xml data for input to web-Service method String[] parmXML = new String[1]; parmXML[0] = "<View>Global Compliance Data</View>" + "<System>Global Compliance</System>" + "<Type>XML</Type>" + "<user>username provided</user>" + "<password>password provided</password>" + "<URL>https://siteurl</URL>" + "<Param>RDVUPG30</Param>" + "<Param></Param>" + "<Param></Param>" + "<Param></Param>";
//making the Soap header required by web service String[] InputXmlData = new String[1]; InputXmlData[0] = " <soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"> " + "<soap:Body>" + "<RecvMsg xmlns=\"http://tempuri.org/\">" + "<parmXML>" + parmXML[0] + "</parmXML>" + "</RecvMsg>" + "</soap:Body>" + "</soap:Envelope>"; System.out.println("Before connection 2"); javax.xml.parsers.DocumentBuilder builder = XMLParserUtils.getXMLDocBuilder(); Document doc = builder.parse( new ByteArrayInputStream(InputXmlData[0].getBytes()));
Before connection Before connection 2 Before connection 3_1[Document soap:Envelope] Before connection 3 caught exception in block Destinations:[SOAPException: faultCode=SOAP-ENV:Client; msg=Error opening socket: java.net.ConnectException: Connection timed out: connect; targetException=java.lang.IllegalArgumentException: Error opening socket: java.net.ConnectException: Connection timed out: connect] [SOAPException: faultCode=SOAP-ENV:Client; msg=Error opening socket: java.net.ConnectException: Connection timed out: connect; targetException=java.lang.IllegalArgumentException: Error opening socket: java.net.ConnectException: Connection timed out: connect] at org.apache.soap.transport.http.SOAPHTTPConnection.send(SOAPHTTPConnection.java:354) at org.apache.soap.messaging.Message.send(Message.java:123) at test.main(test.java:84)
Please guide me where i am missing.
Also if the security Certificate is absolutely required, then i have got the Security Certificate for the https webservice. Could anybody guide me how use it within my java client.