wood burning stoves 2.0*
The moose likes Web Services and the fly likes Error in client for webservice on websphere 4.0 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Error in client for webservice on websphere 4.0" Watch "Error in client for webservice on websphere 4.0" New topic

Error in client for webservice on websphere 4.0

Nitin Mehhta
Ranch Hand

Joined: May 18, 2004
Posts: 48
I'm very new to webservice. Had developed a simple webservice which runs on websphere 5.0 and could be accessed by a client program using axis API. Now I had to deploy the same service to a websphere 4.0 environment. Because of this shift there was a change in the encoding ( because of the lack of compliance with WS-I )so the test client had to be modified. Now I am getting the following error when i run my test client --
"Unable to determine object id from call: is the method element namespaced?"
Can anyone please help me out here.


My current client is -->

import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.encoding.XMLType;
import javax.xml.rpc.ParameterMode;

public class TestClient4 {

public static void main(String [] args) {
try {
String endpoint = "http://localhost:8080/Generator/servlet/rpcrouter";
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress( new java.net.URL(endpoint) );
call.setProperty( "javax.xml.rpc.encodingstyle.namespace.uri", "http://soapinterop.org/" );
call.setProperty( Call.SOAPACTION_URI_PROPERTY, "http://soapinterop.org/" );
call.setOperationName( "generate" );

call.addParameter("definition", XMLType.XSD_STRING, ParameterMode.IN);
call.addParameter("lexicon", XMLType.XSD_STRING, ParameterMode.IN);
call.setReturnType( XMLType.XSD_STRING );

String ret = (String) call.invoke( new Object[] { "<parameter list>" } );
System.out.println("Sent 'Hello!', got '" + ret + "'");
} catch (Exception e) {
Nitin Mehhta
Ranch Hand

Joined: May 18, 2004
Posts: 48
I got the answer for this. just posting if any one else faces the same problem...

It was something to do with name space only.

call.setOperationName(new QName("<namespace URL of the method in SOAP request>", "methodName"));

instead of call.setOperationName( "methodName");
Lasse Koskela

Joined: Jan 23, 2002
Posts: 11962
Thanks for sharing!

Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
It is sorta covered in the JavaRanch Style Guide.
subject: Error in client for webservice on websphere 4.0
Similar Threads
HELP: JSP calling Web Services
My first webservice call
Exception BasicCall.java:505 with invoke method
Accessing a secure webservice...plz help
Running a DII client through JSP