[ http://issues.apache.org/jira/browse/AXIS2-1316?page=all ]

Davanum Srinivas resolved AXIS2-1316.
-------------------------------------

    Resolution: Cannot Reproduce

Works for me. Tried both a stand alone code (see below) and tried posting the 
soap request using XMLSPY to a deployed aar.


import com.sosnoski.ws.library.wsdl.GetBook;

import javax.xml.stream.XMLInputFactory;
import javax.xml.stream.XMLStreamReader;
import java.io.StringReader;

public class Main {
   public static void main(String[] args) throws Exception {
       String responseXML = "<ns2:getBook 
xmlns:ns2=\"http://ws.sosnoski.com/library/wsdl\";>\n" +
               "            <ns2:isbn>0061020052</ns2:isbn>\n" +
               "         </ns2:getBook>";
       XMLStreamReader reader = 
XMLInputFactory.newInstance().createXMLStreamReader(new 
StringReader(responseXML));
       reader.next();
       GetBook getBook = GetBook.Factory.parse(reader);
       System.out.println(getBook);
       System.out.println(getBook.getIsbn());
   }
}


> "Unexpected subelement" when parsing simple request
> ---------------------------------------------------
>
>                 Key: AXIS2-1316
>                 URL: http://issues.apache.org/jira/browse/AXIS2-1316
>             Project: Apache Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: adb
>    Affects Versions: nightly
>         Environment: Linux, Java 1.5.0
>            Reporter: Dennis Sosnoski
>            Priority: Blocker
>         Attachments: library.zip
>
>
> In trying to build and run some test code that had been working last week I 
> found that the requests were not properly parsed. Here's a snippet of the 
> WSDL:
>   
>     <schema elementFormDefault="qualified"
>         targetNamespace="http://ws.sosnoski.com/library/wsdl";
>         xmlns="http://www.w3.org/2001/XMLSchema";
>         xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
>       
>       <import namespace="http://ws.sosnoski.com/library/types"/>
>         
>       <element name="getBook">
>         <complexType>
>           <sequence>
>             <element name="isbn" type="xsd:string"/>
>           </sequence>
>         </complexType>
>       </element>
> Here's the XML sent by the generated ADB client:
> <?xml version='1.0' encoding='UTF-8'?>
>    <soapenv:Envelope 
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";>
>       <soapenv:Header />
>       <soapenv:Body>
>          <ns2:getBook xmlns:ns2="http://ws.sosnoski.com/library/wsdl";>
>             <ns2:isbn>0061020052</ns2:isbn>
>          </ns2:getBook>
>       </soapenv:Body>
>    </soapenv:Envelope>
> This looks correct to me, but the server responds:
>               <Exception>org.apache.axis2.AxisFault: 
> java.lang.RuntimeException: Unexpected subelement isbn; nested exception is:  
>    java.lang.RuntimeException: java.lang.RuntimeException: Unexpected 
> subelement isbn      at 
> org.apache.axis2.AxisFault.makeFault(AxisFault.java:318)     at 
> ...
> I wonder if this could relate to recent changes for attributeFormDefault 
> handling? In this case I'm using elementFormDefault, but I know there was 
> some confusion between the two earlier (and in fact, last week the generated 
> code was improperly namespace qualifying attributes used in other messages 
> for this service).

-- 
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

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to