0

today i faced very annoying problem in NetBeans 6.9.1 which as it seems i cannot fix. I'm creating JAX-WS web service (Tomcat 6.0.26) which has an operation which returns an array of custom objects (webServisZapis) which i created. Class from which objects are instantiated consists only of a few String variables and a getter for each of them.

The problem is when the xsd file is generated it doesn't contain structure of the objects i'm returning as a result of my web service and because of that i can't access necessary data in those objects which i'm receiving in another Web application (on Glassfish).

My xsd file contains only this code which refers to objects i'm using:

<xs:complexType name="webServisZapis">
<xs:sequence/>
</xs:complexType>

I have spent all day searching for a solution but i haven't found it. I just cannot figure why it won't work especially since i used almost the same java class in another web service of another project just a few days ago and there wasn't any problem.

TomiB
  • 11
  • 2

2 Answers2

1

Actually my problem was very simple and not related to @XmlSeeAlso. I am ashamed i didn't saw this earlier but the problem was that i had no setters in my class. :D After adding them everything works fine. I hope that this will help someone.

TomiB
  • 11
  • 2
0

You need to help jaxb finding your class, add xmlseealso anottation to your web service. See this: JAXB Exception: Class not known to this context

Community
  • 1
  • 1
lpinto.eu
  • 2,077
  • 4
  • 21
  • 45
  • Thank you so much! @XmlSeeAlso solved my problem. Still don't know why it worked without it before but it works now!!! – TomiB Jun 06 '11 at 19:09