0 Replies Latest reply on Mar 2, 2007 7:21 AM by alberto coletti

    <xsd:any/> binding problem

    alberto coletti Newbie

      using libraries and tools from Jbossws-1.2.0GA to generate a web service client I found a problem in mapping <xsd:any/> wsdl element.

      'llreport the fragment that define the web service response message:

      <s:schema elementFormDefault="qualified" targetNamespace="http://test.it/test">
       <s:element name="Response" >
       <s:any minOccurs="0" maxOccurs="1" />

      wstools generate for this response a class with this code:

      public class Response
       protected javax.xml.soap.SOAPElement _any;
       public Response(){}
       public Response(javax.xml.soap.SOAPElement _any){
       public javax.xml.soap.SOAPElement get_any()
       {return _any ;}
       public void set_any(javax.xml.soap.SOAPElement _any)
       {this._any=_any; }

      when I call the webservice I got a response with this body:

       <Response xmlns="http://test.it/test">

      Now I'm expecting that the -nay variable is filled with the .. element
      but what I obtain is this error:

      org.jboss.xb.binding.JBossXBRuntimeException: {http://test.it/test}root not found as a child of {http://test.it/test}Response
      at org.jboss.xb.binding.sunday.unmarshalling.SundayContentHandler.startElement(SundayContentHandler.java:280)

      Please help, I'm going crazy...