title: SOAP HTTPS Testing getting a class cast exception (String to Integer)
body: <p>I am testing a SOAP request using a standalone application over HTTPS. I have the required classes created from WSDL (using wsimport), I have populated the object values using some mock values. </p>
  
  <p>Surprisingly all my XML values are in String, but I get a class cast exception as "String to Integer"</p>
  
  <p><strong>Client Code</strong></p>
  
  <pre><code>EWOProviderWSEWOWsdl ewoProvider = new EWOProviderWSEWOWsdl();
  EWOWsdlPortType servicePort = ewoProvider.getEWOProviderWSEWOWsdlPort();
  
  BindingProvider bindingProvider = (BindingProvider) servicePort;
  Map&lt;String, Object&gt; requestContext = bindingProvider
              .getRequestContext();
  
  // Target End Point URL is set in the context here
  requestContext
          .put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
                      "https://MY Url where WSDL is deployed");
  
  // Timeouts in milliseconds
  requestContext.put("com.sun.xml.internal.ws.request.timeout", "25000");
  requestContext.put("com.sun.xml.internal.ws.connect.timeout", "15000");
  
  // Credentials are set in over here
  Map&lt;String, List&lt;String&gt;&gt; headers = new HashMap&lt;String, List&lt;String&gt;&gt;();
  headers.put("Username", Collections.singletonList("UserName"));
  headers.put("Password", Collections.singletonList("Password"));
  requestContext.put(MessageContext.HTTP_REQUEST_HEADERS, headers);
  System.setProperty("proxySet", "true");
  System.setProperty("proxyPort", "80");
  System.setProperty("proxyHost", "myproxy_host");
  
  JAXBElement&lt;EWOOrders&gt; ewoOrders = generateWSRequestObject();
  
  String generatedXml = generateXmlRequestForProgistix(ewoOrders);
  System.out.println("XML &gt;&gt; " + generatedXml);
  
  DocTypeRefStatusMessageResponse responseMessage = servicePort
      .postEWOOrder(ewoOrders.getValue());
  </code></pre>
  
  <p><strong>Exception Message</strong></p>
  
  <pre><code>Exception in thread "main" com.sun.xml.internal.ws.client.ClientTransportException: HTTP transport error: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer
      at com.sun.xml.internal.ws.transport.http.client.HttpClientTransport.getOutput(HttpClientTransport.java:117)
      at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:194)
      at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:122)
      at com.sun.xml.internal.ws.transport.DeferredTransportPipe.processRequest(DeferredTransportPipe.java:123)
      at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:626)
      at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:585)
      at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:570)
      at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:467)
      at com.sun.xml.internal.ws.client.Stub.process(Stub.java:308)
      at com.sun.xml.internal.ws.client.sei.SEIStub.doProcess(SEIStub.java:163)
      at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:98)
      at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:78)
      at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:135)
      at com.sun.proxy.$Proxy24.postEWOOrder(Unknown Source)
      at com.test.TestMain.main(TestMain.java:99)
  Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer
      at com.sun.xml.internal.ws.transport.http.client.HttpClientTransport.createHttpConnection(HttpClientTransport.java:263)
      at com.sun.xml.internal.ws.transport.http.client.HttpClientTransport.getOutput(HttpClientTransport.java:102)
      ... 14 more
  </code></pre>