users@jax-ws.java.net

Re: Problem with recursive/circular data references via SOAP

From: Peter Hendry <peter.hendry_at_capeclear.com>
Date: Tue, 07 Mar 2006 13:07:52 +1300

You should be able to define such circular references in schema, but
"literal" does not support circular object references in instance
documents (you can have things like linked lists as long as it is not
circular). There is no way to reference the same value from multiple
places which would be required. You need "encoded" for this and I don't
believe JAX-WS supports that.

Pete

Doug Kohlert wrote:
> Can you include part of the stack?
>
> Francois Jean wrote:
>
>> Hello,
>>
>> I'm presently trying to implement a Web Service which exposes a class
>> with recursive/circular data references (see the code bellow).
>>
>> When I'm calling the method testRecursive I got a "Stack Overflow
>> Exception" on the server side.
>>
>> How can I represent circular/recursive references using JAX-WS?
>>
>> François JEAN
>>
>>
>>
>> package com.cardinal.ws.server;
>> import java.io.Serializable;
>> public class ClassA implements Serializable {
>> private static final long serialVersionUID = 1L;
>> private long id;
>> private ClassA a;
>>
>> public ClassA getA() {
>> return a;
>> }
>> public void setA(ClassA a) {
>> this.a = a;
>> }
>> public long getId() {
>> return id;
>> }
>> public void setId(long id) {
>> this.id = id;
>> }
>> }
>>
>> @WebMethod
>> public ClassA testRecursive() {
>> ClassA a1= new ClassA();
>> ClassA a2= new ClassA();
>> a1.setId(0);
>> a1.setA(a2);
>>
>> a2.setId(1);
>> a2.setA(a1);
>> return a1;
>> }
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_jax-ws.dev.java.net
>> For additional commands, e-mail: users-help_at_jax-ws.dev.java.net
>>
>>
>>
>