title: Web service client given WSDL
body: <p>I am trying to create a web service client in Java. I am not aware of how to do it. This is a URL for WSDL: <a href="https://testservices.gatewayedi.com/PayerList/payerlist.asmx?wsdl" rel="noreferrer">https://testservices.gatewayedi.com/PayerList/payerlist.asmx?wsdl</a></p>
  
  <p>This is the WSDL:</p>
  
  <pre><code>&lt;wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="https://ws.gatewayedi.com/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="https://ws.gatewayedi.com/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"&gt;
    &lt;wsdl:types&gt;
      &lt;s:schema elementFormDefault="qualified" targetNamespace="https://ws.gatewayedi.com/"&gt;
        &lt;s:element name="Ping"&gt;
          &lt;s:complexType /&gt;
        &lt;/s:element&gt;
        &lt;s:element name="PingResponse"&gt;
          &lt;s:complexType&gt;
            &lt;s:sequence&gt;
              &lt;s:element minOccurs="0" maxOccurs="1" name="PingResult" type="s:string" /&gt;
            &lt;/s:sequence&gt;
          &lt;/s:complexType&gt;
        &lt;/s:element&gt;
        &lt;s:element name="AuthSOAPHeader" type="tns:AuthSOAPHeader" /&gt;
        &lt;s:complexType name="AuthSOAPHeader"&gt;
          &lt;s:sequence&gt;
            &lt;s:element minOccurs="0" maxOccurs="1" name="User" type="s:string" /&gt;
            &lt;s:element minOccurs="0" maxOccurs="1" name="Password" type="s:string" /&gt;
          &lt;/s:sequence&gt;
          &lt;s:anyAttribute /&gt;
        &lt;/s:complexType&gt;
        &lt;s:element name="GetXMLPayerList"&gt;
          &lt;s:complexType /&gt;
        &lt;/s:element&gt;
        &lt;s:element name="GetXMLPayerListResponse"&gt;
          &lt;s:complexType&gt;
            &lt;s:sequence&gt;
              &lt;s:element minOccurs="0" maxOccurs="1" name="GetXMLPayerListResult" type="s:string" /&gt;
            &lt;/s:sequence&gt;
          &lt;/s:complexType&gt;
        &lt;/s:element&gt;
        &lt;s:element name="getDocLinks"&gt;
          &lt;s:complexType&gt;
            &lt;s:sequence&gt;
              &lt;s:element minOccurs="0" maxOccurs="1" name="pid" type="s:string" /&gt;
            &lt;/s:sequence&gt;
          &lt;/s:complexType&gt;
        &lt;/s:element&gt;
        &lt;s:element name="getDocLinksResponse"&gt;
          &lt;s:complexType&gt;
            &lt;s:sequence&gt;
              &lt;s:element minOccurs="0" maxOccurs="1" name="getDocLinksResult" type="s:string" /&gt;
            &lt;/s:sequence&gt;
          &lt;/s:complexType&gt;
        &lt;/s:element&gt;
      &lt;/s:schema&gt;
    &lt;/wsdl:types&gt;
    &lt;wsdl:message name="PingSoapIn"&gt;
      &lt;wsdl:part name="parameters" element="tns:Ping" /&gt;
    &lt;/wsdl:message&gt;
    &lt;wsdl:message name="PingSoapOut"&gt;
      &lt;wsdl:part name="parameters" element="tns:PingResponse" /&gt;
    &lt;/wsdl:message&gt;
    &lt;wsdl:message name="PingAuthSOAPHeader"&gt;
      &lt;wsdl:part name="AuthSOAPHeader" element="tns:AuthSOAPHeader" /&gt;
    &lt;/wsdl:message&gt;
    &lt;wsdl:message name="GetXMLPayerListSoapIn"&gt;
      &lt;wsdl:part name="parameters" element="tns:GetXMLPayerList" /&gt;
    &lt;/wsdl:message&gt;
    &lt;wsdl:message name="GetXMLPayerListSoapOut"&gt;
      &lt;wsdl:part name="parameters" element="tns:GetXMLPayerListResponse" /&gt;
    &lt;/wsdl:message&gt;
    &lt;wsdl:message name="GetXMLPayerListAuthSOAPHeader"&gt;
      &lt;wsdl:part name="AuthSOAPHeader" element="tns:AuthSOAPHeader" /&gt;
    &lt;/wsdl:message&gt;
    &lt;wsdl:message name="getDocLinksSoapIn"&gt;
      &lt;wsdl:part name="parameters" element="tns:getDocLinks" /&gt;
    &lt;/wsdl:message&gt;
    &lt;wsdl:message name="getDocLinksSoapOut"&gt;
      &lt;wsdl:part name="parameters" element="tns:getDocLinksResponse" /&gt;
    &lt;/wsdl:message&gt;
    &lt;wsdl:message name="getDocLinksAuthSOAPHeader"&gt;
      &lt;wsdl:part name="AuthSOAPHeader" element="tns:AuthSOAPHeader" /&gt;
    &lt;/wsdl:message&gt;
    &lt;wsdl:portType name="PayerListSoap"&gt;
      &lt;wsdl:operation name="Ping"&gt;
        &lt;wsdl:input message="tns:PingSoapIn" /&gt;
        &lt;wsdl:output message="tns:PingSoapOut" /&gt;
      &lt;/wsdl:operation&gt;
      &lt;wsdl:operation name="GetXMLPayerList"&gt;
        &lt;wsdl:input message="tns:GetXMLPayerListSoapIn" /&gt;
        &lt;wsdl:output message="tns:GetXMLPayerListSoapOut" /&gt;
      &lt;/wsdl:operation&gt;
      &lt;wsdl:operation name="getDocLinks"&gt;
        &lt;wsdl:input message="tns:getDocLinksSoapIn" /&gt;
        &lt;wsdl:output message="tns:getDocLinksSoapOut" /&gt;
      &lt;/wsdl:operation&gt;
    &lt;/wsdl:portType&gt;
    &lt;wsdl:binding name="PayerListSoap" type="tns:PayerListSoap"&gt;
      &lt;soap:binding transport="http://schemas.xmlsoap.org/soap/http" /&gt;
      &lt;wsdl:operation name="Ping"&gt;
        &lt;soap:operation soapAction="https://ws.gatewayedi.com/Ping" style="document" /&gt;
        &lt;wsdl:input&gt;
          &lt;soap:body use="literal" /&gt;
          &lt;soap:header message="tns:PingAuthSOAPHeader" part="AuthSOAPHeader" use="literal" /&gt;
        &lt;/wsdl:input&gt;
        &lt;wsdl:output&gt;
          &lt;soap:body use="literal" /&gt;
        &lt;/wsdl:output&gt;
      &lt;/wsdl:operation&gt;
      &lt;wsdl:operation name="GetXMLPayerList"&gt;
        &lt;soap:operation soapAction="https://ws.gatewayedi.com/GetXMLPayerList" style="document" /&gt;
        &lt;wsdl:input&gt;
          &lt;soap:body use="literal" /&gt;
          &lt;soap:header message="tns:GetXMLPayerListAuthSOAPHeader" part="AuthSOAPHeader" use="literal" /&gt;
        &lt;/wsdl:input&gt;
        &lt;wsdl:output&gt;
          &lt;soap:body use="literal" /&gt;
        &lt;/wsdl:output&gt;
      &lt;/wsdl:operation&gt;
      &lt;wsdl:operation name="getDocLinks"&gt;
        &lt;soap:operation soapAction="https://ws.gatewayedi.com/getDocLinks" style="document" /&gt;
        &lt;wsdl:input&gt;
          &lt;soap:body use="literal" /&gt;
          &lt;soap:header message="tns:getDocLinksAuthSOAPHeader" part="AuthSOAPHeader" use="literal" /&gt;
        &lt;/wsdl:input&gt;
        &lt;wsdl:output&gt;
          &lt;soap:body use="literal" /&gt;
        &lt;/wsdl:output&gt;
      &lt;/wsdl:operation&gt;
    &lt;/wsdl:binding&gt;
    &lt;wsdl:binding name="PayerListSoap12" type="tns:PayerListSoap"&gt;
      &lt;soap12:binding transport="http://schemas.xmlsoap.org/soap/http" /&gt;
      &lt;wsdl:operation name="Ping"&gt;
        &lt;soap12:operation soapAction="https://ws.gatewayedi.com/Ping" style="document" /&gt;
        &lt;wsdl:input&gt;
          &lt;soap12:body use="literal" /&gt;
          &lt;soap12:header message="tns:PingAuthSOAPHeader" part="AuthSOAPHeader" use="literal" /&gt;
        &lt;/wsdl:input&gt;
        &lt;wsdl:output&gt;
          &lt;soap12:body use="literal" /&gt;
        &lt;/wsdl:output&gt;
      &lt;/wsdl:operation&gt;
      &lt;wsdl:operation name="GetXMLPayerList"&gt;
        &lt;soap12:operation soapAction="https://ws.gatewayedi.com/GetXMLPayerList" style="document" /&gt;
        &lt;wsdl:input&gt;
          &lt;soap12:body use="literal" /&gt;
          &lt;soap12:header message="tns:GetXMLPayerListAuthSOAPHeader" part="AuthSOAPHeader" use="literal" /&gt;
        &lt;/wsdl:input&gt;
        &lt;wsdl:output&gt;
          &lt;soap12:body use="literal" /&gt;
        &lt;/wsdl:output&gt;
      &lt;/wsdl:operation&gt;
      &lt;wsdl:operation name="getDocLinks"&gt;
        &lt;soap12:operation soapAction="https://ws.gatewayedi.com/getDocLinks" style="document" /&gt;
        &lt;wsdl:input&gt;
          &lt;soap12:body use="literal" /&gt;
          &lt;soap12:header message="tns:getDocLinksAuthSOAPHeader" part="AuthSOAPHeader" use="literal" /&gt;
        &lt;/wsdl:input&gt;
        &lt;wsdl:output&gt;
          &lt;soap12:body use="literal" /&gt;
        &lt;/wsdl:output&gt;
      &lt;/wsdl:operation&gt;
    &lt;/wsdl:binding&gt;
    &lt;wsdl:service name="PayerList"&gt;
      &lt;wsdl:port name="PayerListSoap" binding="tns:PayerListSoap"&gt;
        &lt;soap:address location="https://testservices.gatewayedi.com/PayerList/payerlist.asmx" /&gt;
      &lt;/wsdl:port&gt;
      &lt;wsdl:port name="PayerListSoap12" binding="tns:PayerListSoap12"&gt;
        &lt;soap12:address location="https://testservices.gatewayedi.com/PayerList/payerlist.asmx" /&gt;
      &lt;/wsdl:port&gt;
    &lt;/wsdl:service&gt;
  &lt;/wsdl:definitions&gt;
  </code></pre>
  
  <p>There are three methods in the service.</p>
  
  <p>I am trying to call this method using SOAP. </p>
  
  <p>The XML message format is:</p>
  
  <pre><code>POST /PayerList/payerlist.asmx HTTP/1.1 
  Host: testservices.gatewayedi.com 
  Content-Type: application/soap+xml; charset=utf-8 
  Content-Length: &lt;&lt;insert message length here&gt;&gt; 
  &lt;?xml version="1.0" encoding="utf-8"?&gt; 
  &lt;soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"&gt; &lt;soap12:Header&gt; &lt;AuthSOAPHeader xmlns="https://ws.gatewayedi.com/"&gt; &lt;User&gt;&lt;&lt;insert user id here&gt;&gt;
  &lt;/User&gt; 
  &lt;Password&gt;&lt;&lt;insert user web password here&gt;&gt; &lt;/Password&gt; 
  &lt;/AuthSOAPHeader&gt; 
  &lt;/soap12:Header&gt; &lt;soap12:Body&gt; &lt;Ping xmlns="https://ws.gatewayedi.com/" /&gt;
   &lt;/soap12:Body&gt; 
  &lt;/soap12:Envelope&gt; 
  </code></pre>
  
  <p>Anyone who knows the solution please let me know.
  Any help is really appreciable.</p>