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.

Bug 122771

Summary: WDSL-file creation with complex types fails partially
Product: webservices Reporter: lin_art <lin_art>
Component: CodeAssignee: Milan Kuchtiak <mkuchtiak>
Status: NEW ---    
Severity: blocker CC: mgrebac
Priority: P3    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:
Attachments: Calculator Webservice

Description lin_art 2007-11-26 14:25:51 UTC
(hope this is the right channel for this report)


I used the Netbeans sample Calculator-Webservice and added a new class TestClass and a new webmethod sendClass() 

which return a TestClass object.
No warnings after building. Deployment + verification on a glassfish appserver worked. 
The add() webmethod worked for the int result-type. The sendClass() returns an empty object.

New Dummy-Class:

import java.util.Vector;
public class TestClass implements Serializable {
    String s; int i; Vector<String> v;
    public TestClass() { s = ""; i = 0; v = new Vector<String>(); }
    public TestClass(int ii, String ss) { s = ss; i = ii; v = new Vector<String>(); v.add("TESTEST");}

New Web-Method: sendClass(int, String)

@WebMethod(operationName = "sendClass")
public TestClass sendClass(
       @WebParam(name = "i") int i, 
       @WebParam(name = "s") String s) {
  TestClass tc = new TestClass(44, "asdfa");
      return tc;

WDSL File changes after deployment: 

 <message name="sendClass">
  <part name="parameters" element="tns:sendClass" /> 
 <message name="sendClassResponse">
  <part name="parameters" element="tns:sendClassResponse" /> 
<operation name="sendClass">
<soap:operation soapAction="" /> 
  <soap:body use="literal" /> 
  <soap:body use="literal" /> 

XSD File changes after deployment:

<xs:complexType name="sendClassResponse">
  <xs:element name="return" type="tns:testClass" minOccurs="0" /> 
<xs:complexType name="testClass">
 <xs:sequence /> 

As you see, the complex-type is empty...
Did I miss something? Some annotations? Or is this a java-sdk bug?
Comment 1 lin_art 2007-11-26 14:28:51 UTC
Created attachment 53493 [details]
Calculator Webservice
Comment 2 lin_art 2007-11-26 18:29:10 UTC

Use the @XmlElement annotation for each class-variable, like:

String s; 

int i; 

and to the @WebService annotation add @XmlSeeAlso({,...}), like

public class CalculatorWS {..}

A complex datatype should be included to the calculator sample or as a new issue in a next NB version..

nb: GREAT IDE!!! Thanks a lot for your work!
Comment 3 Lukas Jungmann 2008-03-16 16:20:23 UTC
Martin, can you evaluate this issue, please? It's about calculator sample...
Comment 4 Martin Grebac 2008-03-17 11:13:18 UTC
Thanks for reporting. Changing to enhancement.