Hi all,

I thought I'd post to this group before I sent something off to the equivalent xmlbeans group. 

Brief description of system.  Axis2 based web service which I've tied into Spring using the Axis2-Spring module.  ValueObjects w/ xdoclet were created to model domain and interact with Hibernate.  Java Collections were used throughout all of the ValueObjects.
The web services were an afterthought, and after many different attempt to get something to work I came up with the following solution.  Create xsd partially based on the value objects that had already been created in the months prior.  Use WSDL2Java with xmlbeans option to create web service.  I used commons.Betwixt to convert from the ValueObject
to the corresponding type class.  I also had some initial success going from web service type to value object using.  Things started coming apart when the xml coming in became more complex.  That said it was working for a day and all of the sudden started failing.

Sorry for the bad example.  I don't have my code to copy over, but here is a rough idea of what's going on.

So with the  Boat element defined in a separate xsd, wsdl looks something
...xmlns:tns="urn:somehost/services/BoatService" ...
<xsd:import namespace"http://somehost/types" schemaLocation=" xsd0.xsd " />
<xsd:element type="tns:addBoatResponseType" name="addBoatResponse" />
<xsd:element type="tns:addBoatRequestType" name="addBoatRequest" />
<xsd:complexType name ="addBoatResponseType>
  <xsd:sequence>
    <xsd:element name="boatID" type="xsd:long"/>
  </xsd:sequence>
</xsd:complexType>
<xsd:complexType name ="addBoatRequestType>
  <xsd:sequence>
     <xsd:element name="boatVO" type="types:BoatVO"/>
  </xsd:sequence>
</xsd:complexType>

On the service side I just basically do:
AddBoatRequestType request  = BoatDocument.getRequest();
BoatVO boat =  request.getBoatVO();

This all works fine, however when I send it on it's way to betwixt, I'm getting <xmlfragment> wrapped around the BoatVO when I do a boat.toString().  Betwixt chokes and dies.

Is this working as designed?  Am I just missing something?


Thanks,

Jason

Reply via email to