• Post Reply Bookmark Topic Watch Topic
  • New Topic

Parse Error when sending complex type object in SOAP message

 
maryline saladin
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.

I'm stuck since few days on a really anoying problem.... As I am new on web services and a junior in java....
I created a project with Eclipse JEE witch Tomcat and Axis
I have available functions from outside (that i call with SOAPUI from the same pc) problem is I need that my function send back a SOAP message with that structure :


<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlnssi="http://www.w3.org/2001/XMLSchema-instance" xmlnssd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>
<GetAvailableResultsResponse xmlns="http://....">
<GetAvailableResultsResult>
<PendingResultsItem>
<Search_id>int</Search_id>
<Timestamp>dateTime</Timestamp>
<Partid>string</Partid>
<Price>string</Price>
<Currency>string</Currency>
<Uom>string</Uom>
<Description>string</Description>
<Supplier>string</Supplier>
<Searchstring>string</Searchstring>
<Returned>boolean</Returned>
<Searchorder>int</Searchorder>
<Callingsite_id>int</Callingsite_id>
<Internalpartid>string</Internalpartid>
<Detaillink>string</Detaillink>
<Basketlink>string</Basketlink>
</PendingResultsItem>
<PendingResultsItem>
<Search_id>int</Search_id>
<Timestamp>dateTime</Timestamp>
<Partid>string</Partid>
<Price>string</Price>
<Currency>string</Currency>
<Uom>string</Uom>
<Description>string</Description>
<Supplier>string</Supplier>
<Searchstring>string</Searchstring>
<Returned>boolean</Returned>
<Searchorder>int</Searchorder>
<Callingsite_id>int</Callingsite_id>
<Internalpartid>string</Internalpartid>
<Detaillink>string</Detaillink>
<Basketlink>string</Basketlink>
</PendingResultsItem>
....
</GetAvailableResultsResult>
</GetAvailableResultsResponse>
</soap12:Body>
</soap12:Envelope>

So I send back a List but I would need a List of Product (Product is a class with attributs that matches this SOAP format) ... problem.... When i send back a Product List i got this error:

Exception: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Premature end of file. Message: ; nested exception is: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Premature end of file.

After many searches it seems like i call an InputSource that close the object and that i try to access it later... But I can't see where or how to fix this..

Here is my function

public List<Product> GetTest(int SearchID, String SharedSecret)
{
List<Product> prods = new ArrayList<Product>();

Product p1 = new Product();
Product p2 = new Product();

prods.add(p1);
prods.add(p2);

return prods;

}

Have you any idea of the solution?

Thank you so much
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!