title: Web Services: Unexpected EOF in prolog - I get this when I use Apache CXF and a method that has a POJO parameter
body: <p>I have the following login service interface:</p>
  
  <pre class="lang-java prettyprint-override"><code>@Path("/loginService/")
  @WebService(serviceName = "LoginService", name = "LoginService", targetNamespace = "http://ws.test.com")
  public interface LoginService {
      /**
       * Takes an authentication request, and returns an authentication response.
       * In the event of an authentication failure, an HTTP status of 401 should
       * be returned.
       * 
       * @param request
       * @return
       */
      @WebMethod
      @GET
      @Path("/")  
      public AuthenticationResponse login(@WebParam(name = "request") final AuthenticationRequest request);
  }
  </code></pre>
  
  <p>I have the following in my spring file</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;bean id="loginService" autowire="autodetect"
      class="com.test.mobile.webservices.authentication.LoginServiceImpl"&gt;
  &lt;/bean&gt;
  
  
  
  &lt;jaxws:endpoint id="LoginServiceEndpoint"
                  serviceName="LoginService"
                  implementorClass="com.test.mobile.webservices.authentication.LoginService"
                  implementor="#loginService"
                  address="/loginService"&gt;
      &lt;jaxws:serviceFactory&gt;
          &lt;ref bean="jaxws-and-aegis-service-factory"/&gt;
      &lt;/jaxws:serviceFactory&gt;
  &lt;/jaxws:endpoint&gt;
  </code></pre>
  
  <p>When I attempt to hit the following URL:</p>
  
  <pre><code>http://localhost:8080/TPCMobileWS/api/rest/loginService?wsdl
  </code></pre>
  
  <p>I get the following message:</p>
  
  <blockquote>
    <p>JAXBException occurred : Unexpected EOF in prolog  at [row,col
    {unknown-source}]: [1,0]. Unexpected EOF in prolog  at [row,col
    {unknown-source}]: [1,0].</p>
  </blockquote>
  
  <p>If I remove completely the "request" parameter in the login method, the URL hit above works just fine... no error, shows the right data.</p>
  
  <p>What am I doing wrong when passing that POJO?  It just has a couple primitive types in it with getters and setters.   Am I missing some annotations?</p>
  
  <p>Your help is MUCH appreciated!</p>
  
  <p>Below is the Authentication Request:</p>
  
  <pre class="lang-java prettyprint-override"><code>package com.test.mobile.webservices.authentication;
  
  import java.io.Serializable;
  
  import javax.xml.bind.annotation.XmlRootElement;
  
  import com.test.mobile.webservices.Localization;
  
  @XmlRootElement
  public class AuthenticationRequest implements Serializable {
  
      private static final long serialVersionUID = 1L;
  
      private String username;
      private Localization.Country country;
      private String password;
  
      public AuthenticationRequest() {
  
      }
  
      /**
       * For now, this is the consultant's ID.
       * 
       * @return
       */
      public String getUsername() {
          return username;
      }
  
      public void setUsername(String username) {
          this.username = username;
      }
  
      /**
       * The country that the consultant is associated with, as a two letter ISO
       * country code.
       * 
       * @return
       */
      public Localization.Country getCountryCode() {
          return country;
      }
  
      public void setCountryCode(Localization.Country country) {
          this.country = country;
      }
  
      /**
       * The consultant's password.
       * 
       * @return
       */
      public String getPassword() {
          return password;
      }
  
      public void setPassword(String password) {
          this.password = password;
      }
  
  }
  </code></pre>