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.
(hope this is the right channel for this report) Problem: 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: TestClass.java package org.me.calculator; import java.io.Serializable; 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> <message name="sendClassResponse"> <part name="parameters" element="tns:sendClassResponse" /> </message> (..) <operation name="sendClass"> <soap:operation soapAction="" /> <input> <soap:body use="literal" /> </input> <output> <soap:body use="literal" /> </output> </operation> (..) XSD File changes after deployment: (..) <xs:complexType name="sendClassResponse"> <xs:sequence> <xs:element name="return" type="tns:testClass" minOccurs="0" /> </xs:sequence> </xs:complexType> <xs:complexType name="testClass"> <xs:sequence /> </xs:complexType> (..) As you see, the complex-type is empty... Did I miss something? Some annotations? Or is this a java-sdk bug?
Created attachment 53493 [details] Calculator Webservice
Solution: Use the @XmlElement annotation for each class-variable, like: @XmlElement String s; @XmlElement int i; and to the @WebService annotation add @XmlSeeAlso({packet.to.ClassFile.class,...}), like @WebService() @XmlSeeAlso({org.me.calculator.TestClass.class}) 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!
Martin, can you evaluate this issue, please? It's about calculator sample...
Thanks for reporting. Changing to enhancement.