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
Jay PatelJay Patel 

Retrieving SFDC data using SOAP UI

Hi, New user here and new to SFDC Integrations. I'm trying to retrieve account information from SFDC using SOAP UI.

 

I downloaded the Generate Partner WSDL and imported to SOAP UI. I can login to our sand box using the login WS method and it gives the session Id and the server name  (https://cs13-api.salesforce.com/services/Soap/m/26.0/00DW0000000500n).

 

Next I try to search for a string using the search String WS method using following soap message.

 

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:partner.soap.sforce.com">
<soapenv:Header>
<urn:SessionHeader>
<urn:sessionId>00DW0000000500n!AR8AQOIbIuFfbAEkjoBBS.mYRhoHsWsHxnwdBw1AeqrYo.9JgegYXp1WEIe9hcgx0F3gm5Fw5phQeEwLnr.PHoBgIk7dkJ0d</urn:sessionId>
</urn:SessionHeader>
</soapenv:Header>
<soapenv:Body>
<urn:search>
<urn:searchString>Jay</urn:searchString>
</urn:search>
</soapenv:Body>
</soapenv:Envelope>

 

but it returns me following error.

 

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:Client</faultcode>
<faultstring>No operation available for request {urn:partner.soap.sforce.com}search</faultstring>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>

 

Not sure what am I doing wrong. Any help is greatly apriciated.

Jay.

SuperfellSuperfell

You are sending the request to the wrong URL, you should be using serverUrl from the loginResult, looks like you might be using metadataServerUrl instead.

Jay PatelJay Patel

Thanks Buddy, the login request gave me 2 urls and session Id in response and I was the one for the metadata

 

https://cs13-api.salesforce.com/services/Soap/m/26.0/00DW0000000500n  -- Metadata

 

https://cs13-api.salesforce.com/services/Soap/u/26.0/00DW0000000500n -- UI or objects

 

 

as you can see, its hard to figur out but your hint helped figure out.

 

Jay.

BijayBijay

I want to write a test class for my WSDL2Apex class :

 

Can anyone please help me out ,i am beginner..:(

 

//Generated by wsdl2apex

public class invokeCustomerManagement {
   
    public class AuditReq {
        public String callingApplication;
        public String callingArea;
        public String userId;
        private String[] callingApplication_type_info = new String[]{'callingApplication','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] callingArea_type_info = new String[]{'callingArea','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] userId_type_info = new String[]{'userId','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://managementservices.profile.custmgmt.crm.crom.sf/','false','false'};
        private String[] field_order_type_info = new String[]{'callingApplication','callingArea','userId'};
    }
    public class InvalidInputExcption {
        private String[] apex_schema_type_info = new String[]{'http://managementservices.profile.custmgmt.crm.crom.sf/','false','false'};
        private String[] field_order_type_info = new String[]{};
    }
  
    public class CreateRelationshipRequest {
        public String customerId1;
        public String customerId2;
        public String relationshipNature;
        public invokeCustomerManagement.Audit audit;
        private String[] customerId1_type_info = new String[]{'customerId1','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] customerId2_type_info = new String[]{'customerId2','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] relationshipNature_type_info = new String[]{'relationshipNature','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] audit_type_info = new String[]{'audit','http://managementservices.profile.custmgmt.crm.crom.sf/','Audit','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://managementservices.profile.custmgmt.crm.crom.sf/','false','false'};
        private String[] field_order_type_info = new String[]{'customerId1','customerId2','relationshipNature','audit'};
    }
    public class PhoneReq {
        public String phoneType;
        public String phoneUsage;
        public String phone;
        public String phoneExtension;
        private String[] phoneType_type_info = new String[]{'phoneType','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] phoneUsage_type_info = new String[]{'phoneUsage','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] phone_type_info = new String[]{'phone','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] phoneExtension_type_info = new String[]{'phoneExtension','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://managementservices.profile.custmgmt.crm.crom.sf/','false','false'};
        private String[] field_order_type_info = new String[]{'phoneType','phoneUsage','phone','phoneExtension'};
    }
  
  
    public class CustomerManagementPort {
        public String endpoint_x = 'http://localhost:9043/CustomerManagementV2.1';
        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;
        private String[] ns_map_type_info = new String[]{'http://managementservices.profile.custmgmt.crm.crom.sf/', 'invokeCustomerManagement'};
        public invokeCustomerManagement.CreateCustomerResponse createCustomer(invokeCustomerManagement.CreateCustomerRequest customer) {
            invokeCustomerManagement.createCustomer request_x = new invokeCustomerManagement.createCustomer();
            invokeCustomerManagement.createCustomerRes response_x;
            request_x.customer = customer;
            Map<String, invokeCustomerManagement.createCustomerRes> response_map_x = new Map<String, invokeCustomerManagement.createCustomerRes>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              '',
              'http://managementservices.profile.custmgmt.crm.crom.sf/',
              'createCustomer',
              'http://managementservices.profile.custmgmt.crm.crom.sf/',
              'createCustomerRes',
              'invokeCustomerManagement.createCustomerRes'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.customer;
        }
        public invokeCustomerManagement.CreateRelationshipResponse createRelationship(invokeCustomerManagement.CreateRelationshipRequest customer) {
            invokeCustomerManagement.createRelationship request_x = new invokeCustomerManagement.createRelationship();
            invokeCustomerManagement.createRelationshipRes response_x;
            request_x.customer = customer;
            Map<String, invokeCustomerManagement.createRelationshipRes> response_map_x = new Map<String, invokeCustomerManagement.createRelationshipRes>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              '',
              'http://managementservices.profile.custmgmt.crm.crom.sf/',
              'createRelationship',
              'http://managementservices.profile.custmgmt.crm.crom.sf/',
              'createRelationshipRes',
              'invokeCustomerManagement.createRelationshipRes'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.customer;
        }
        public invokeCustomerManagement.UpdateCustomerResponse updateCustomer(invokeCustomerManagement.UpdateCustomerRequest customer) {
            invokeCustomerManagement.updateCustomer request_x = new invokeCustomerManagement.updateCustomer();
            invokeCustomerManagement.updateCustomerRes response_x;
            request_x.customer = customer;
            Map<String, invokeCustomerManagement.updateCustomerRes> response_map_x = new Map<String, invokeCustomerManagement.updateCustomerRes>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              '',
              'http://managementservices.profile.custmgmt.crm.crom.sf/',
              'updateCustomer',
              'http://managementservices.profile.custmgmt.crm.crom.sf/',
              'updateCustomerRes',
              'invokeCustomerManagement.updateCustomerRes'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.customer;
        }
        public invokeCustomerManagement.CreateAgentRelationshipResponse createAgentRelationship(invokeCustomerManagement.CreateAgentRelationshipRequest customer) {
            invokeCustomerManagement.createAgentRelationship request_x = new invokeCustomerManagement.createAgentRelationship();
            invokeCustomerManagement.createAgentRelationshipRes response_x;
            request_x.customer = customer;
            Map<String, invokeCustomerManagement.createAgentRelationshipRes> response_map_x = new Map<String, invokeCustomerManagement.createAgentRelationshipRes>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              '',
              'http://managementservices.profile.custmgmt.crm.crom.sf/',
              'createAgentRelationship',
              'http://managementservices.profile.custmgmt.crm.crom.sf/',
              'createAgentRelationshipRes',
              'invokeCustomerManagement.createAgentRelationshipRes'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.customer;
        }
    }
    public class UnexpectedServiceExcption {
        private String[] apex_schema_type_info = new String[]{'http://managementservices.profile.custmgmt.crm.crom.sf/','false','false'};
        private String[] field_order_type_info = new String[]{};
    }
  
    public class CreateRelationshipResponse {
        private String[] apex_schema_type_info = new String[]{'http://managementservices.profile.custmgmt.crm.crom.sf/','false','false'};
        private String[] field_order_type_info = new String[]{};
    }
    public class NameReq {
        public String prefix;
        public String firstName;
        public String preferredFirst;
        public String middleName;
        public String lastName;
        public String suffix;
        public String designation;
        private String[] prefix_type_info = new String[]{'prefix','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] firstName_type_info = new String[]{'firstName','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] preferredFirst_type_info = new String[]{'preferredFirst','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] middleName_type_info = new String[]{'middleName','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] lastName_type_info = new String[]{'lastName','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] suffix_type_info = new String[]{'suffix','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] designation_type_info = new String[]{'designation','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://managementservices.profile.custmgmt.crm.crom.sf/','false','false'};
        private String[] field_order_type_info = new String[]{'prefix','firstName','preferredFirst','middleName','lastName','suffix','designation'};
    }
    public class CreateAgentRelationshipRequest {
        public String customerId;
        public String customerType;
        public invokeCustomerManagement.Agent agent;
        public invokeCustomerManagement.Audit audit;
        private String[] customerId_type_info = new String[]{'customerId','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] customerType_type_info = new String[]{'customerType','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] agent_type_info = new String[]{'agent','http://managementservices.profile.custmgmt.crm.crom.sf/','Agent','1','1','false'};
        private String[] audit_type_info = new String[]{'audit','http://managementservices.profile.custmgmt.crm.crom.sf/','Audit','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://managementservices.profile.custmgmt.crm.crom.sf/','false','false'};
        private String[] field_order_type_info = new String[]{'customerId','customerType','agent','audit'};
    }
    public class Audit {
        public String userId;
        public String callingApplication;
        public String callingArea;
        private String[] userId_type_info = new String[]{'userId','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] callingApplication_type_info = new String[]{'callingApplication','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] callingArea_type_info = new String[]{'callingArea','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://managementservices.profile.custmgmt.crm.crom.sf/','false','false'};
        private String[] field_order_type_info = new String[]{'userId','callingApplication','callingArea'};
    }
    public class createRelationship {
        public invokeCustomerManagement.CreateRelationshipRequest customer;
        private String[] customer_type_info = new String[]{'customer','http://managementservices.profile.custmgmt.crm.crom.sf/','CreateRelationshipRequest','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://managementservices.profile.custmgmt.crm.crom.sf/','false','false'};
        private String[] field_order_type_info = new String[]{'customer'};
    }
    public class CreateCustomerResponse {
        public String customerId;
        public String nameId;
        public String addressId;
        public String careOfAddressId;
        private String[] customerId_type_info = new String[]{'customerId','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] nameId_type_info = new String[]{'nameId','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] addressId_type_info = new String[]{'addressId','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] careOfAddressId_type_info = new String[]{'careOfAddressId','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://managementservices.profile.custmgmt.crm.crom.sf/','false','false'};
        private String[] field_order_type_info = new String[]{'customerId','nameId','addressId','careOfAddressId'};
    }
    public class createRelationshipRes {
        public invokeCustomerManagement.CreateRelationshipResponse customer;
        private String[] customer_type_info = new String[]{'customer','http://managementservices.profile.custmgmt.crm.crom.sf/','CreateRelationshipResponse','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://managementservices.profile.custmgmt.crm.crom.sf/','false','false'};
        private String[] field_order_type_info = new String[]{'customer'};
    }
    public class UpdateCustomerResponse {
        private String[] apex_schema_type_info = new String[]{'http://managementservices.profile.custmgmt.crm.crom.sf/','false','false'};
        private String[] field_order_type_info = new String[]{};
    }
    public class ContactReq {
        public invokeCustomerManagement.PhoneReq phone;
        public invokeCustomerManagement.EmailReq email;
        private String[] phone_type_info = new String[]{'phone','http://managementservices.profile.custmgmt.crm.crom.sf/','PhoneReq','0','1','false'};
        private String[] email_type_info = new String[]{'email','http://managementservices.profile.custmgmt.crm.crom.sf/','EmailReq','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://managementservices.profile.custmgmt.crm.crom.sf/','false','false'};
        private String[] field_order_type_info = new String[]{'phone','email'};
    }
}