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 unable to invoke a method on my SOAP service Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "unable to invoke a method on my SOAP service" Watch "unable to invoke a method on my SOAP service" New topic
Author

unable to invoke a method on my SOAP service

radhika holani
Greenhorn

Joined: Mar 28, 2006
Posts: 29
Hi,
I am new to web services.
I have tomcat5.0 server running on my m/c.
I tried deploying my first helloservice and was successful.
But when i tried to call that service it gives me the following error.

Hello SOAP Client
Fault Occurred (details follow):
Fault Code: SOAP-ENV:Server.BadTargetObjectURI
Fault String: Unable to resolve target object: com.pspl.soap.SoapService
Fault Occurred. No greeting for you!

following is my classpath detail.
CLASSPATH=c:\jars\xerces.jar;c:\jars\activation.jar;c:\jars\mail.jar;c:\jars\soa
p.jar;c:\jars\xercesImpl.jar;e:\junit3.8.1\junit.jar;C:\soap

I have service class file at location c:\soap.
I think i have set all the classpath correctly. Even though its unable to find SoapService.
Please help me..
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42648
    
  65
What is the endpoint URL you are using? Is that endpoint listed as being available in the AXIS web app? Are the classes that implement it properly installed on the server?


Ping & DNS - my free Android networking tools app
radhika holani
Greenhorn

Joined: Mar 28, 2006
Posts: 29
following is the code i am using for calling the deployed service.

// Create SOAP RPC Call Object
Call call = new Call ( );
// Set Encoding Style to standard SOAP encoding
call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
// Set Object URI and Method Name
call.setTargetObjectURI ("urn:examples:helloservice");
call.setMethodName ("sayGreeting");
// Set Method Parameters
Parameter param = new Parameter("name", String.class,
firstName, Constants.NS_URI_SOAP_ENC);
Vector paramList = new Vector ( );
paramList.addElement (param);
call.setParams (paramList);
// Set the URL for the Web Service
URL url = new URL ("http://localhost:8070/soap/servlet/rpcrouter");
// Invoke the Service
Response resp = call.invoke (url, "");
// Check for Faults
if (!resp.generatedFault( )) {
// Extract Return value
Parameter result = resp.getReturnValue ( );
String greeting = (String) result.getValue( );
return greeting;
}
else {
// Extract Fault Code and String
Fault f = resp.getFault( );
String faultCode = f.getFaultCode( );
String faultString = f.getFaultString( );
System.err.println("Fault Occurred (details follow):");
System.err.println("Fault Code: "+faultCode);
System.err.println("Fault String: "+faultString);
return new String ("Fault Occurred. No greeting for you!");
}

there is a service deployed with urn "urn:examples:helloservice"
radhika holani
Greenhorn

Joined: Mar 28, 2006
Posts: 29
i am non using AXIS. its a normal java client
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42648
    
  65
That answers the first of my questions. What about the other two?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: unable to invoke a method on my SOAP service