title: My jax-ws webservice client returns only empty objects
body: <p>I have a third party webservice for which I generate a client using wsimport. Each call to the webservice completes successfully, but the response object I get back has all its fields set to null. Monitoring the network I can see that on the wire all of the XML elements in the response message have values in them, so the object should have non-null data in it. Also, a client for the same service generated with old axis1 and called with the same data returns a non-empty response. Any idea what's happening? (In case it makes any difference I'm using MOXy's implementation of JAXB).</p>
  
  <p><em><strong>Update</em></strong>: I've been able to narrow it down. The wsdl defines object in its own namespace, say <code>http://www.acme.com/ws</code>. The response I get from the service is</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  ... SOAP envelope ...
  &lt;ns1:opINFOWLResponse xmlns:ns1="http://www.acme.com/ws" 
   xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
  &lt;ns1:responseINFOWL xsi:type="ns1:responseINFOWL"&gt;
  &lt;result&gt;6003&lt;/result&gt;
  &lt;ndserr/&gt;
  &lt;transid&gt;61437594&lt;/transid&gt;
  &lt;descriptionerr&gt;BLAH.&lt;/descriptionerr&gt;
  &lt;/ns1:responseINFOWL&gt;
  &lt;/ns1:opINFOWLResponse&gt;
  ... SOAP closing tags ...
  </code></pre>
  
  <p>and is unmarshalled to a non null <code>OpINFOWLResponse</code> which wraps around a non null <code>responseINFOWL</code> object with all the fields set to null. Just for fun I've tried writing a couple of lines to unmarshal the above snippet (after stripping the SOAP overhead)</p>
  
  <pre><code>JAXBContext ctx = JAXBContext.newInstance(OpINFOWLResponse.class);
  Unmarshaller u = ctx.createUnmarshaller();
  
  OpINFOWLResponse o = (OpINFOWLResponse) u.unmarshal(new StringReader(theSnippetAbove));
  ResponseINFOWL w = o.getResponseINFOWL();
  </code></pre>
  
  <p>and I get the same result. If I change the XML above to </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;ns1:opINFOWLResponse xmlns:ns1="http://www.acme.com/ws" 
   xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
  &lt;ns1:responseINFOWL xsi:type="ns1:responseINFOWL"&gt;
  &lt;ns1:result&gt;6003&lt;/ns1:result&gt;
  &lt;ns1:ndserr/&gt;
  &lt;ns1:transid&gt;61437594&lt;/ns1:transid&gt;
  &lt;ns1:descriptionerr&gt;BLAH.&lt;/ns1:descriptionerr&gt;
  &lt;/ns1:responseINFOWL&gt;
  &lt;/ns1:opINFOWLResponse&gt;
  </code></pre>
  
  <p>Everything works fine. Bummer.</p>
  
  <p><em><strong>Update (again)</em></strong>: Same behaviour with both jaxb-RI and Moxy. Still have no idea what's wrong.</p>
  
  <p><em><strong>Update (Sep. 9)</em></strong>: The suggestion below about namespace qualification being wrong is interesting, but I supposed wsimport would get things right. Anyway, this is my <code>package-info.java</code></p>
  
  <pre><code>@XmlSchema(
  namespace = "http://www.acme.com/ws", 
  elementFormDefault = XmlNsForm.QUALIFIED)
  package it.sky.guidaTv.service.remote;
  
  import javax.xml.bind.annotation.XmlSchema;
  import javax.xml.bind.annotation.XmlNsForm;
  </code></pre>
  
  <p>and this is the relevant part of the <code>ResponseINFOWL</code> class</p>
  
  <pre><code>/*
   * &lt;p&gt;Java class for responseINFOWL complex type.
   * 
   * &lt;p&gt;The following schema fragment specifies the expected content contained within this class.
   * 
   * &lt;pre&gt;
   * &amp;lt;complexType name="responseINFOWL"&gt;
   *   &amp;lt;complexContent&gt;
   *     &amp;lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
   *       &amp;lt;sequence&gt;
   *         &amp;lt;element name="result" type="{http://www.w3.org/2001/XMLSchema}string"/&gt;
   *         &amp;lt;element name="descriptionerr" type="{http://www.w3.org/2001/XMLSchema}string"/&gt;
   *         &amp;lt;element name="transid" type="{http://www.w3.org/2001/XMLSchema}string"/&gt;
   *         &amp;lt;element name="ndserr" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
   *         &amp;lt;element name="wallet" type="{http://www.acme.com/ws}t_wallet" minOccurs="0"/&gt;
   *       &amp;lt;/sequence&gt;
   *     &amp;lt;/restriction&gt;
   *   &amp;lt;/complexContent&gt;
   * &amp;lt;/complexType&gt;
   * &lt;/pre&gt;
   * 
   * 
   */
  @XmlAccessorType(XmlAccessType.FIELD)
  @XmlType(name = "responseINFOWL", propOrder = {
  "result", "descriptionerr", "transid", "ndserr", "wallet" })
  public class ResponseINFOWL {
  
  @XmlElement(required = true)
  protected String result;
  @XmlElement(required = true)
  protected String descriptionerr;
  @XmlElement(required = true)
  protected String transid;
  protected String ndserr;
  protected TWallet wallet;
  
      // getters, setters and all.
  
  }
  </code></pre>
  
  <p>I've tried playing a bit with the namespaces in <code>package-info</code> but still no joy.</p>