5 Replies Latest reply on Dec 27, 2005 4:36 PM by Jason Greene

    xsd:any: content of _any not present in SOAP message returne

    Bruno Grieder Newbie


      Coud you please help me return the content of an xsd:any structure to a webservice client. I have no problem sending data using a similar structure but cannot get anything outbound. My JBoss server is a 4.0.2.

      I am using document/literal with types that look like this

       <xs:element name="elementsIn">
       <xs:any maxOccurs="unbounded"/>
       <xs:element name="elementsOut">
       <xs:any maxOccurs="unbounded"/>

      The operation "execute" takes elemntsIn and returns elementsOut.

      As expected jwsp generates two classes ElementsIn and ElementsOut that both have a methods of signature:
      public javax.xml.soap.SOAPElement[] get_any();
      public void set_any(javax.xml.soap.SOAPElement[] _any);

      The execute operation looks like this
      public ElementsOut execute(ElementsIn elementsIn) throws RemoteException {
       //do various things to get a DOM Document
       MessageFactory messageFactory = MessageFactory.newInstance();
       SOAPMessage message = messageFactory.createMessage();
       SOAPEnvelope envelope = message.getSOAPPart().getEnvelope();
       SOAPElement[] ret = new SOAPElement[1];
       ret[0] = envelope.getBody().addDocument(DOMDocument);
       ElementsOut out = new ElementsOut();
       return out;

      No exception is thrown and I have verified that "ret" contains data but the SOAP envelope is empty:

      <?xml version="1.0" encoding="UTF-8"?>
      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
       <ns1:elementsOut xmlns:ns1="umy-namespace"/>

      ElementsOut does not seemed to be serialized correctly.
      Any Idea?