File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes Java client connect to soap server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Java client connect to soap server" Watch "Java client connect to soap server" New topic
Author

Java client connect to soap server

yingying qin
Greenhorn

Joined: Feb 07, 2007
Posts: 1
Hi,

I am new to this field. I used axis to generate client stub from wsdl. Now I created a java application and try to connect to the remote soap server. But never sucessful, the error is "Connection refused". Soap server uses SSL. Where goes wrong? Here is my client code. Your help is highly apprecdated.

import org.apache.axis.client.Call;
import org.apache.axis.client.Service;

import javax.xml.namespace.QName;

public class testClient
{
public static void main(String [] args) {
try {
String endpoint =
"https://192.168.32.23:8080";

Service service = new Service();
Call call = (Call) service.createCall();

call.setTargetEndpointAddress( new java.net.URL(endpoint) );
call.setOperationName(new QName("https://192.168.32.23:8080", "echoString") );
call.setUsername("Admin");
call.setPassword("pwd");


String ret = (String) call.invoke( new Object[] { "Hello!" } );

System.out.println("Sent 'Hello!', got '" + ret + "'");
} catch (Exception e) {
System.err.println(e.toString());
}
}
}
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39547
    
  27
Welcome to JavaRanch.

Does the call work over HTTP? Has the server certificate been imported top the clients keystore?

This introduction to SAAJ covers HTTPS at the very end, and may be a useful read.
[ February 10, 2007: Message edited by: Ulf Dittmer ]

Ping & DNS - updated with new look and Ping home screen widget
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java client connect to soap server
 
Similar Threads
NoClassDefFoundError
Error in client for webservice on websphere 4.0
Soap client giving error
java.net.ConnectException: Connection timed out: connect
AXIS client example: need help.