users@jax-ws.java.net

Re: Problem with recursive/circular data references via SOAP

From: Doug Kohlert <Doug.Kohlert_at_Sun.COM>
Date: Mon, 06 Mar 2006 14:26:06 -0800

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
>
>
>

-- 
 - Doug