This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
In order to reproduce this issue: - Create an empty EJB project (NetBeans 6.0, glassfish v2u1). - Add two Entity classes, "Document" and "Keyword" (persistence "TopLink" using jdbc/__default) - Edit "Document" to contain a @OneToMany Collection<Keyword>. - Create two "Session Beans for Entity Classes" for both "Document" and "Keyword". - Create two web services and choose "Create Web Service from existing sesion bean" for both "DocumentFacade" ("DocumentSOAP") and "KeywordFacade" ("KeywordSOAP"). - Deploy the project to glassfish, move to the glassfish admin console, "Web Services" and copy the WSDL URL for "DocumentSOAP". - Create an empty java project. - Create a new "web service client", choose "WSDL URL" and paste the URL copied from glassfish admin. - Make the IDE create the web service. - Move to the "DocumentSOAPPort" in "Web Service References" and drag the "create" method to the "Main" class of the java project. This code reproducibly (two different machines, two different installments of netbeans) will be inserted: [01] try { // Call Web Service Operation [02] demo.documents.client.DocumentSOAPService service = new demo.documents.client.DocumentSOAPService(); [03] demo.documents.client.DocumentSOAP port = service.getDocumentSOAPPort(); [04] // TODO initialize WS operation arguments here [05] [06] demo.documents.client.Keyword arg0 = null; [07] [08] port.create(arg0); [09] [10] } catch (Exception ex) { [11] // TODO handle custom exceptions here [12] } Line 6 .. 8: The service is supposed to create(Document arg0) rather than create(Keyword arg0). The client generated does obviously not represent the DocumentFacade exposed by the web service... @Local public interface DocumentFacadeLocal { void create(Document document); ... or the web service definition according to the IDE: @WebService() @Stateless() public class DocumentSOAP { @EJB private DocumentFacadeLocal ejbRef; // Add business logic below. (Right-click in editor and choose // "Web Service > Add Operation" @WebMethod(operationName = "create") @Oneway public void create(Document document) { ejbRef.create(document); } Demo-Projects "demo.documents" (EJB) and "demo.documents.client" (Java) attached. - Create a Web Service Client
Created attachment 55117 [details] EJB module
Created attachment 55118 [details] client module
Interesting. The original problem is that wsdl generated from demo.documents.DocumentSOAP service is incorrect. That's likely because jax-ws doesn't like "Document" as parameter type/class name. If you change the class name to something else(e.g. Document1) it will work correctly. I reported an issue to JAX-WS team. See: https://jax-ws.dev.java.net/issues/show_bug.cgi?id=504 We cannot do much for that as we rely on what JAX-WS2.1 generates on the server. Thank You for this example.
Milan, thanks then for dealing with this and directing it to the right place. Subscribed myself to the jax-ws issue, marking this as closed then. Best regards, Kristian
I see that both Web Services are in the same package and are ending up in the same targetnamespace. Both Web Services have the same method name "create" and the wrappers are generate into same package name ("jaxws" subpackage of sei or endpoint). Netbeans runs wsgen on both the services one after the other and overwrites the wrapper "create" generated by the other. Try giving different package names to the WebServices or use @RequestWrapper,@ResponseWrapper annotations on create method to customize it to use different wrapper name.