title: Getting null value in the response from a soap service
body: <p>I'm trying to call a soap service. I did't get any exception but response contains null value. But service atleast returns error message. please find or guide any solution. </p>
  
  <pre><code>@Component("createCardServiceImpl")
  public class CreateCardServiceImpl implements CreateCardService {
  
      private static final ObjectFactory WS_CLIENT_FACTORY = new ObjectFactory();
  
      private WebServiceTemplate webServiceTemplate;
  
      @Autowired
      public void YourServiceClient(WebServiceTemplate webServiceTemplate) {
          this.webServiceTemplate = webServiceTemplate;
      }
      @Override
      public FVCardUpdateResponse createUpdateCardRequest(FVCardUpdateRequest fvCardUpdateRequest) {
          FVCardUpdateResponse fvCardUpdateResponse=new FVCardUpdateResponse();
          try{
          FVCardUpdateRequest request = WS_CLIENT_FACTORY.createFVCardUpdateRequest();    
  
          request=fvCardUpdateRequest;
          SoapActionCallback actionCallBack = new SoapActionCallback("https://www.sampleService/Selfservice.asmx") {
              public void doWithMessage(WebServiceMessage msg) {
                  SoapMessage smsg = (SoapMessage)msg;                
                  SoapHeader soapHeader = smsg.getSoapHeader();
  
                  try{
                      StringSource headerSource = new StringSource("&lt;UserCredentials xmlns='http://www.corecard.com/Prepaid'&gt;\n" +
                              "&lt;userid&gt;"+"srihari"+"&lt;/userid&gt;\n" +
                              "&lt;password&gt;"+"srihari123"+"&lt;/password&gt;\n" +
                              "&lt;/UserCredentials&gt;");
                      Transformer transformer = TransformerFactory.newInstance().newTransformer();
                      transformer.transform(headerSource, soapHeader.getResult());
  
                      smsg.setSoapAction("http://www.sampleservice/CardUpdate");
                  }catch(Exception e)
                  {
                      e.printStackTrace();
                  }
              }
          };
          fvCardUpdateResponse = (FVCardUpdateResponse) webServiceTemplate.marshalSendAndReceive("https://www.sampleService/Selfservice.asmx", request, actionCallBack);
  
          System.out.println("source "+fvCardUpdateResponse);
  
          }catch (SoapFaultClientException e) {
  
              System.out.println("fault code "+e.getFaultCode());
              System.out.println("fault string "+e.getFaultStringOrReason());
              System.out.println("stack trace "+e.fillInStackTrace().getLocalizedMessage());
              e.printStackTrace();
          } catch (WebServiceIOException we) {
              System.out.println("In web service IO Exception "+we.getRootCause());
              we.printStackTrace();
          } catch (Exception e) {
              e.printStackTrace();
          }
  
          return fvCardUpdateResponse;
      }
  
  }
  </code></pre>
  
  <p>This is my Objec tFactory  class</p>
  
  <pre><code>@XmlRegistry
  public class ObjectFactory {
  
      public ObjectFactory() {
      }
  
      public FVCardUpdateRequest createFVCardUpdateRequest() {
  
          return new FVCardUpdateRequest();
      }
  
      public FVCardUpdateResponse createFVCardUpdateResponse()
      {
          return new FVCardUpdateResponse();
      }
  }
  </code></pre>
  
  <p>This is my request class</p>
  
  <pre><code>@XmlAccessorType(XmlAccessType.FIELD)
  @XmlType(name = "CARDUPDATE",propOrder={"CLIENTID","CARDNUMBER","FIRSTNAME"})
  
  @XmlRootElement(name = "CARDUPDATE")
  public class FVCardUpdateRequest {
  
      @XmlElement(name = "CLIENTID")
      private String CLIENTID;
  
      @XmlElement(name = "CARDNUMBER")
      private String CARDNUMBER;
      //Other  setters and getters
  }
  </code></pre>
  
  <p>This is my response class</p>
  
  <pre><code>@XmlAccessorType(XmlAccessType.FIELD)
  @XmlType(name = "CardUpdateResponse",propOrder={"CARDUPDATE_RET"})
  @XmlRootElement(name = "CardUpdateResponse",namespace="http://www.sampleurl.com/Prepaid")
  public class FVCardUpdateResponse {
  
      @XmlElement(name="CARDUPDATE_RET")
      private CARDUPDATE_RET  CARDUPDATE_RET; 
     //Setters and getters
  }
  
  @XmlAccessorType(XmlAccessType.FIELD)
  @XmlType(name = "CARDUPDATE_RET", propOrder = {
      "ResErrorMsg",
      "ResErrorCode",
      "ResCode",
      "AccountNumber"
  })
  
      public class CARDUPDATE_RET {
  
          @XmlElement(name = "AccountNumber")
          private String AccountNumber;
  
          @XmlElement(name = "ResCode")
          private String ResCode;
  
          @XmlElement(name = "ResErrorCode")
          private String ResErrorCode;
  
          @XmlElement(name = "ResErrorMsg")
          private String ResErrorMsg;
      }
  </code></pre>
  
  <p>This is my exaple xml response:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;CardUpdateResponse xmlns="http://www.sampleurl.com/Prepaid"&gt;
      &lt;CARDUPDATE_RET&gt;
          &lt;ResErrorMsg&gt;Card Updated Successfully&lt;/ResErrorMsg&gt;
          &lt;ResErrorCode&gt;Msgcu01&lt;/ResErrorCode&gt;
          &lt;ResCode&gt;1&lt;/ResCode&gt;
          &lt;ACCOUNTNUMBER&gt;2000000003918246&lt;/ACCOUNTNUMBER&gt;
      &lt;/CARDUPDATE_RET&gt;
  &lt;/CardUpdateResponse&gt;
  </code></pre>