Meaningless Drivel is fun!
The moose likes Web Services and the fly likes Can you please  help me out .... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Can you please  help me out ...." Watch "Can you please  help me out ...." New topic

Can you please help me out ....

Anjana Chowdary

Joined: Oct 25, 2005
Posts: 8

I am facing this error from couple of days.

//This is the Exception i am getting while running client class.

Generated fault:
Fault Code = SOAP-ENV:Server.BadTargetObjectURI
Fault String = Unable to resolve target object:

Simply I am listing out the things i have done to run this WS.

// Service prg
package hello;
public class HelloWorld{

String getMessage(){
return "Hello world";
//client prg

import org.apache.soap.SOAPException;
import org.apache.soap.Constants;
import org.apache.soap.Fault;
import org.apache.soap.rpc.Call;
import org.apache.soap.rpc.Parameter;
import org.apache.soap.rpc.Response;

public class Client
public static void main(String[] args) throws Exception

URL url = null;
String name = null;
// Build the call.

url = new URL("http://localhost:8085/soap/servlet/rpcrouter");
Call call = new Call();

// Invoke the call.
Response resp = null;
resp = call.invoke(url, "");
catch( SOAPException e )
System.err.println("Caught SOAPException (" + e.getFaultCode() + "): " + e.getMessage());

// Check the response.
if( !resp.generatedFault() )
Object value = resp.getReturnValue();

Fault fault = resp.getFault();
System.err.println("Generated fault: ");
System.out.println (" Fault Code = " + fault.getFaultCode());
System.out.println (" Fault String = " + fault.getFaultString() );
catch(Exception e)

-> I set up class path with all these info..
%TOMCAT_HOME%\common\lib\activation.jar; and

-> I created service prg as jar file with the name of helloworld.jar and placed in class path.
-> I am using the Apache SOAP Admin to deploy the service.
If run the following commands, working fine..

1) http://localhost:8085/soap/servlet/rpcrouter.
2) java orgapache.soap.server.ServiceManagerClient http://localhost:8085/soap/servlet/rpcrouter list.

-> I am using the same machine as a client and server.

if any one know about the solution, could u please reply me..
waiting for reply...

Thanks in advance,

[ July 26, 2006: Message edited by: Anjana Chowdary ]
[ July 26, 2006: Message edited by: Anjana Chowdary ]
I agree. Here's the link:
subject: Can you please help me out ....
It's not a secret anymore!