[ 
https://issues.apache.org/jira/browse/AXIS2-1928?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12462245
 ] 

Ole Dalgaard commented on AXIS2-1928:
-------------------------------------

I have attached a wsdl and some testfiles, that generates the errors I see, 
guess it reproduces Ram's error as well. I have only used axis2 on the client 
side, don't know if this is a problem on the server side as well.
Using the attached testcase, I get this error:

java.lang.RuntimeException: java.lang.RuntimeException: Unexpected subelement 
text
        at 
dk.test.axis2.MyTestWSServiceStub.fromOM(MyTestWSServiceStub.java:3178)
        at 
dk.test.axis2.MyTestWSServiceStub.getFooBar(MyTestWSServiceStub.java:160)
        at dk.test.axis2.MyTestWSTest.testError(MyTestWSTest.java:35)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
        at java.lang.reflect.Method.invoke(Method.java:391)
        at junit.framework.TestCase.runTest(TestCase.java:154)
        at junit.framework.TestCase.runBare(TestCase.java:127)
        at junit.framework.TestResult$1.protect(TestResult.java:106)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
        at junit.framework.TestResult.run(TestResult.java:109)
        at junit.framework.TestCase.run(TestCase.java:118)
        at junit.framework.TestSuite.runTest(TestSuite.java:208)
        at junit.framework.TestSuite.run(TestSuite.java:203)
        at 
org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
        at 
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: java.lang.RuntimeException: Unexpected subelement text
        at 
dk.test.axis2.MyTestWSServiceStub$FooBar$Factory.parse(MyTestWSServiceStub.java:2373)
        at 
dk.test.axis2.MyTestWSServiceStub$GetFooBarResponse$Factory.parse(MyTestWSServiceStub.java:3045)
        at 
dk.test.axis2.MyTestWSServiceStub.fromOM(MyTestWSServiceStub.java:3158)
        ... 21 more



> Wrong code generation when xs:extension used in schema
> ------------------------------------------------------
>
>                 Key: AXIS2-1928
>                 URL: https://issues.apache.org/jira/browse/AXIS2-1928
>             Project: Apache Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: adb
>         Environment: Windows XP, JDK 1.4
>            Reporter: Ram Lakshmanan
>         Attachments: MyTestWS.wsdl, myTestWS.zip
>
>
> Axis2 with ADB Binding generates wrong code when complexType elements are 
> built with xs:extension. Here goes excerpt from our schema:
> <xs:complexType name="Reference_Type">
>       <xs:complexContent>
>               <xs:extension base="acct-d1:Reference_Type">
>                       <xs:sequence>
>                               <xs:element ref="svc-acct:keyGrpHogan" 
> minOccurs="0"/>
>                       </xs:sequence>
>               </xs:extension>
>       </xs:complexContent>
> </xs:complexType>
> Generated code doesn't parses the elements present in 
> "acct-d1:Reference_Type". It totally ignores them. In the generated code you 
> can easy that it's parsing only the: "svc-acct:keyGrpHogan" and not the 
> elements in "acct-d1:Reference_Type". Here goes the generated code's parse() 
> API:
>         public static Reference_Type349 
> parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{
>             Reference_Type349 object = new Reference_Type349();
>             int event;
>             try {
>                 
>                 while (!reader.isStartElement() && !reader.isEndElement())
>                     reader.next();
>                 
>                 if 
> (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type";)!=null){
>                   java.lang.String fullTypeName = 
> reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance";,
>                         "type");
>                   if (fullTypeName!=null){
>                     java.lang.String nsPrefix = 
> fullTypeName.substring(0,fullTypeName.indexOf(":"));
>                     nsPrefix = nsPrefix==null?"":nsPrefix;
>                     java.lang.String type = 
> fullTypeName.substring(fullTypeName.indexOf(":")+1);
>                     if (!"Reference_Type".equals(type)){
>                         //find namespace for the prefix
>                         java.lang.String nsUri = 
> reader.getNamespaceContext().getNamespaceURI(nsPrefix);
>                         return 
> (Reference_Type349)com.wellsfargo.eai_schemas.provider.aps.accountinquiry.ExtensionMapper.getTypeObject(
>                              nsUri,type,reader);
>                       }
>                   }
>                 }
>                 
>                 
>                 // Note all attributes that were handled. Used to differ 
> normal attributes
>                 // from anyAttributes.
>                 java.util.Vector handledAttributes = new java.util.Vector();
>                 
>                 boolean isReaderMTOMAware = false;
>                 
>                 try{
>                   isReaderMTOMAware = 
> java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE));
>                 }catch(java.lang.IllegalArgumentException e){
>                   isReaderMTOMAware = false;
>                 }
>                 
>                     
>                     reader.next();
>                 
>                                     
>                                     while (!reader.isStartElement() && 
> !reader.isEndElement()) reader.next();
>                                 
>                                     if (reader.isStartElement() && new 
> javax.xml.namespace.QName("http://service.wellsfargo.com/entity/account/2003/","keyGrpHogan";).equals(reader.getName())){
>                                 
>                                         
> object.setKeyGrpHogan(com.wellsfargo.service.entity.account._2003.KeyGrpHogan_Type.Factory.parse(reader));
>                                       
>                                         reader.next();
>                                     
>                               }  // End of if for expected property start 
> element
>                               
>                             while (!reader.isStartElement() && 
> !reader.isEndElement())
>                                 reader.next();
>                             if (reader.isStartElement())
>                                 // A start element we are not expecting 
> indicates a trailing invalid property
>                                 throw new 
> java.lang.RuntimeException("Unexpected subelement " + reader.getLocalName());
>                         
>             } catch (javax.xml.stream.XMLStreamException e) {
>                 throw new java.lang.Exception(e);
>             }
>             return object;
>         }
>         }//end of factory class
> Do let me know, if you need any further information.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
https://issues.apache.org/jira/secure/Administrators.jspa
-
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]

Reply via email to