jQuery in Action, 3rd edition
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 Introducing JavaFX 8 Programming this week in the JavaFX forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Java client connect to soap server" Watch "Java client connect to soap server" New topic

Java client connect to soap server

yingying qin

Joined: Feb 07, 2007
Posts: 1

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 =

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

call.setTargetEndpointAddress( new java.net.URL(endpoint) );
call.setOperationName(new QName("", "echoString") );

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

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

Joined: Mar 22, 2005
Posts: 42958
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 ]
I agree. Here's the link: http://aspose.com/file-tools
subject: Java client connect to soap server
It's not a secret anymore!