This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
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 The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript 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
Author

Error in client for webservice on websphere 4.0

Nitin Mehhta
Ranch Hand

Joined: May 18, 2004
Posts: 48
Hi,
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.

Thanks


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) {
System.err.println(e.toString());
}
}
}
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.
use

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

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

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


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error in client for webservice on websphere 4.0