AnsweredAssumed Answered

Help With Invoking Query Webservice using Java

Question asked by diwakar.pathak on Oct 8, 2010
Latest reply on Aug 16, 2012 by divyang_agrawal

I am trying to invoke a web service using Java for Clarity on a SaaS environment. I have used axis with -W option to generate
client stub classes. I am getting SAX exception. Below are the high level steps followed for invoking the Query webservice along with error.

// Create a service locator instance.
QueryQueryService_ServiceLocator service = new QueryQueryService_ServiceLocator();

QueryQueryPort port = service.getQueryQueryService();
Login in = new Login(strUserName,pwd);

// Login and save the session id
SessionId = port.login(in);

// Create an Authorization class instance
Auth header = new Auth(strUserName,pwd,SessionId);

// Create filter class instance
QueryFilter BBQF = new QueryFilter();

// Create Query class instance using query code
QueryQuery BBQ = new QueryQuery("BB_Login_Query",null);

//Set Filter.

// Create instance to store the result.
QueryQueryResult QueryResult = new QueryQueryResult();

//Set the end point address as the xog address
service.setQueryQueryServiceEndpointAddress("https://<serverip>/niku/xog"); // <--- Please note ours is a "https" ip address.

// Execute query using webservice
QueryResult = port.query(BBQ, header); //<--------- Getting an error here

// Instantiate Logout class
Logout out = new Logout(SessionId);

// Logout

Following is the stack trace of the error:

org.xml.sax.SAXException: Invalid element in com.niku.www.wsdl.query.QueryQueryResult - Status
at org.apache.axis.encoding.ser.BeanDeserializer.onStartChild(
at org.apache.axis.encoding.DeserializationContext.startElement(
at org.apache.axis.message.SAX2EventRecorder.replay(
at org.apache.axis.message.MessageElement.publishToHandler(
at org.apache.axis.message.RPCElement.deserialize(
at org.apache.axis.message.RPCElement.getParams(
at org.apache.axis.client.Call.invoke(
at org.apache.axis.client.Call.invoke(
at org.apache.axis.client.Call.invoke(
at com.niku.www.wsdl.query.QueryQuerySoapBindingStub.query(
at com.niku.www.wsdl.query.AccessWebServiceLogin.main(

Any ideas to resolve the same?

Your help is highly appreciated.

Nitin Gupta