• Post Reply Bookmark Topic Watch Topic
  • New Topic

losing data from SOAP Web Service to client

 
Michael Phoenix
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am in the process of upgrading an application from NetBeans 6.9 /Glassfish 2 to NB7.3.1/GF4. I have an class called "user" which contains a member object of a class called "company".

In the new environment my SOAP Webservice creates the user with a company successfully. However when the client receives the user object returned by the WS operation, the company is null. In the old version it returns the user with the company member object no problem. I've looked at the schema for both WSDKs and they look OK, exactly the same as far as the relationship between the two complex types. I have used the debugger to verify that it is somewhere between the service handing off the object and the client

Any idea what might be going on or how I can debug this?
 
James Boswell
Bartender
Posts: 1051
5
Chrome Eclipse IDE Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Michael

I assume you have checked the SOAP response to verify that the company is not present.
 
Michael Phoenix
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using the debugger from NB to show that it is not being returned. I assume that means that it is not being passed back from SOAP.
 
James Boswell
Bartender
Posts: 1051
5
Chrome Eclipse IDE Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is the data persisted somewhere? If so, I would debug around the point of retrieval.
 
E Armitage
Rancher
Posts: 989
9
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also check the call with a webservice client like soap ui so that you don't have to mention Netbeans at all when discussing this problem further.
 
Michael Phoenix
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, I used the NB WebService tester and the SOAP response appears to be correct, it is sending all the data. The problem has to be in between SOAP and the client, because the client only sees a null where the company should be. Anybody have an ideas on how to catch what is going on between the client and the SOAP response?

There is no persistance involved here. The objects are created in the service and passed back to the client via SOAP.
 
James Boswell
Bartender
Posts: 1051
5
Chrome Eclipse IDE Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Michael

Can you debug at exactly the point where the client receives the response? Can you post a snippet of that code?
 
Michael Phoenix
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I really am out of ideas. Am wondering if going from Java 1.6 to 1.7 might not be part of the problem. I'm including some code below if anybody could look at it and give me some idea what might be happening, I would appreciate it. All the other data is coming across OK. Only the company data is missing.

Here's the client code. It is right after the getUser call that we see the data loss:



Here is the Webservice operation code. the variable ret contains the User with it's Company member.


Here is the User class.



And the Company class.

 
James Boswell
Bartender
Posts: 1051
5
Chrome Eclipse IDE Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you also post the SOAP response.
 
Michael Phoenix
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sure thing here is the SOAP response.

 
James Boswell
Bartender
Posts: 1051
5
Chrome Eclipse IDE Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Michael

I'm not sure how you have generated the User class but I think you need the following annotation on your Company member variable:

Otherwise, I'm not sure how JAXB would know how to translate the company element to the member variable of the User class.
 
Michael Phoenix
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Entering the line you gave me wouldn't even pass the NetBeans Java compiler
I tried this:



And it blew up when the app server tried to load it.


Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
Class has two properties of the same name "company"
this problem is related to the following location:
at public com.lingosys.attask.ws.Company com.lingosys.attask.ws.User.getCompany()
at com.lingosys.attask.ws.User
at public com.lingosys.attask.ws.User com.lingosys.attask.ws.jaxws.CreateLinguistInformation.userObject
at com.lingosys.attask.ws.jaxws.CreateLinguistInformation
this problem is related to the following location:
at private com.lingosys.attask.ws.Company com.lingosys.attask.ws.User.company
at com.lingosys.attask.ws.User
at public com.lingosys.attask.ws.User com.lingosys.attask.ws.jaxws.CreateLinguistInformation.userObject
at com.lingosys.attask.ws.jaxws.CreateLinguistInformation
at com.sun.xml.bind.v2.runtime.IllegalAnnotationsException$Builder.check(IllegalAnnotationsException.java:106)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:471)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:303)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:142)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1174)
at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:162)
at com.sun.xml.bind.api.JAXBRIContext.newInstance(JAXBRIContext.java:168)
at com.sun.xml.bind.api.JAXBRIContext.newInstance(JAXBRIContext.java:112)
at com.sun.xml.ws.developer.JAXBContextFactory$1.createJAXBContext(JAXBContextFactory.java:113)
at com.sun.xml.ws.db.glassfish.JAXBRIContextFactory.newContext(JAXBRIContextFactory.java:92)
... 66 more
 
Michael Phoenix
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The SOAP responae listed above shows that the Company data is being returned by SOAP, at least when I use the NetBeans tester. However. when I run my client program the Company member object is returned as null. Anybody have any idea why this would happen? I'm under a deadline and am getting really desperate.
 
Michael Phoenix
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So nobody has any idea what might be going on here or have any idea how I could find an answer?
 
Michael Phoenix
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just letting everybody know that the answer to this is at Stack Overflow topic
 
James Boswell
Bartender
Posts: 1051
5
Chrome Eclipse IDE Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Michael

The JAX-WS bug you mention in the SO post, do you have a link for it? That would be extremely useful for anyone who encounters this bug in future.

Glad you got it sorted.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!