Hello programmers,
1. could give me an example code how to set up username and password for the service, which have been created using wsdl file, which has been given from web service creators on other side of the world. Web service client has been created using NetBeans IDE.
When it tries to call invoke method it gives me:
HTTP transport error: java.net.ConnectException: Connection refused: connect
So I see there is no authentication I guess.
2. How do I set proxy settings? Is this necessary and why?
....
xyzService service = new xyzService();
QName portQName = new QName("http://xmlns.oracle.com/...", "x_y_zPort");
String req = "<INSERT_RECEIVES xmlns=\"http://xmlns.oracle.com/...\"><parameters>ENTER VALUE</parameters></INSERT_RECEIVES>";
try { // Call Web Service Operation
Dispatch<Source> sourceDispatch = null;
sourceDispatch = service.createDispatch(portQName, Source.class, Service.Mode.PAYLOAD);
Source result = sourceDispatch.invoke(new StreamSource(new StringReader(req)));
} catch (Exception ex) {
System.out.println("___ERROR___");
System.out.println(ex);
}
Thanks