File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Issue in response in Spring WS with AJXB

 
Deepak Ram
Greenhorn
Posts: 12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I am having a strange issue in generating response XMLs using Spring WS.

I use Spring WS with JAXB. PFB a snippet of the schema that I used to generate JAXB objects:

<xs:complexType name="Customer">
<xs:sequence>
<xs:element name="Accounts" type="Accounts" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="Accounts">
<xs:sequence>
<xs:element name="Account" type="Account" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="Account">
<xs:sequence>
<xs:element name="Account" type="xs:string" />
</xs:sequence>
</xs:complexType>


The expected output should look something like this:

<Customer>
<Accounts>
<Account>
<Name>xyzxxx</Name>
<Account>
<Account>
<Name>xasde</Name>
<Account>
<Accounts>
</Customer>

This is working in case of small XML requests. But, in case of huge XML requests, the output is modified to something as follows:

<Customer>
<Accounts>
<Account>
<Name>xyzxxx</Name>
<Account>

<Name>xasde</Name>

<Accounts>
</Customer>

The difference is that the account tag is not getting generated in a few cases. This is not happening regularly but intermittently. As a result, the XML formed does not conform to the schema and we are getting schema validation errors.

As I mentioned before, this issue occurs only in case of huge XMLs. I might say that the size of the XML is greater than 500 kb each time we encounter this error. Also, we are not able to reproduce this on a regular basis.

Has anyone encountered this error before? Or any suggestions as to what might cause this error? Or any workaround for this issue?

Any thoughts would be helpful and will be highly appreciated.

Thanks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic