You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Ajith Harshana Ranabahu (JIRA)" <ji...@apache.org> on 2006/03/29 15:50:53 UTC

[jira] Resolved: (AXIS2-266) can't serialize a request that contains a derived type

     [ http://issues.apache.org/jira/browse/AXIS2-266?page=all ]
     
Ajith Harshana Ranabahu resolved AXIS2-266:
-------------------------------------------

    Resolution: Fixed

The issue here is a user error. The 'Create" object should be added to the "createDocument" object.
This can be done by adding a "createDoc.setCreate(create);" just before the last line.
I have tested a sample with the generated stub (which includes the generated stub) and verified that the  service is working

> can't serialize a request that contains a derived type
> ------------------------------------------------------
>
>          Key: AXIS2-266
>          URL: http://issues.apache.org/jira/browse/AXIS2-266
>      Project: Apache Axis 2.0 (Axis2)
>         Type: Bug
>   Components: client-api
>  Environment: WinXP, JDK 5.0, code from SVN 10/3/2005
>     Reporter: Simon Fell
>     Assignee: Ajith Harshana Ranabahu
>  Attachments: enterprise.wsdl
>
> The WSDL (attached) defines a base type, sObject, and a type that extends it, Account. it also defines an operation called create which take 0..n sObject's.
> Trying to call this operation using the WSDL2Code generated code causes an IllegalStateException.
> Exception in thread "main" org.apache.axis2.om.OMException: java.lang.IllegalStateException
> 	at org.apache.axis2.om.impl.llom.builder.StAXOMBuilder.next(StAXOMBuilder.java:279)
> 	at org.apache.axis2.om.impl.llom.OMDocumentImpl.getDocumentElement(OMDocumentImpl.java:107)
> 	at org.apache.axis2.om.impl.llom.builder.StAXOMBuilder.getDocumentElement(StAXOMBuilder.java:289)
> 	at codegen.databinding.SoapcreateDatabindingSupporter.toOM(SoapcreateDatabindingSupporter.java:50)
> 	at codegen.SoapStub.create(SoapStub.java:1278)
> 	at client.testEnterpriseClient.main(testEnterpriseClient.java:95)
> Caused by: java.lang.IllegalStateException
> 	at org.apache.xmlbeans.impl.store.Jsr173$XMLStreamReaderForString.next(Jsr173.java:1110)
> 	at org.apache.xmlbeans.impl.store.Jsr173$SyncedJsr173.next(Jsr173.java:1138)
> 	at org.apache.axis2.clientapi.StreamWrapper.next(StreamWrapper.java:55)
> 	at org.apache.axis2.om.impl.llom.builder.StAXOMBuilder.next(StAXOMBuilder.java:197)
> 	... 5 more
> The code is doing
> 		CreateDocument createDoc = CreateDocument.Factory.newInstance();
> 		Create create = Create.Factory.newInstance();
> 		Account acc = Account.Factory.newInstance();
> 		acc.setName("Axis 2.0/Enterprise");
> 		acc.setAccountNumber("Acc9999");
> 		create.setSObjectsArray(new SObject [] {acc});
> 		SaveResult sr = stub.create(createDoc, sd, ard).getCreateResponse().getResultArray(0);

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira