Restful services and setTagName()

Hi list,

I’m using JAXB 2.0 for XML marshaling/unmarshaling, and the RestDataSource.

To JAXB identify the right Java type to convert, I’m using the setTagName(String tag) method, and everyting is ok while fetching, but something is wrong with the put response.

The fetch response, if you use the setTagName(“atividade”) looks like:

<?xml version=“1.0” encoding=“UTF-8” standalone=“yes”?>
<response>
<status>0</status>
<errors/>
<startRow>0</startRow>
<endRow>0</endRow>
<totalRows>1</totalRows>
<data>
<atividade>
<camadas>1</camadas>
<cortadeiraPrincipal>2</cortadeiraPrincipal>
<diametroBobina>1000</diametroBobina>
<distribuicao>20x1</distribuicao>
<duracao>00:00</duracao>
<grupos>1: 700 x 1200<br />2: 200 x 1100</grupos>
<id>16757</id>
<larguraBobina>766
</larguraBobina>
<papel>
<descricao>PASTA LINTER ALGODAO/F 1,50 MM 2300 MM</descricao>
<id>1050</id>
</papel>
<sequencia>0</sequencia>
<tubete>76</tubete>
</atividade>
</data>
</response>

and the successful update response (a PUT action) looks like:

<?xml version=“1.0” encoding=“UTF-8” standalone=“yes”?>
<response>
<status>0</status>
<errors/>
<startRow>0</startRow>
<endRow>0</endRow>
<totalRows>1</totalRows>
<data>
<atividade>
<camadas>1</camadas>
<cortadeiraPrincipal>2</cortadeiraPrincipal>
<diametroBobina>1000</diametroBobina>
<distribuicao>20x1</distribuicao>
<duracao>00:00</duracao>
<grupos>1: 700 x 1200<br />2: 200 x 1100</grupos>
<id>16757</id>
<larguraBobina>766
</larguraBobina>
<papel>
<descricao>PASTA LINTER ALGODAO/F 1,50 MM 2300 MM</descricao>
<id>1050</id>
</papel>
<sequencia>0</sequencia>
<tubete>76</tubete>
</atividade>
</data>
</response>

Almost the same XML, but a error occurs during the XML parse, and the firefox console show a strange error. The setTagName method works for XML request and response?

Thanks!

Do not cross post.

Sorry!

Sorry, when I posted the message, the site was very busy and I thought the post was unsuccessful.

Thanks