title: Server did not recognize the value of HTTP Header SOAPAction:
body: <p>I'm trying to call a SOAP webservice using SAAJ for this WSDL. I submitted the request for this WSDL here <code>http://www.webservicex.net/ws/WSDetails.aspx?WSID=64</code>and it generated the following SOAP requests..</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"&gt;
    &lt;soap:Body&gt;
      &lt;GetGeoIP xmlns="http://www.webservicex.net/"&gt;
        &lt;IPAddress&gt;string&lt;/IPAddress&gt;
      &lt;/GetGeoIP&gt;
    &lt;/soap:Body&gt;
  &lt;/soap:Envelope&gt;
  </code></pre>
  
  <p>Using SAAJ I generated the same SOAP requests and submitted it but get this error - Server did not recognize the value of HTTP Header SOAPAction: .</p>
  
  <pre><code>&lt;SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;&lt;SOAP-ENV:Header/&gt;
  &lt;SOAP-ENV:Body&gt;
  &lt;GetGeoIP xmlns="http://www.webservicex.net/"&gt;
  &lt;IPAddress&gt;SUNW&lt;/IPAddress&gt;
  &lt;/GetGeoIP&gt;
  &lt;/SOAP-ENV:Body&gt;
  &lt;/SOAP-ENV:Envelope&gt;
  </code></pre>
  
  <p>Java Code:</p>
  
  <pre><code>package newpackage;
  
  import javax.xml.namespace.QName;
  import javax.xml.soap.*;
  
  public class SOAPClientSAAJ {
  
      public static void main(String args[]) throws Exception {
          // Create SOAP Connection
          SOAPConnectionFactory soapConnectionFactory = SOAPConnectionFactory.newInstance();
          SOAPConnection soapConnection = soapConnectionFactory.createConnection();
  
          // Send SOAP Message to SOAP Server
          String url = "http://www.webservicex.net/geoipservice.asmx";
          SOAPMessage soapResponse = soapConnection.call(createSOAPRequest(), url);
  
          // print SOAP Response
          System.out.print("Response SOAP Message:");
          soapResponse.writeTo(System.out);
  
          soapConnection.close();
      }
  
      private static SOAPMessage createSOAPRequest() throws Exception {
          MessageFactory messageFactory = MessageFactory.newInstance();
          SOAPMessage soapMessage = messageFactory.createMessage();
          SOAPPart soapPart = soapMessage.getSOAPPart();
  
          String serverURI = "http://www.w3.org/2001/XMLSchema";
  
          // SOAP Envelope
          SOAPEnvelope envelope = soapPart.getEnvelope();
          envelope.addNamespaceDeclaration("xsd", serverURI);
  
          SOAPBody body = soapMessage.getSOAPBody();
          QName bodyName = new QName("http://www.webservicex.net/", "GetGeoIP" );
          SOAPBodyElement bodyElement = body.addBodyElement(bodyName);
          QName name = new QName("IPAddress");
          SOAPElement symbol = bodyElement.addChildElement(name);
          symbol.addTextNode("SUNW");
          soapMessage.saveChanges();
  
          /* Print the request message */
          System.out.print("Request SOAP Message:");
          soapMessage.writeTo(System.out);
          System.out.println();
  
          return soapMessage;
      }
  
  }
  </code></pre>