[
https://issues.apache.org/jira/browse/AXIS2-5063?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13070375#comment-13070375
]
Paul Nibin K J commented on AXIS2-5063:
---------------------------------------
Hi,
I tried to create a service which receives and returns Complex object. My
service class is:
import java.util.Arrays;
public class QueryTest
{
public static class Query
{
public String [] getStr()
{
return str;
}
public void setStr( String [] str )
{
this.str = str;
}
public Object [][] getVal()
{
return val;
}
public void setVal( Object [][] val )
{
this.val = val;
}
private String [] str;
private Object [][] val;
}
public Query testEchoQuery( Query testQuery )
{
String [] str = testQuery.getStr();
System.out.println( Arrays.asList( str ) );
Object [][] val = testQuery.getVal();
for ( Object [] objects : val )
{
System.out.println( Arrays.asList( objects ) );
}
return testQuery;
}
}
I deployed the service as a POJO and generated the client stub using the
following code.
WSDL2Java.main( new String []
{ "-o", ".", "-uw", "-u", "-uri",
"http://localhost:8080/axis2/services/QueryTest?wsdl" } );
My client code to test is:
import java.util.Arrays;
import org.apache.ws.axis2.xsd.ArrayOfObject;
import org.apache.ws.axis2.xsd.QueryTest_Query;
public class Axis2QueryTest
{
public static void main( String [] args ) throws Throwable
{
QueryTestStub stub = new QueryTestStub();
QueryTest_Query testQuery5 = new QueryTest_Query();
testQuery5.addStr( "Col1" );
testQuery5.addStr( "Col2" );
testQuery5.addStr( "Col3" );
ArrayOfObject row = new ArrayOfObject();
row.setArray( new Object []
{ "Val1", "Val2", "Val3" } );
testQuery5.addVal( row );
row = new ArrayOfObject();
row.setArray( new Object []
{ 1, 2, 3 } );
testQuery5.addVal( row );
row = new ArrayOfObject();
row.setArray( new Object []
{ 2.33, 5.211, 743.1212 } );
testQuery5.addVal( row );
QueryTest_Query result = stub.testEchoQuery( testQuery5 );
System.out.println( Arrays.asList( result.getStr() ) );
ArrayOfObject [] val = result.getVal();
for ( ArrayOfObject arrayOfObject : val )
{
System.out.println( Arrays.asList( arrayOfObject.getArray() ) );
}
}
}
When I try to invoke the service, I am getting the following exception in the
client side.
Exception in thread "main" org.apache.axis2.AxisFault: unknown
at
org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:531)
at
org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:375)
at
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:421)
at
org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
at
org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
at
org.apache.ws.axis2.QueryTestStub.testEchoQuery(QueryTestStub.java:184)
at org.apache.ws.axis2.Axis2QueryTest.main(Axis2QueryTest.java:32)
And in the server, I am getting the following error in the console.
java.lang.NullPointerException
at
org.apache.axis2.databinding.utils.BeanUtil.getPropertyQnameList(BeanUtil.java:276)
at
org.apache.axis2.databinding.utils.BeanUtil.getPullParser(BeanUtil.java:95)
at
org.apache.axis2.rpc.receivers.RPCUtil.processResponse(RPCUtil.java:114)
at
org.apache.axis2.rpc.receivers.RPCUtil.processResponseAsDocLitWrapped(RPCUtil.java:521)
at
org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:153)
at
org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:40)
at
org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:110)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:181)
at
org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:172)
at
org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:146)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:619)
Please check this case.
Thanks,
Paul
> Provide support for complex object types.
> -----------------------------------------
>
> Key: AXIS2-5063
> URL: https://issues.apache.org/jira/browse/AXIS2-5063
> Project: Axis2
> Issue Type: Improvement
> Components: adb
> Affects Versions: 1.5.4, 1.6.0
> Reporter: Muhammed Shariq
> Assignee: Sagara Gunathunga
> Fix For: 1.7.0
>
>
> It is not possible to pass complex type objects via a web service invocation.
> The following error is thrown while attempting to do so.
> [ERROR] Exception occurred while trying to invoke service method echoArray
> org.apache.axis2.AxisFault: Unknow type
> {http://www.w3.org/2001/XMLSchema}string
> at
> org.apache.axis2.databinding.utils.BeanUtil.deserialize(BeanUtil.java:349)
> at
> org.apache.axis2.databinding.utils.BeanUtil.processObject(BeanUtil.java:827)
> at
> org.apache.axis2.databinding.utils.BeanUtil.ProcessElement(BeanUtil.java:717)
> at
> org.apache.axis2.databinding.utils.BeanUtil.deserialize(BeanUtil.java:655)
> at
> org.apache.axis2.rpc.receivers.RPCUtil.processRequest(RPCUtil.java:153)
> at
> org.apache.axis2.rpc.receivers.RPCUtil.invokeServiceClass(RPCUtil.java:206)
> at
> org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:117)
> at
> org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:40)
> at
> org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:110)
> at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:181)
> at
> org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:172)
> at
> org.apache.axis2.transport.http.HTTPWorker.service(HTTPWorker.java:296)
> at
> org.apache.axis2.transport.http.server.AxisHttpService.doService(AxisHttpService.java:281)
> at
> org.apache.axis2.transport.http.server.AxisHttpService.handleRequest(AxisHttpService.java:187)
> at
> org.apache.axis2.transport.http.server.HttpServiceProcessor.run(HttpServiceProcessor.java:82)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> at java.lang.Thread.run(Thread.java:662)
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]