Boa tarde pessoal.
Estou com um problema aqui pra consumir um webservice.
Se alguem puder me ajudar agradeço!
Abraços!
package com.kpmg.webservices.RIS;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.Socket;
import java.net.URL;
import java.net.UnknownHostException;
import javax.xml.namespace.QName;
import javax.xml.rpc.Call;
import javax.xml.rpc.Service;
import javax.xml.rpc.ServiceException;
import javax.xml.rpc.ServiceFactory;
public class Teste2 {
public static void main(String[] args) {
String host = "employeesstg.ema.kworld.kpmg.com";
String port = "443";
String user = "***";
String password = "***";
System.setProperty("https.proxyHost", host);
System.setProperty("https.proxyPort", port);
System.setProperty("https.proxyUserName", user);
System.setProperty("https.proxyPassword", password);
QName serviceName = new QName("https://employeesstg.ema.kworld.kpmg.com/ris_ws_stg/RISSearchForRequests_v1.asmx", "SearchForRequests");
URL wsdlLocation;
try {
wsdlLocation = new URL("https://employeesstg.ema.kworld.kpmg.com/ris_ws_stg/RISSearchForRequests_v1.asmx?wsdl");
ServiceFactory serviceFactory = ServiceFactory.newInstance();
Service service = serviceFactory.createService(wsdlLocation, serviceName);
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ServiceException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
Isso tudo tá me disparando o seguinte exception:
javax.xml.rpc.ServiceException: Error processing WSDL document:
java.net.SocketException: Unexpected end of file from server
at org.apache.axis.client.Service.initService(Service.java:250)
at org.apache.axis.client.Service.<init>(Service.java:165)
at org.apache.axis.client.ServiceFactory.createService(ServiceFactory.java:198)
at com.kpmg.webservices.RIS.Teste2.main(Teste2.java:36)
Abraços!