title: SOAPFAULTEXCEPTION while trying to consume a webservice
body: <p>I have been experimenting a bit with web service when I stumbled on a situation. The relevant details are:</p>
  
  <ul>
  <li>I am using eclipse,cxf and tomcat.</li>
  <li>I created a simple web service which prints hello. It does not have any arguments in its method. When I call this web service from a client everything works fine. </li>
  <li>But, when I create a web service with arguments in the method, I am getting a weird exception:</li>
  </ul>
  
  <blockquote>
    <p>Exception in thread "main" javax.xml.ws.soap.SOAPFaultException:
    Unmarshalling Error: unexpected element (uri:"----", local:"loginid").
    Expected elements are
    &lt;{}tokenstring>,&lt;{}devicetype>,&lt;{}loginid>,&lt;{}password>,&lt;{}deviceid> 
      at
    org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:157)
      at $Proxy29.getUserInformation(Unknown Source)  at
    servicepackage.ServiceClassPortType_ServiceClassPort_Client.main(ServiceClassPortType_ServiceClassPort_Client.java:71)
    Caused by: org.apache.cxf.binding.soap.SoapFault: Unmarshalling Error:
    unexpected element (uri:"----", local:"loginid"). Expected elements
    are
    &lt;{}tokenstring>,&lt;{}devicetype>,&lt;{}loginid>,&lt;{}password>,&lt;{}deviceid> 
      at
    org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.unmarshalFault(Soap11FaultInInterceptor.java:84)
      at
    org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:51)
      at
    org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:40)
      at
    org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272)
      at
    org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:113)
      at
    org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:69)
      at
    org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:34)
      at
    org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272)
      at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:835)
      at
    org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1606)
      at
    org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1502)
      at
    org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1309)
      at
    org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
      at
    org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:627)
      at
    org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
      at
    org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272)
      at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:565)
      at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:474)   at
    org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:377)    at
    org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:330)    at
    org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
      at
    org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:135)
      ... 2 more</p>
  </blockquote>
  
  <p>Can someone tell me what is happening and what should I do to solve this issue ? Thanks.</p>