function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SoleesSolees 

Using Salesforce Partner WSDL to connect to Salesforce

Hello friends, i'm having an issue when trying to use the Partner WSDL to query information from account from one Salesforce ORG to another via Apex.  I'm using the WSDL2Apex to convert the XML and I get a success "Login" but i get the following error using "Query" if I use "SELECT Id, Name FROM Account" .

System.CalloutException: Web service callout failed: Unable to parse callout response. Apex type not found for element Name

The problem I think is that the next line never gets converted in Apex:
<any namespace="##targetNamespace" minOccurs="0" maxOccurs="unbounded" processContents="lax"/>

Is there a solution for this?  How can I make this less ironic? How is it possible that a Salesforce generated WSDL cannot be imported into Salesforce and work well?
Best Answer chosen by Solees
SoleesSolees
Hi Sandhya, thanks for your comment but it did not help me :( .   I've red that Salesforce WSDL is not meant to use inside Salesforce (ironicly).  So what I did is isolate in just 1 XML the login and the Account structure needed.  And that's because Salesforce needs to have the actual structure of the response Object, and that's what i did.  I know it's not the best thing to do, but it help me to do a demo.

Check it out:
 
<?xml version="1.0" encoding="UTF-8"?>
<!--
 Web Services API : ESCDEV1.SalesforceTestLoginQuery
-->
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:ens="urn:sobject.enterprise.soap.sforce.com" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="urn:enterprise.soap.sforce.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:enterprise.soap.sforce.com">
   <types>
      <xsd:schema xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="urn:sobject.enterprise.soap.sforce.com">
         <!-- Account -->
         <xsd:complexType name="Account">
            <xsd:sequence>
               <xsd:element name="Id" minOccurs="0" type="xsd:string" nillable="true" />
               <xsd:element name="Name" minOccurs="0" type="xsd:string" nillable="true" />
               <xsd:element name="AccountNumber" nillable="true" minOccurs="0" type="xsd:string" />
               <xsd:element name="AccountSource" nillable="true" minOccurs="0" type="xsd:string" />
               <xsd:element name="AnnualRevenue" nillable="true" minOccurs="0" type="xsd:double" />
               <xsd:element name="BillingCity" nillable="true" minOccurs="0" type="xsd:string" />
               <xsd:element name="BillingCountry" nillable="true" minOccurs="0" type="xsd:string" />
               <xsd:element name="BillingGeocodeAccuracy" nillable="true" minOccurs="0" type="xsd:string" />
               <xsd:element name="BillingLatitude" nillable="true" minOccurs="0" type="xsd:double" />
               <xsd:element name="BillingLongitude" nillable="true" minOccurs="0" type="xsd:double" />
               <xsd:element name="BillingPostalCode" nillable="true" minOccurs="0" type="xsd:string" />
               <xsd:element name="BillingState" nillable="true" minOccurs="0" type="xsd:string" />
               <xsd:element name="BillingStreet" nillable="true" minOccurs="0" type="xsd:string" />
               <xsd:element name="CreatedById" nillable="true" minOccurs="0" type="tns:ID" />
               <xsd:element name="CreatedDate" nillable="true" minOccurs="0" type="xsd:dateTime" />
               <xsd:element name="DandbCompanyId" nillable="true" minOccurs="0" type="tns:ID" />
               <xsd:element name="Description" nillable="true" minOccurs="0" type="xsd:string" />
               <xsd:element name="DunsNumber" nillable="true" minOccurs="0" type="xsd:string" />
               <xsd:element name="Fax" nillable="true" minOccurs="0" type="xsd:string" />
               <xsd:element name="Industry" nillable="true" minOccurs="0" type="xsd:string" />
               <xsd:element name="IsDeleted" nillable="true" minOccurs="0" type="xsd:boolean" />
               <xsd:element name="Jigsaw" nillable="true" minOccurs="0" type="xsd:string" />
               <xsd:element name="JigsawCompanyId" nillable="true" minOccurs="0" type="xsd:string" />
               <xsd:element name="LastActivityDate" nillable="true" minOccurs="0" type="xsd:date" />
               <xsd:element name="LastModifiedById" nillable="true" minOccurs="0" type="tns:ID" />
               <xsd:element name="LastModifiedDate" nillable="true" minOccurs="0" type="xsd:dateTime" />
               <xsd:element name="LastReferencedDate" nillable="true" minOccurs="0" type="xsd:dateTime" />
               <xsd:element name="LastViewedDate" nillable="true" minOccurs="0" type="xsd:dateTime" />
               <xsd:element name="NumberOfEmployees" nillable="true" minOccurs="0" type="xsd:int" />
               <xsd:element name="OwnerId" nillable="true" minOccurs="0" type="tns:ID" />
               <xsd:element name="Ownership" nillable="true" minOccurs="0" type="xsd:string" />
               <xsd:element name="ParentId" nillable="true" minOccurs="0" type="tns:ID" />
               <xsd:element name="Phone" nillable="true" minOccurs="0" type="xsd:string" />
               <xsd:element name="PhotoUrl" nillable="true" minOccurs="0" type="xsd:string" />
               <xsd:element name="Rating" nillable="true" minOccurs="0" type="xsd:string" />
               <xsd:element name="RecordTypeId" nillable="true" minOccurs="0" type="tns:ID" />
               <xsd:element name="ShippingCity" nillable="true" minOccurs="0" type="xsd:string" />
               <xsd:element name="ShippingCountry" nillable="true" minOccurs="0" type="xsd:string" />
               <xsd:element name="ShippingGeocodeAccuracy" nillable="true" minOccurs="0" type="xsd:string" />
               <xsd:element name="ShippingLatitude" nillable="true" minOccurs="0" type="xsd:double" />
               <xsd:element name="ShippingLongitude" nillable="true" minOccurs="0" type="xsd:double" />
               <xsd:element name="ShippingPostalCode" nillable="true" minOccurs="0" type="xsd:string" />
               <xsd:element name="ShippingState" nillable="true" minOccurs="0" type="xsd:string" />
               <xsd:element name="ShippingStreet" nillable="true" minOccurs="0" type="xsd:string" />
               <xsd:element name="Sic" nillable="true" minOccurs="0" type="xsd:string" />
               <xsd:element name="SicDesc" nillable="true" minOccurs="0" type="xsd:string" />
               <xsd:element name="Site" nillable="true" minOccurs="0" type="xsd:string" />
               <xsd:element name="SystemModstamp" nillable="true" minOccurs="0" type="xsd:dateTime" />
               <xsd:element name="TickerSymbol" nillable="true" minOccurs="0" type="xsd:string" />
               <xsd:element name="Tradestyle" nillable="true" minOccurs="0" type="xsd:string" />
               <xsd:element name="Type" nillable="true" minOccurs="0" type="xsd:string" />
               <xsd:element name="Website" nillable="true" minOccurs="0" type="xsd:string" />
               <xsd:element name="YearStarted" nillable="true" minOccurs="0" type="xsd:string" />
            </xsd:sequence>
         </xsd:complexType>
      </xsd:schema>
      <xsd:schema elementFormDefault="qualified" targetNamespace="urn:enterprise.soap.sforce.com">
         <!-- Our simple ID Type -->
         <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:element name="SessionHeader">
            <xsd:complexType>
               <xsd:sequence>
                  <xsd:element name="sessionId" type="xsd:string" />
               </xsd:sequence>
            </xsd:complexType>
         </xsd:element>
         <xsd:complexType name="LoginResult">
            <xsd:sequence>
               <xsd:element name="metadataServerUrl" type="xsd:string" nillable="true" />
               <xsd:element name="passwordExpired" type="xsd:boolean" />
               <xsd:element name="sandbox" type="xsd:boolean" />
               <xsd:element name="serverUrl" type="xsd:string" nillable="true" />
               <xsd:element name="sessionId" type="xsd:string" nillable="true" />
               <xsd:element name="userId" type="tns:ID" nillable="true" />
               <xsd:element name="userInfo" type="tns:GetUserInfoResult" minOccurs="0" />
            </xsd:sequence>
         </xsd:complexType>
         <xsd:complexType name="GetUserInfoResult">
            <xsd:sequence>
               <xsd:element name="accessibilityMode" type="xsd:boolean" />
               <xsd:element name="currencySymbol" type="xsd:string" nillable="true" />
               <xsd:element name="orgAttachmentFileSizeLimit" type="xsd:int" />
               <xsd:element name="orgDefaultCurrencyIsoCode" type="xsd:string" nillable="true" />
               <xsd:element name="orgDefaultCurrencyLocale" type="xsd:string" nillable="true" />
               <xsd:element name="orgDisallowHtmlAttachments" type="xsd:boolean" />
               <xsd:element name="orgHasPersonAccounts" type="xsd:boolean" />
               <xsd:element name="organizationId" type="tns:ID" />
               <xsd:element name="organizationMultiCurrency" type="xsd:boolean" />
               <xsd:element name="organizationName" type="xsd:string" />
               <xsd:element name="profileId" type="tns:ID" />
               <xsd:element name="roleId" type="tns:ID" nillable="true" />
               <xsd:element name="sessionSecondsValid" type="xsd:int" />
               <xsd:element name="userDefaultCurrencyIsoCode" type="xsd:string" nillable="true" />
               <xsd:element name="userEmail" type="xsd:string" />
               <xsd:element name="userFullName" type="xsd:string" />
               <xsd:element name="userId" type="tns:ID" />
               <xsd:element name="userLanguage" type="xsd:string" />
               <xsd:element name="userLocale" type="xsd:string" />
               <xsd:element name="userName" type="xsd:string" />
               <xsd:element name="userTimeZone" type="xsd:string" />
               <xsd:element name="userType" type="xsd:string" />
               <xsd:element name="userUiSkin" type="xsd:string" />
            </xsd:sequence>
         </xsd:complexType>
         <!-- Login Message Types -->
         <xsd:element name="login">
            <xsd:complexType>
               <xsd:sequence>
                  <xsd:element name="username" type="xsd:string" />
                  <xsd:element name="password" type="xsd:string" />
               </xsd:sequence>
            </xsd:complexType>
         </xsd:element>
         <xsd:element name="loginResponse">
            <xsd:complexType>
               <xsd:sequence>
                  <xsd:element name="result" type="tns:LoginResult" />
               </xsd:sequence>
            </xsd:complexType>
         </xsd:element>
         <xsd:complexType name="LimitInfo">
            <xsd:sequence>
               <xsd:element name="current" type="xsd:int" />
               <xsd:element name="limit" type="xsd:int" />
               <xsd:element name="type" type="xsd:string" />
            </xsd:sequence>
         </xsd:complexType>
         <xsd:element name="LimitInfoHeader">
            <xsd:complexType>
               <xsd:sequence>
                  <xsd:element name="limitInfo" minOccurs="0" maxOccurs="unbounded" type="tns:LimitInfo" />
               </xsd:sequence>
            </xsd:complexType>
         </xsd:element>
         <!-- Create Query -->
         <xsd:element name="query">
            <xsd:complexType>
               <xsd:sequence>
                  <xsd:element name="queryString" type="xsd:string" />
               </xsd:sequence>
            </xsd:complexType>
         </xsd:element>
         <xsd:element name="queryResponse">
            <xsd:complexType>
               <xsd:sequence>
                  <xsd:element name="result" type="tns:QueryResult" />
               </xsd:sequence>
            </xsd:complexType>
         </xsd:element>
         <xsd:simpleType name="QueryLocator">
            <xsd:restriction base="xsd:string" />
         </xsd:simpleType>
         <!-- Shared Result Types -->
         <xsd:complexType name="QueryResult">
            <xsd:sequence>
               <xsd:element name="done" type="xsd:boolean" />
               <xsd:element name="queryLocator" type="tns:QueryLocator" nillable="true" />
               <xsd:element name="records" type="ens:Account" nillable="true" minOccurs="0" maxOccurs="unbounded" />
               <xsd:element name="size" type="xsd:int" />
            </xsd:sequence>
         </xsd:complexType>
      </xsd:schema>
   </types>
   <!-- Message for the header parts -->
   <message name="Header">
      <part name="SessionHeader" element="tns:SessionHeader" />
      <part name="LimitInfoHeader" element="tns:LimitInfoHeader" />
   </message>
   <!-- Method Messages -->
   <message name="loginRequest">
      <part element="tns:login" name="parameters" />
   </message>
   <message name="loginResponse">
      <part element="tns:loginResponse" name="parameters" />
   </message>
   <message name="queryRequest">
      <part element="tns:query" name="parameters" />
   </message>
   <message name="queryResponse">
      <part element="tns:queryResponse" name="parameters" />
   </message>
   <portType name="SalesforceTestLoginQueryPortType">
      <operation name="login">
         <documentation>Login to the Salesforce.com SOAP Api</documentation>
         <input message="tns:loginRequest" />
         <output message="tns:loginResponse" />
      </operation>
      <operation name="query">
         <documentation>Create a Query Cursor</documentation>
         <input message="tns:queryRequest" />
         <output message="tns:queryResponse" />
      </operation>
   </portType>
   <binding name="SalesforceTestLoginQueryBinding" type="tns:SalesforceTestLoginQueryPortType">
      <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
      <operation name="login">
         <documentation>Login to the Salesforce.com SOAP Api</documentation>
         <input message="tns:loginRequest" />
         <output message="tns:loginResponse" />
      </operation>
      <operation name="query">
         <soap:operation soapAction="" />
         <input>
            <soap:header use="literal" message="tns:Header" part="SessionHeader" />
            <soap:body parts="parameters" use="literal" />
         </input>
         <output>
            <soap:header use="literal" message="tns:Header" part="LimitInfoHeader" />
            <soap:body use="literal" />
         </output>
      </operation>
   </binding>
   <service name="SalesforceTestLoginQueryService">
      <documentation />
      <port binding="tns:SalesforceTestLoginQueryBinding" name="SalesforceTestLoginQuery">
         <soap:address location="https://na30.salesforce.com/services/Soap/c/39.0/0DF36000000LeCM" />
      </port>
   </service>
</definitions>

 

All Answers

SandhyaSandhya (Salesforce Developers) 
Hi Solees,

This question has been answered in the below link.

https://developer.salesforce.com/forums?id=906F00000008xERIAY
 
Hope this helps you!

Thanks and Regards
Sandhya

 
SoleesSolees
Hi Sandhya, thanks for your comment but it did not help me :( .   I've red that Salesforce WSDL is not meant to use inside Salesforce (ironicly).  So what I did is isolate in just 1 XML the login and the Account structure needed.  And that's because Salesforce needs to have the actual structure of the response Object, and that's what i did.  I know it's not the best thing to do, but it help me to do a demo.

Check it out:
 
<?xml version="1.0" encoding="UTF-8"?>
<!--
 Web Services API : ESCDEV1.SalesforceTestLoginQuery
-->
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:ens="urn:sobject.enterprise.soap.sforce.com" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="urn:enterprise.soap.sforce.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:enterprise.soap.sforce.com">
   <types>
      <xsd:schema xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="urn:sobject.enterprise.soap.sforce.com">
         <!-- Account -->
         <xsd:complexType name="Account">
            <xsd:sequence>
               <xsd:element name="Id" minOccurs="0" type="xsd:string" nillable="true" />
               <xsd:element name="Name" minOccurs="0" type="xsd:string" nillable="true" />
               <xsd:element name="AccountNumber" nillable="true" minOccurs="0" type="xsd:string" />
               <xsd:element name="AccountSource" nillable="true" minOccurs="0" type="xsd:string" />
               <xsd:element name="AnnualRevenue" nillable="true" minOccurs="0" type="xsd:double" />
               <xsd:element name="BillingCity" nillable="true" minOccurs="0" type="xsd:string" />
               <xsd:element name="BillingCountry" nillable="true" minOccurs="0" type="xsd:string" />
               <xsd:element name="BillingGeocodeAccuracy" nillable="true" minOccurs="0" type="xsd:string" />
               <xsd:element name="BillingLatitude" nillable="true" minOccurs="0" type="xsd:double" />
               <xsd:element name="BillingLongitude" nillable="true" minOccurs="0" type="xsd:double" />
               <xsd:element name="BillingPostalCode" nillable="true" minOccurs="0" type="xsd:string" />
               <xsd:element name="BillingState" nillable="true" minOccurs="0" type="xsd:string" />
               <xsd:element name="BillingStreet" nillable="true" minOccurs="0" type="xsd:string" />
               <xsd:element name="CreatedById" nillable="true" minOccurs="0" type="tns:ID" />
               <xsd:element name="CreatedDate" nillable="true" minOccurs="0" type="xsd:dateTime" />
               <xsd:element name="DandbCompanyId" nillable="true" minOccurs="0" type="tns:ID" />
               <xsd:element name="Description" nillable="true" minOccurs="0" type="xsd:string" />
               <xsd:element name="DunsNumber" nillable="true" minOccurs="0" type="xsd:string" />
               <xsd:element name="Fax" nillable="true" minOccurs="0" type="xsd:string" />
               <xsd:element name="Industry" nillable="true" minOccurs="0" type="xsd:string" />
               <xsd:element name="IsDeleted" nillable="true" minOccurs="0" type="xsd:boolean" />
               <xsd:element name="Jigsaw" nillable="true" minOccurs="0" type="xsd:string" />
               <xsd:element name="JigsawCompanyId" nillable="true" minOccurs="0" type="xsd:string" />
               <xsd:element name="LastActivityDate" nillable="true" minOccurs="0" type="xsd:date" />
               <xsd:element name="LastModifiedById" nillable="true" minOccurs="0" type="tns:ID" />
               <xsd:element name="LastModifiedDate" nillable="true" minOccurs="0" type="xsd:dateTime" />
               <xsd:element name="LastReferencedDate" nillable="true" minOccurs="0" type="xsd:dateTime" />
               <xsd:element name="LastViewedDate" nillable="true" minOccurs="0" type="xsd:dateTime" />
               <xsd:element name="NumberOfEmployees" nillable="true" minOccurs="0" type="xsd:int" />
               <xsd:element name="OwnerId" nillable="true" minOccurs="0" type="tns:ID" />
               <xsd:element name="Ownership" nillable="true" minOccurs="0" type="xsd:string" />
               <xsd:element name="ParentId" nillable="true" minOccurs="0" type="tns:ID" />
               <xsd:element name="Phone" nillable="true" minOccurs="0" type="xsd:string" />
               <xsd:element name="PhotoUrl" nillable="true" minOccurs="0" type="xsd:string" />
               <xsd:element name="Rating" nillable="true" minOccurs="0" type="xsd:string" />
               <xsd:element name="RecordTypeId" nillable="true" minOccurs="0" type="tns:ID" />
               <xsd:element name="ShippingCity" nillable="true" minOccurs="0" type="xsd:string" />
               <xsd:element name="ShippingCountry" nillable="true" minOccurs="0" type="xsd:string" />
               <xsd:element name="ShippingGeocodeAccuracy" nillable="true" minOccurs="0" type="xsd:string" />
               <xsd:element name="ShippingLatitude" nillable="true" minOccurs="0" type="xsd:double" />
               <xsd:element name="ShippingLongitude" nillable="true" minOccurs="0" type="xsd:double" />
               <xsd:element name="ShippingPostalCode" nillable="true" minOccurs="0" type="xsd:string" />
               <xsd:element name="ShippingState" nillable="true" minOccurs="0" type="xsd:string" />
               <xsd:element name="ShippingStreet" nillable="true" minOccurs="0" type="xsd:string" />
               <xsd:element name="Sic" nillable="true" minOccurs="0" type="xsd:string" />
               <xsd:element name="SicDesc" nillable="true" minOccurs="0" type="xsd:string" />
               <xsd:element name="Site" nillable="true" minOccurs="0" type="xsd:string" />
               <xsd:element name="SystemModstamp" nillable="true" minOccurs="0" type="xsd:dateTime" />
               <xsd:element name="TickerSymbol" nillable="true" minOccurs="0" type="xsd:string" />
               <xsd:element name="Tradestyle" nillable="true" minOccurs="0" type="xsd:string" />
               <xsd:element name="Type" nillable="true" minOccurs="0" type="xsd:string" />
               <xsd:element name="Website" nillable="true" minOccurs="0" type="xsd:string" />
               <xsd:element name="YearStarted" nillable="true" minOccurs="0" type="xsd:string" />
            </xsd:sequence>
         </xsd:complexType>
      </xsd:schema>
      <xsd:schema elementFormDefault="qualified" targetNamespace="urn:enterprise.soap.sforce.com">
         <!-- Our simple ID Type -->
         <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:element name="SessionHeader">
            <xsd:complexType>
               <xsd:sequence>
                  <xsd:element name="sessionId" type="xsd:string" />
               </xsd:sequence>
            </xsd:complexType>
         </xsd:element>
         <xsd:complexType name="LoginResult">
            <xsd:sequence>
               <xsd:element name="metadataServerUrl" type="xsd:string" nillable="true" />
               <xsd:element name="passwordExpired" type="xsd:boolean" />
               <xsd:element name="sandbox" type="xsd:boolean" />
               <xsd:element name="serverUrl" type="xsd:string" nillable="true" />
               <xsd:element name="sessionId" type="xsd:string" nillable="true" />
               <xsd:element name="userId" type="tns:ID" nillable="true" />
               <xsd:element name="userInfo" type="tns:GetUserInfoResult" minOccurs="0" />
            </xsd:sequence>
         </xsd:complexType>
         <xsd:complexType name="GetUserInfoResult">
            <xsd:sequence>
               <xsd:element name="accessibilityMode" type="xsd:boolean" />
               <xsd:element name="currencySymbol" type="xsd:string" nillable="true" />
               <xsd:element name="orgAttachmentFileSizeLimit" type="xsd:int" />
               <xsd:element name="orgDefaultCurrencyIsoCode" type="xsd:string" nillable="true" />
               <xsd:element name="orgDefaultCurrencyLocale" type="xsd:string" nillable="true" />
               <xsd:element name="orgDisallowHtmlAttachments" type="xsd:boolean" />
               <xsd:element name="orgHasPersonAccounts" type="xsd:boolean" />
               <xsd:element name="organizationId" type="tns:ID" />
               <xsd:element name="organizationMultiCurrency" type="xsd:boolean" />
               <xsd:element name="organizationName" type="xsd:string" />
               <xsd:element name="profileId" type="tns:ID" />
               <xsd:element name="roleId" type="tns:ID" nillable="true" />
               <xsd:element name="sessionSecondsValid" type="xsd:int" />
               <xsd:element name="userDefaultCurrencyIsoCode" type="xsd:string" nillable="true" />
               <xsd:element name="userEmail" type="xsd:string" />
               <xsd:element name="userFullName" type="xsd:string" />
               <xsd:element name="userId" type="tns:ID" />
               <xsd:element name="userLanguage" type="xsd:string" />
               <xsd:element name="userLocale" type="xsd:string" />
               <xsd:element name="userName" type="xsd:string" />
               <xsd:element name="userTimeZone" type="xsd:string" />
               <xsd:element name="userType" type="xsd:string" />
               <xsd:element name="userUiSkin" type="xsd:string" />
            </xsd:sequence>
         </xsd:complexType>
         <!-- Login Message Types -->
         <xsd:element name="login">
            <xsd:complexType>
               <xsd:sequence>
                  <xsd:element name="username" type="xsd:string" />
                  <xsd:element name="password" type="xsd:string" />
               </xsd:sequence>
            </xsd:complexType>
         </xsd:element>
         <xsd:element name="loginResponse">
            <xsd:complexType>
               <xsd:sequence>
                  <xsd:element name="result" type="tns:LoginResult" />
               </xsd:sequence>
            </xsd:complexType>
         </xsd:element>
         <xsd:complexType name="LimitInfo">
            <xsd:sequence>
               <xsd:element name="current" type="xsd:int" />
               <xsd:element name="limit" type="xsd:int" />
               <xsd:element name="type" type="xsd:string" />
            </xsd:sequence>
         </xsd:complexType>
         <xsd:element name="LimitInfoHeader">
            <xsd:complexType>
               <xsd:sequence>
                  <xsd:element name="limitInfo" minOccurs="0" maxOccurs="unbounded" type="tns:LimitInfo" />
               </xsd:sequence>
            </xsd:complexType>
         </xsd:element>
         <!-- Create Query -->
         <xsd:element name="query">
            <xsd:complexType>
               <xsd:sequence>
                  <xsd:element name="queryString" type="xsd:string" />
               </xsd:sequence>
            </xsd:complexType>
         </xsd:element>
         <xsd:element name="queryResponse">
            <xsd:complexType>
               <xsd:sequence>
                  <xsd:element name="result" type="tns:QueryResult" />
               </xsd:sequence>
            </xsd:complexType>
         </xsd:element>
         <xsd:simpleType name="QueryLocator">
            <xsd:restriction base="xsd:string" />
         </xsd:simpleType>
         <!-- Shared Result Types -->
         <xsd:complexType name="QueryResult">
            <xsd:sequence>
               <xsd:element name="done" type="xsd:boolean" />
               <xsd:element name="queryLocator" type="tns:QueryLocator" nillable="true" />
               <xsd:element name="records" type="ens:Account" nillable="true" minOccurs="0" maxOccurs="unbounded" />
               <xsd:element name="size" type="xsd:int" />
            </xsd:sequence>
         </xsd:complexType>
      </xsd:schema>
   </types>
   <!-- Message for the header parts -->
   <message name="Header">
      <part name="SessionHeader" element="tns:SessionHeader" />
      <part name="LimitInfoHeader" element="tns:LimitInfoHeader" />
   </message>
   <!-- Method Messages -->
   <message name="loginRequest">
      <part element="tns:login" name="parameters" />
   </message>
   <message name="loginResponse">
      <part element="tns:loginResponse" name="parameters" />
   </message>
   <message name="queryRequest">
      <part element="tns:query" name="parameters" />
   </message>
   <message name="queryResponse">
      <part element="tns:queryResponse" name="parameters" />
   </message>
   <portType name="SalesforceTestLoginQueryPortType">
      <operation name="login">
         <documentation>Login to the Salesforce.com SOAP Api</documentation>
         <input message="tns:loginRequest" />
         <output message="tns:loginResponse" />
      </operation>
      <operation name="query">
         <documentation>Create a Query Cursor</documentation>
         <input message="tns:queryRequest" />
         <output message="tns:queryResponse" />
      </operation>
   </portType>
   <binding name="SalesforceTestLoginQueryBinding" type="tns:SalesforceTestLoginQueryPortType">
      <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
      <operation name="login">
         <documentation>Login to the Salesforce.com SOAP Api</documentation>
         <input message="tns:loginRequest" />
         <output message="tns:loginResponse" />
      </operation>
      <operation name="query">
         <soap:operation soapAction="" />
         <input>
            <soap:header use="literal" message="tns:Header" part="SessionHeader" />
            <soap:body parts="parameters" use="literal" />
         </input>
         <output>
            <soap:header use="literal" message="tns:Header" part="LimitInfoHeader" />
            <soap:body use="literal" />
         </output>
      </operation>
   </binding>
   <service name="SalesforceTestLoginQueryService">
      <documentation />
      <port binding="tns:SalesforceTestLoginQueryBinding" name="SalesforceTestLoginQuery">
         <soap:address location="https://na30.salesforce.com/services/Soap/c/39.0/0DF36000000LeCM" />
      </port>
   </service>
</definitions>

 
This was selected as the best answer