• Arcos
  • NEWBIE
  • 10 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 3
    Replies
Hi,
 
I am trying to create an SR using the BMC RemedyForce REST API by making a POST to https://mydomain/services/apexrest/BMCServiceDesk/1.0/ServiceRequest URL. The response is returned with Status=OK and StatusCode=200 which is good, but the response body contains the following JSON:
 
{"Success":false,"Result":null,"ErrorMessage":"Attempt to de-reference a null object","ErrorCode":null}
Interesting, that a POST with the same JSON string using SOAP UI works good.

Below is my code that is calling the REST API:
 
String endPointURL = 'https://mydomain/services/apexrest/BMCServiceDesk/1.0/ServiceRequest';

String authorizationHeader = 'Bearer ' + UserInfo.getSessionId();

Httprequest request = new HttpRequest();
Http http = new Http();

request.setMethod('POST');
request.setEndpoint(endPointURL);
request.setHeader('Accept-Encoding', 'gzip,deflate');
request.setHeader('Content-Type', 'application/json');
request.setHeader('Authorization', authorizationHeader);
request.setCompressed(false);
request.setTimeout(120000);

String jsonString = '{"Fields":[{"Name":"requestDefinitionId","Value":"a3Y24000000L1QcEAK"}],"Answers":[{"QuestionId":"a3U2400000096Q3EAI","Values":["dev"]}]}';

request.setBody(jsonString);

System.debug('Request = ' + request);
System.debug('Request body = ' + request.getBody());

HttpResponse response = http.send(request);

System.debug('responseBody: ' + response.getBody());

What am I doing wrong?
  • October 15, 2016
  • Like
  • 0
Hi,

I am trying to deploy a change set which has classes and test classes for them. The test classes use the Test.loadData method to load test data from a static resource. When I deploy the change set I many errors similar to the following:

System.SObjectException: common.exception.SfdcSqlException: ORA-20096: 00524000000Mddu ORA-06512: at "BASHFUL.CSAVEUTILS", line 215 ORA-06512: at "BASHFUL.CCUSTOMENTITYDATATEMPLATE", line 1379 ORA-06512: at line 1 {call cCustomEntityDataTemplate.insert_custentdatas(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)} {call cCustomEntityDataTemplate.insert_custentdatas(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)} 
Stack Trace: Class.System.Test.loadData: line 53, column 1 Class.ICL_ChangeRequest_Tests.SetupData: line 8, column 1

Although I consider it a classic support case, since it's refers to internal Salesforce ORACLE error (the DB which is not even exposed to customers) I tried to log a support case, but no success. They refuse to consider it a normal support case and refer to it as "development case" which requires a primier support subscription and just closed my case. 

Has anybody else encountered such issue and how did you resolve it?

Thanks!

 
  • June 17, 2016
  • Like
  • 0
Hi,

I am trying to implement the integration of an external system with Salesforce and have exposed a WS using an apex class for this purpose. In order to access the WS Salesforce documentation (https://help.salesforce.com/apex/HTViewSolution?urlname=Updating-Hard-Coded-References-FAQ&language=en_US) states I should first consume a login WS (enterprise or partner). The response should contain a ServerURL and a Session ID. That ServerURL should be set as the target endpoint for a subsequent call to my WS. 

The issue is when I set the targent endpoint as the URL for my WS call in SOAP UI I am getting the following response:
No operation available for request {http://soap.sforce.com/schemas/class/ICL_GatewaySAP}QueryRequest

The login WSDL URL: 
https://test.salesforce.com/services/Soap/c/36.0/0DF8E00000000De

The ServerURL returned by the login method:
https://icl--Staging.cs87.my.salesforce.com/services/Soap/c/36.0/00D8E0000008itT/0DF8E00000000De

What I am doing wrong?
 
  • March 21, 2016
  • Like
  • 0
Hi,
 
I am trying to create an SR using the BMC RemedyForce REST API by making a POST to https://mydomain/services/apexrest/BMCServiceDesk/1.0/ServiceRequest URL. The response is returned with Status=OK and StatusCode=200 which is good, but the response body contains the following JSON:
 
{"Success":false,"Result":null,"ErrorMessage":"Attempt to de-reference a null object","ErrorCode":null}
Interesting, that a POST with the same JSON string using SOAP UI works good.

Below is my code that is calling the REST API:
 
String endPointURL = 'https://mydomain/services/apexrest/BMCServiceDesk/1.0/ServiceRequest';

String authorizationHeader = 'Bearer ' + UserInfo.getSessionId();

Httprequest request = new HttpRequest();
Http http = new Http();

request.setMethod('POST');
request.setEndpoint(endPointURL);
request.setHeader('Accept-Encoding', 'gzip,deflate');
request.setHeader('Content-Type', 'application/json');
request.setHeader('Authorization', authorizationHeader);
request.setCompressed(false);
request.setTimeout(120000);

String jsonString = '{"Fields":[{"Name":"requestDefinitionId","Value":"a3Y24000000L1QcEAK"}],"Answers":[{"QuestionId":"a3U2400000096Q3EAI","Values":["dev"]}]}';

request.setBody(jsonString);

System.debug('Request = ' + request);
System.debug('Request body = ' + request.getBody());

HttpResponse response = http.send(request);

System.debug('responseBody: ' + response.getBody());

What am I doing wrong?
  • October 15, 2016
  • Like
  • 0
Hi,

I am trying to implement the integration of an external system with Salesforce and have exposed a WS using an apex class for this purpose. In order to access the WS Salesforce documentation (https://help.salesforce.com/apex/HTViewSolution?urlname=Updating-Hard-Coded-References-FAQ&language=en_US) states I should first consume a login WS (enterprise or partner). The response should contain a ServerURL and a Session ID. That ServerURL should be set as the target endpoint for a subsequent call to my WS. 

The issue is when I set the targent endpoint as the URL for my WS call in SOAP UI I am getting the following response:
No operation available for request {http://soap.sforce.com/schemas/class/ICL_GatewaySAP}QueryRequest

The login WSDL URL: 
https://test.salesforce.com/services/Soap/c/36.0/0DF8E00000000De

The ServerURL returned by the login method:
https://icl--Staging.cs87.my.salesforce.com/services/Soap/c/36.0/00D8E0000008itT/0DF8E00000000De

What I am doing wrong?
 
  • March 21, 2016
  • Like
  • 0