• surendrababu k
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 2
    Questions
  • 5
    Replies
Hi Folks..
I'm new to the API's and Integration, I need clarification on these below points....

1. We have some documents in salesforce libraries, can we fetch those documents via REST API without logging in?

2. As per salesforce documentation we have to login via REST API and generate oAuth token to fetch any data from salesforce, is there any way to bypass that login and fetch content from libraries directly?

3. Can a single user login to multiple devices via REST API? Will the oAuth token be valid on all devices if I login using the same credentials at the same time to fetch data via REST API?

4. Can we fetch the Related Content related list data from Custom object via SOQL/APEX queries?

Thanks in advance..
Surendra Babu

 
Hi Team,

I am consuming external WSDL into Salesorce and it generate different Apex classes and I'm giving a End point URL as "http://api.cvent.com/soap/V200611.ASMX"in Remote site settings to call the API's. After calling the different methods in Developer console to the third party web API,I'm getting the below error:

System.CalloutException: Web service callout failed: WebService returned a SOAP Fault: INVALID_LOGIN faultcode=q0:CV10102 faultactor=http://api.cvent.com:83/soap/V200611.ASMX.

Can you please help me to overcome this error?

Regards
Surendra
Hi Folks..
I'm new to the API's and Integration, I need clarification on these below points....

1. We have some documents in salesforce libraries, can we fetch those documents via REST API without logging in?

2. As per salesforce documentation we have to login via REST API and generate oAuth token to fetch any data from salesforce, is there any way to bypass that login and fetch content from libraries directly?

3. Can a single user login to multiple devices via REST API? Will the oAuth token be valid on all devices if I login using the same credentials at the same time to fetch data via REST API?

4. Can we fetch the Related Content related list data from Custom object via SOQL/APEX queries?

Thanks in advance..
Surendra Babu

 
Hi Team,

I am consuming external WSDL into Salesorce and it generate different Apex classes and I'm giving a End point URL as "http://api.cvent.com/soap/V200611.ASMX"in Remote site settings to call the API's. After calling the different methods in Developer console to the third party web API,I'm getting the below error:

System.CalloutException: Web service callout failed: WebService returned a SOAP Fault: INVALID_LOGIN faultcode=q0:CV10102 faultactor=http://api.cvent.com:83/soap/V200611.ASMX.

Can you please help me to overcome this error?

Regards
Surendra
Hello,

I've been trying to put together an APEX code library for integrations between Salesforce and Cvent's SOAP API.  I'm having some problems with the SOAP envelope generated by one of the API calls.  It's specifying the wrong namespace at one of the element nodes causing Cvent to fail to deserialize the envelope correctly.

I've tried tweaking the auto-generated classes in APEX (playing around with the apex_schema_type_info and Ids_type_info) to get the correct namespace at the right spot, but so far have had no luck.

Here is the API call I'm trying to make:
//Create an array and store the ids in it
CventWebServiceschemas.IdArray idArray = new CventWebServiceschemas.IdArray();
idArray.Id = updatedResult.Id; //updatedResult is an array of IDs returned from a previous API call

//Make API call to retrieve events
CventWebServiceschemas.RetrieveResult retrieveResult = ws.Retrieve_x('Event' ,idArray);
System.debug('retrieveRes: ' + retrieveResult);

Here are the APEX relevant classes generated when reading in the WSDL:

public CventWebServiceschemas.RetrieveResult Retrieve_x(String ObjectType,CventWebServiceschemas.IdArray Ids) {
            CventWebService.Retrieve_element request_x = new CventWebService.Retrieve_element();
            request_x.ObjectType = ObjectType;
            request_x.Ids = Ids;
            CventWebService.RetrieveResponse_element response_x;
            Map<String, CventWebService.RetrieveResponse_element> response_map_x = new Map<String, CventWebService.RetrieveResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'http://api.cvent.com/2006-11/Retrieve',
              'http://api.cvent.com/2006-11',
              'Retrieve',
              'http://api.cvent.com/2006-11',
              'RetrieveResponse',
              'CventWebService.RetrieveResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.RetrieveResult;
        }


public class Retrieve_element {
        public String ObjectType;
        public CventWebServiceschemas.IdArray Ids;
        private String[] ObjectType_type_info = new String[]{'ObjectType','http://api.cvent.com/2006-11',null,'1','1','false'};
        private String[] Ids_type_info = new String[]{'Ids','http://schemas.cvent.com/api/2006-11',null,'0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://api.cvent.com/2006-11','true','false'};
        private String[] field_order_type_info = new String[]{'ObjectType','Ids'};
    }

public class IdArray {
        public String[] Id;
        private String[] Id_type_info = new String[]{'Id','http://schemas.cvent.com/api/2006-11',null,'0','-1','false'};
        private String[] apex_schema_type_info = new String[]{'http://schemas.cvent.com/api/2006-11','true','false'};
        private String[] field_order_type_info = new String[]{'Id'};
    }


public class RetrieveResponse_element {
        public CventWebServiceschemas.RetrieveResult RetrieveResult;
        private String[] RetrieveResult_type_info = new String[]{'RetrieveResult','http://schemas.cvent.com/api/2006-11',null,'0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://api.cvent.com/2006-11','true','false'};
        private String[] field_order_type_info = new String[]{'RetrieveResult'};
    }


The issue I'm having is with the namespace on the idArray in the SOAP envelope.  When I create the API call through C# or .Net WebService Studio, it creates an envelope in the expected format below with the https://schemas.cvent.com/api/2006-11 specified on the <Ids> element.

...
<soap:Body>
  <Retrieve xmlns="http://api.cvent.com/2006-11">
    <ObjectType>Event</ObjectType>
      <Ids xmlns="http://schemas.cvent.com/api/2006-11">
        <Id>7A71F7AC-2EDC-4462-8CF6-46E7CB7BD763</Id>
      </Ids>
  </Retrieve>
</soap:Body>
...

When I do a retrieve call using the APEX generated classes, it's creating the below envelope, which is failing to deserialize since the <Ids> element is inheriting the http://api.cvent.com/2006-11 namespace.

...
<env:Body>
  <Retrieve xmlns="http://api.cvent.com/2006-11">
      <ObjectType>Event</ObjectType>
      <Ids>
        <Id xmlns="http://schemas.cvent.com/api/2006-11">7A71F7AC-2EDC-4462-8CF6-46E7CB7BD763</Id>
      </Ids>
  </Retrieve>
</env:Body>
...

Please let me know if you need any more information (or the full generated APEX classes and full APEX code).  I would have provided both but didn't see any way to upload files.
Hello,

I've been trying to put together an APEX code library for integrations between Salesforce and Cvent's SOAP API.  I'm having some problems with the SOAP envelope generated by one of the API calls.  It's specifying the wrong namespace at one of the element nodes causing Cvent to fail to deserialize the envelope correctly.

I've tried tweaking the auto-generated classes in APEX (playing around with the apex_schema_type_info and Ids_type_info) to get the correct namespace at the right spot, but so far have had no luck.

Here is the API call I'm trying to make:
//Create an array and store the ids in it
CventWebServiceschemas.IdArray idArray = new CventWebServiceschemas.IdArray();
idArray.Id = updatedResult.Id; //updatedResult is an array of IDs returned from a previous API call

//Make API call to retrieve events
CventWebServiceschemas.RetrieveResult retrieveResult = ws.Retrieve_x('Event' ,idArray);
System.debug('retrieveRes: ' + retrieveResult);

Here are the APEX relevant classes generated when reading in the WSDL:

public CventWebServiceschemas.RetrieveResult Retrieve_x(String ObjectType,CventWebServiceschemas.IdArray Ids) {
            CventWebService.Retrieve_element request_x = new CventWebService.Retrieve_element();
            request_x.ObjectType = ObjectType;
            request_x.Ids = Ids;
            CventWebService.RetrieveResponse_element response_x;
            Map<String, CventWebService.RetrieveResponse_element> response_map_x = new Map<String, CventWebService.RetrieveResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'http://api.cvent.com/2006-11/Retrieve',
              'http://api.cvent.com/2006-11',
              'Retrieve',
              'http://api.cvent.com/2006-11',
              'RetrieveResponse',
              'CventWebService.RetrieveResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.RetrieveResult;
        }


public class Retrieve_element {
        public String ObjectType;
        public CventWebServiceschemas.IdArray Ids;
        private String[] ObjectType_type_info = new String[]{'ObjectType','http://api.cvent.com/2006-11',null,'1','1','false'};
        private String[] Ids_type_info = new String[]{'Ids','http://schemas.cvent.com/api/2006-11',null,'0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://api.cvent.com/2006-11','true','false'};
        private String[] field_order_type_info = new String[]{'ObjectType','Ids'};
    }

public class IdArray {
        public String[] Id;
        private String[] Id_type_info = new String[]{'Id','http://schemas.cvent.com/api/2006-11',null,'0','-1','false'};
        private String[] apex_schema_type_info = new String[]{'http://schemas.cvent.com/api/2006-11','true','false'};
        private String[] field_order_type_info = new String[]{'Id'};
    }


public class RetrieveResponse_element {
        public CventWebServiceschemas.RetrieveResult RetrieveResult;
        private String[] RetrieveResult_type_info = new String[]{'RetrieveResult','http://schemas.cvent.com/api/2006-11',null,'0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://api.cvent.com/2006-11','true','false'};
        private String[] field_order_type_info = new String[]{'RetrieveResult'};
    }


The issue I'm having is with the namespace on the idArray in the SOAP envelope.  When I create the API call through C# or .Net WebService Studio, it creates an envelope in the expected format below with the https://schemas.cvent.com/api/2006-11 specified on the <Ids> element.

...
<soap:Body>
  <Retrieve xmlns="http://api.cvent.com/2006-11">
    <ObjectType>Event</ObjectType>
      <Ids xmlns="http://schemas.cvent.com/api/2006-11">
        <Id>7A71F7AC-2EDC-4462-8CF6-46E7CB7BD763</Id>
      </Ids>
  </Retrieve>
</soap:Body>
...

When I do a retrieve call using the APEX generated classes, it's creating the below envelope, which is failing to deserialize since the <Ids> element is inheriting the http://api.cvent.com/2006-11 namespace.

...
<env:Body>
  <Retrieve xmlns="http://api.cvent.com/2006-11">
      <ObjectType>Event</ObjectType>
      <Ids>
        <Id xmlns="http://schemas.cvent.com/api/2006-11">7A71F7AC-2EDC-4462-8CF6-46E7CB7BD763</Id>
      </Ids>
  </Retrieve>
</env:Body>
...

Please let me know if you need any more information (or the full generated APEX classes and full APEX code).  I would have provided both but didn't see any way to upload files.