1

We have received the following WSDL from a Salesforce org.

   <?xml version="1.0" encoding="utf-8"?>
<definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://soap.sforce.com/schemas/class/IndigoDocument" targetNamespace="http://soap.sforce.com/schemas/class/IndigoDocument" xmlns="http://schemas.xmlsoap.org/wsdl/">
  <types>
    <xsd:schema elementFormDefault="qualified" targetNamespace="http://soap.sforce.com/schemas/class/IndigoDocument">
      <xsd:element name="DebuggingInfo">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element name="debugLog" type="xsd:string" />
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
      <xsd:simpleType name="ID">
        <xsd:restriction base="xsd:string">
          <xsd:length value="18" />
          <xsd:pattern value="[a-zA-Z0-9]{18}" />
        </xsd:restriction>
      </xsd:simpleType>
      <xsd:simpleType name="LogCategory">
        <xsd:restriction base="xsd:string">
          <xsd:enumeration value="Db" />
          <xsd:enumeration value="Workflow" />
          <xsd:enumeration value="Validation" />
          <xsd:enumeration value="Callout" />
          <xsd:enumeration value="Apex_code" />
          <xsd:enumeration value="Apex_profiling" />
          <xsd:enumeration value="Visualforce" />
          <xsd:enumeration value="System" />
          <xsd:enumeration value="All" />
        </xsd:restriction>
      </xsd:simpleType>
      <xsd:simpleType name="LogCategoryLevel">
        <xsd:restriction base="xsd:string">
          <xsd:enumeration value="Internal" />
          <xsd:enumeration value="Finest" />
          <xsd:enumeration value="Finer" />
          <xsd:enumeration value="Fine" />
          <xsd:enumeration value="Debug" />
          <xsd:enumeration value="Info" />
          <xsd:enumeration value="Warn" />
          <xsd:enumeration value="Error" />
        </xsd:restriction>
      </xsd:simpleType>
      <xsd:complexType name="LogInfo">
        <xsd:sequence>
          <xsd:element name="category" type="tns:LogCategory" />
          <xsd:element name="level" type="tns:LogCategoryLevel" />
        </xsd:sequence>
      </xsd:complexType>
      <xsd:simpleType name="LogType">
        <xsd:restriction base="xsd:string">
          <xsd:enumeration value="None" />
          <xsd:enumeration value="Debugonly" />
          <xsd:enumeration value="Db" />
          <xsd:enumeration value="Profiling" />
          <xsd:enumeration value="Callout" />
          <xsd:enumeration value="Detail" />
        </xsd:restriction>
      </xsd:simpleType>
      <xsd:element name="DebuggingHeader">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element minOccurs="0" maxOccurs="unbounded" name="categories" type="tns:LogInfo" />
            <xsd:element name="debugLevel" type="tns:LogType" />
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
      <xsd:element name="CallOptions">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element name="client" type="xsd:string" />
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
      <xsd:element name="SessionHeader">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element name="sessionId" type="xsd:string" />
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
      <xsd:element name="AllowFieldTruncationHeader">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element name="allowFieldTruncation" type="xsd:boolean" />
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
      <xsd:complexType name="Indigo">
        <xsd:sequence>
          <xsd:element minOccurs="0" name="AccountID" nillable="true" type="xsd:string" />
          <xsd:element minOccurs="0" name="DocumentDate" nillable="true" type="xsd:string" />
          <xsd:element minOccurs="0" name="DocumentID" nillable="true" type="xsd:string" />
          <xsd:element minOccurs="0" name="DocumentPath" nillable="true" type="xsd:string" />
          <xsd:element minOccurs="0" name="DocumentType" nillable="true" type="xsd:string" />
          <xsd:element minOccurs="0" name="DocumentURL" nillable="true" type="xsd:string" />
          <xsd:element minOccurs="0" name="IndexedBy" nillable="true" type="xsd:string" />
          <xsd:element minOccurs="0" name="Name" nillable="true" type="xsd:string" />
        </xsd:sequence>
      </xsd:complexType>
      <xsd:element name="createDocument">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element name="myDoc" nillable="true" type="tns:Indigo" />
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
      <xsd:element name="createDocumentResponse">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element name="result" nillable="true" type="xsd:string" />
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
    </xsd:schema>
  </types>
  <message name="Header">
    <part name="AllowFieldTruncationHeader" element="tns:AllowFieldTruncationHeader" />
    <part name="CallOptions" element="tns:CallOptions" />
    <part name="DebuggingHeader" element="tns:DebuggingHeader" />
    <part name="DebuggingInfo" element="tns:DebuggingInfo" />
    <part name="SessionHeader" element="tns:SessionHeader" />
  </message>
  <message name="createDocumentRequest">
    <part name="parameters" element="tns:createDocument" />
  </message>
  <message name="createDocumentResponse">
    <part name="parameters" element="tns:createDocumentResponse" />
  </message>
  <portType name="IndigoDocumentPortType">
    <operation name="createDocument">
      <input message="tns:createDocumentRequest" />
      <output message="tns:createDocumentResponse" />
    </operation>
  </portType>
  <binding name="IndigoDocumentBinding" type="tns:IndigoDocumentPortType">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
    <operation name="createDocument">
      <soap:operation soapAction="" />
      <input>
        <soap:header message="tns:Header" part="SessionHeader" use="literal" />
        <soap:header message="tns:Header" part="CallOptions" use="literal" />
        <soap:header message="tns:Header" part="DebuggingHeader" use="literal" />
        <soap:header message="tns:Header" part="AllowFieldTruncationHeader" use="literal" />
        <soap:body use="literal" parts="parameters" />
      </input>
      <output>
        <soap:header message="tns:Header" part="DebuggingInfo" use="literal" />
        <soap:body use="literal" />
      </output>
    </operation>
  </binding>
  <service name="IndigoDocumentService">
    <documentation>
    </documentation>
    <port name="IndigoDocument" binding="tns:IndigoDocumentBinding">
      <soap:address location="https://ap1.salesforce.com/services/Soap/class/IndigoDocument" />
    </port>
  </service>
</definitions>

I would like to test this WSDL via a SOAP UI first.

When I imported this WSDL for testing in SOAP UI I do not know what should I put for "Session Id" element.

enter image description here

Can someone help ?

UPDATE

Using the inbuilt WSDL parsing utility I was able to create two classes and they are as follows.

Class 1

//Generated by wsdl2apex

public class soapSforceComSchemasClassIndigodocu {
    public class Indigo {
        public String AccountID;
        public String DocumentDate;
        public String DocumentID;
        public String DocumentPath;
        public String DocumentType;
        public String DocumentURL;
        public String IndexedBy;
        public String Name;
        private String[] AccountID_type_info = new String[]{'AccountID','http://soap.sforce.com/schemas/class/IndigoDocument',null,'0','1','true'};
        private String[] DocumentDate_type_info = new String[]{'DocumentDate','http://soap.sforce.com/schemas/class/IndigoDocument',null,'0','1','true'};
        private String[] DocumentID_type_info = new String[]{'DocumentID','http://soap.sforce.com/schemas/class/IndigoDocument',null,'0','1','true'};
        private String[] DocumentPath_type_info = new String[]{'DocumentPath','http://soap.sforce.com/schemas/class/IndigoDocument',null,'0','1','true'};
        private String[] DocumentType_type_info = new String[]{'DocumentType','http://soap.sforce.com/schemas/class/IndigoDocument',null,'0','1','true'};
        private String[] DocumentURL_type_info = new String[]{'DocumentURL','http://soap.sforce.com/schemas/class/IndigoDocument',null,'0','1','true'};
        private String[] IndexedBy_type_info = new String[]{'IndexedBy','http://soap.sforce.com/schemas/class/IndigoDocument',null,'0','1','true'};
        private String[] Name_type_info = new String[]{'Name','http://soap.sforce.com/schemas/class/IndigoDocument',null,'0','1','true'};
        private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/schemas/class/IndigoDocument','true','false'};
        private String[] field_order_type_info = new String[]{'AccountID','DocumentDate','DocumentID','DocumentPath','DocumentType','DocumentURL','IndexedBy','Name'};
    }
    public class createDocument_element {
        public soapSforceComSchemasClassIndigodocu.Indigo myDoc;
        private String[] myDoc_type_info = new String[]{'myDoc','http://soap.sforce.com/schemas/class/IndigoDocument',null,'1','1','true'};
        private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/schemas/class/IndigoDocument','true','false'};
        private String[] field_order_type_info = new String[]{'myDoc'};
    }
    public class DebuggingInfo_element {
        public String debugLog;
        private String[] debugLog_type_info = new String[]{'debugLog','http://soap.sforce.com/schemas/class/IndigoDocument',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/schemas/class/IndigoDocument','true','false'};
        private String[] field_order_type_info = new String[]{'debugLog'};
    }
    public class LogInfo {
        public String category;
        public String level;
        private String[] category_type_info = new String[]{'category','http://soap.sforce.com/schemas/class/IndigoDocument',null,'1','1','false'};
        private String[] level_type_info = new String[]{'level','http://soap.sforce.com/schemas/class/IndigoDocument',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/schemas/class/IndigoDocument','true','false'};
        private String[] field_order_type_info = new String[]{'category','level'};
    }
    public class SessionHeader_element {
        public String sessionId;
        private String[] sessionId_type_info = new String[]{'sessionId','http://soap.sforce.com/schemas/class/IndigoDocument',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/schemas/class/IndigoDocument','true','false'};
        private String[] field_order_type_info = new String[]{'sessionId'};
    }
    public class CallOptions_element {
        public String client;
        private String[] client_type_info = new String[]{'client','http://soap.sforce.com/schemas/class/IndigoDocument',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/schemas/class/IndigoDocument','true','false'};
        private String[] field_order_type_info = new String[]{'client'};
    }
    public class DebuggingHeader_element {
        public soapSforceComSchemasClassIndigodocu.LogInfo[] categories;
        public String debugLevel;
        private String[] categories_type_info = new String[]{'categories','http://soap.sforce.com/schemas/class/IndigoDocument',null,'0','-1','false'};
        private String[] debugLevel_type_info = new String[]{'debugLevel','http://soap.sforce.com/schemas/class/IndigoDocument',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/schemas/class/IndigoDocument','true','false'};
        private String[] field_order_type_info = new String[]{'categories','debugLevel'};
    }
    public class createDocumentResponse_element {
        public String result;
        private String[] result_type_info = new String[]{'result','http://soap.sforce.com/schemas/class/IndigoDocument',null,'1','1','true'};
        private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/schemas/class/IndigoDocument','true','false'};
        private String[] field_order_type_info = new String[]{'result'};
    }
    public class AllowFieldTruncationHeader_element {
        public Boolean allowFieldTruncation;
        private String[] allowFieldTruncation_type_info = new String[]{'allowFieldTruncation','http://soap.sforce.com/schemas/class/IndigoDocument',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/schemas/class/IndigoDocument','true','false'};
        private String[] field_order_type_info = new String[]{'allowFieldTruncation'};
    }
    public class IndigoDocument {
        public String endpoint_x = 'https://ap1.salesforce.com/services/Soap/class/IndigoDocument';
        public Map<String,String> inputHttpHeaders_x;
        public Map<String,String> outputHttpHeaders_x;
        public String clientCertName_x;
        public String clientCert_x;
        public String clientCertPasswd_x;
        public Integer timeout_x;
        public soapSforceComSchemasClassIndigodocu.AllowFieldTruncationHeader_element AllowFieldTruncationHeader;
        public soapSforceComSchemasClassIndigodocu.DebuggingInfo_element DebuggingInfo;
        public soapSforceComSchemasClassIndigodocu.DebuggingHeader_element DebuggingHeader;
        public soapSforceComSchemasClassIndigodocu.SessionHeader_element SessionHeader;
        public soapSforceComSchemasClassIndigodocu.CallOptions_element CallOptions;
        private String AllowFieldTruncationHeader_hns = 'AllowFieldTruncationHeader=http://soap.sforce.com/schemas/class/IndigoDocument';
        private String DebuggingInfo_hns = 'DebuggingInfo=http://soap.sforce.com/schemas/class/IndigoDocument';
        private String DebuggingHeader_hns = 'DebuggingHeader=http://soap.sforce.com/schemas/class/IndigoDocument';
        private String SessionHeader_hns = 'SessionHeader=http://soap.sforce.com/schemas/class/IndigoDocument';
        private String CallOptions_hns = 'CallOptions=http://soap.sforce.com/schemas/class/IndigoDocument';
        private String[] ns_map_type_info = new String[]{'http://soap.sforce.com/schemas/class/IndigoDocument', 'soapSforceComSchemasClassIndigodocu'};
        public String createDocument(soapSforceComSchemasClassIndigodocu.Indigo myDoc) {
            soapSforceComSchemasClassIndigodocu.createDocument_element request_x = new soapSforceComSchemasClassIndigodocu.createDocument_element();
            request_x.myDoc = myDoc;
            soapSforceComSchemasClassIndigodocu.createDocumentResponse_element response_x;
            Map<String, soapSforceComSchemasClassIndigodocu.createDocumentResponse_element> response_map_x = new Map<String, soapSforceComSchemasClassIndigodocu.createDocumentResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              '',
              'http://soap.sforce.com/schemas/class/IndigoDocument',
              'createDocument',
              'http://soap.sforce.com/schemas/class/IndigoDocument',
              'createDocumentResponse',
              'soapSforceComSchemasClassIndigodocu.createDocumentResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.result;
        }
    }
}

Class 2

//Generated by wsdl2apex

public class AsyncSoapSforceComSchemasClassIndigodocu {
    public class createDocumentResponse_elementFuture extends System.WebServiceCalloutFuture {
        public String getValue() {
            soapSforceComSchemasClassIndigodocu.createDocumentResponse_element response = (soapSforceComSchemasClassIndigodocu.createDocumentResponse_element)System.WebServiceCallout.endInvoke(this);
            return response.result;
        }
    }
    public class AsyncIndigoDocument {
        public String endpoint_x = 'https://ap1.salesforce.com/services/Soap/class/IndigoDocument';
        public Map<String,String> inputHttpHeaders_x;
        public String clientCertName_x;
        public Integer timeout_x;
        public soapSforceComSchemasClassIndigodocu.AllowFieldTruncationHeader_element AllowFieldTruncationHeader;
        public soapSforceComSchemasClassIndigodocu.DebuggingInfo_element DebuggingInfo;
        public soapSforceComSchemasClassIndigodocu.DebuggingHeader_element DebuggingHeader;
        public soapSforceComSchemasClassIndigodocu.SessionHeader_element SessionHeader;
        public soapSforceComSchemasClassIndigodocu.CallOptions_element CallOptions;
        private String AllowFieldTruncationHeader_hns = 'AllowFieldTruncationHeader=http://soap.sforce.com/schemas/class/IndigoDocument';
        private String DebuggingInfo_hns = 'DebuggingInfo=http://soap.sforce.com/schemas/class/IndigoDocument';
        private String DebuggingHeader_hns = 'DebuggingHeader=http://soap.sforce.com/schemas/class/IndigoDocument';
        private String SessionHeader_hns = 'SessionHeader=http://soap.sforce.com/schemas/class/IndigoDocument';
        private String CallOptions_hns = 'CallOptions=http://soap.sforce.com/schemas/class/IndigoDocument';
        private String[] ns_map_type_info = new String[]{'http://soap.sforce.com/schemas/class/IndigoDocument', 'soapSforceComSchemasClassIndigodocu'};
        public AsyncSoapSforceComSchemasClassIndigodocu.createDocumentResponse_elementFuture beginCreateDocument(System.Continuation continuation,soapSforceComSchemasClassIndigodocu.Indigo myDoc) {
            soapSforceComSchemasClassIndigodocu.createDocument_element request_x = new soapSforceComSchemasClassIndigodocu.createDocument_element();
            request_x.myDoc = myDoc;
            return (AsyncSoapSforceComSchemasClassIndigodocu.createDocumentResponse_elementFuture) System.WebServiceCallout.beginInvoke(
              this,
              request_x,
              AsyncSoapSforceComSchemasClassIndigodocu.createDocumentResponse_elementFuture.class,
              continuation,
              new String[]{endpoint_x,
              '',
              'http://soap.sforce.com/schemas/class/IndigoDocument',
              'createDocument',
              'http://soap.sforce.com/schemas/class/IndigoDocument',
              'createDocumentResponse',
              'soapSforceComSchemasClassIndigodocu.createDocumentResponse_element'}
            );
        }
    }
}

1 Answer 1

3

Session ID is the ID returned after you log in, it is used for authentication.

Use the login() call to obtain this, as documented here and here

This SFSE question may also shed some more light on the matter.

You can view the SOAP WSDL for your org. at this URL: https://node.salesforce.com/soap/wsdl.jsp

3
  • Thanks David for your inputs. I have updated my question with the two classes that got generated when I imported the WSDL in my developer org. But I do not see the login() call method in anyone of these two classes. Can you take a look ?
    – Rainmaker
    Commented Feb 15, 2016 at 0:47
  • I have updated my answer with the URL for the SOAP WSDL. You need to download this and import it into the application that's trying to integrate with SFDC. I'm not sure what WSDL file you've received but it doesn't appear to be complete. Commented Feb 15, 2016 at 8:16
  • 1
    @Rainmaker It looks like you are using a WSDL generated from the Apex class IndigoDocument. As Davin mentions in his answer. You will need to use the Partner API separately to get the login() method. Commented Feb 16, 2016 at 1:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .