users@glassfish.java.net

Problem with deploying web services

From: <glassfish_at_javadesktop.org>
Date: Fri, 02 May 2008 02:31:37 PDT

Hi to all.

I'm trying to deploy some web services using EJB 3.0 and I'm getting a weird (at least form me) behavior.

My EJB code is something like:

[code]
package mydomain.wstest;
@Stateless
@WebService
public class WSTest1Bean implements WSTest1Remote {
    ...
    @WebMethod
    public void doSomething(MyType1 obj) { ... }
}

package mydomain.wstest;
@Stateless
@WebService
public class WSTest2Bean implements WSTest2Remote {
    ...
    @WebMethod
    public void doSomething(MyType2 obj) { ... }
}

package mydomain.wstest;
@Stateless
@WebService
public class WSTest3Bean implements WSTest3Remote {
    ...
    @WebMethod
    public void doSomething(MyType3 obj) { ... }
}
[/code]

If I develop a simple client app, the generated code is wrong: for example the method WSTest3Bean.doSomething() sometimes requires a MyType1 obj, sometimes a MyType2 and sometimes a MyType3: it changes everytime I redeploy the EJBs.

Looking at the generated xsd, for example for WSTest3Bean, I can found a strange definition:

[code]
<xs:complexType name="create">
  <xs:sequence>
    <xs:element name="arg0" type="tns:myType2" minOccurs="0"/>
  </xs:sequence>
</xs:complexType>
[/code]

Why do there is a myType2 type?

Moreover, I tried to put each bean in a separate package:

[code]
package mydomain.wstest.wstest1;
@Stateless
@WebService
public class WSTest1Bean implements WSTest1Remote { ... }
[/code]

and in this case I have no problem at all!

Is this behavior correct and I'm missing something, or is it a bug?
Many thanks in advance

Danilo Levantesi
[Message sent by forum member 'danilo_levantesi' (danilo_levantesi)]

http://forums.java.net/jive/thread.jspa?messageID=272498