• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error in client for webservice on websphere 4.0

 
Nitin Mehhta
Ranch Hand
Posts: 48
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 48
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11962
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for sharing!
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic