• David Bailey 16
  • NEWBIE
  • 20 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 7
    Replies
In the original Salesforce article "Introduction to the Force.com Web Services Connector" by Jeff Douglas, Developer Advocate, everything works just fine code-wise, until one gets to the WCS Metadata API Java code sample.   That sample code generates two syntax errors ...

Line 54: AsyncResult[] ars = metadataConnection.create(new CustomObject[] { co });
- The method create(CustomObject[]) is undefined for the type MetadataConnection

Line 72: arsStatus = metadataConnection.checkStatus(ids);
- The method checkStatus(String[]) is undefined for the type MetadataConnection

This currently occurs using the "force-wsc-38.0.0-uber.jar" jar file.  Can you kindly tell me what I need to do to fix these errors?  Cheers,

David
 
In this Understanding Query Results page:
https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_relationships_query_results.htm

There is a code sample with a querySample() method and a printContacts() method.  Presuming that the code is intended to be actually tried out, how is it supposed to be run?  And what language is it written in?  It doesn't appear to be Apex, judging from the use of 'int' instead of 'Integer' as the integer type, and the slew of other compile errors thrown.

I took a 'side trip' from my last Trailhead Challenge to research subqueries for parent-to-child relationships (which this sample alleges to demonstrate) and would like to run this code to get a better understanding of this topic.  Every other code sample I've encountered thus far runs without generating compile errors in the Execute Anonymous Window of the Apex Developer Console.  I'm surprised and perplexed that this sample is different!
 
Into the Apex Integration Services module, happily, I began.

In the Apex Web Services unit, blissfully, I continued.

At the Retrieve Data with a Custom GET Method section, without incident, I arrived.

Into the Retrieve Data Using cURL sub-section, with rapt anticipation, I delved.

The cURL command line tool, dutifully, I installed.

My 
 
Session ID: 00D36000000KIKL, 
Reccord ID: 50036000003Sv7IAAS
Instance: appliedconcepts-dev-ed.my


I saved.

The
 
'curl https://appliedconcepts-dev-ed.my.salesforce.com/services/apexrest/Cases/50036000003Sv7IAAS -H "Authorization: Bearer 00D36000000KIKL" -H "X-PrettyPrint:1"'

cURL command, diligently, I constructed.

A Windows command prompt, quickly, I opened.

The 
 
"[ {
  "message" : "Session expired or invalid",
  "errorCode" : "INVALID_SESSION_ID"
} ]"

error message, sadly, I encountered.

More on cURL from the Resources section, with mounting trepidation, I perused.

At a dead-end, afterward, I am.

About what has going wrong, perplexed, I wonder.

At the foot of the Salesforce masters, humbly, now, I bow.

 
In the original Salesforce article "Introduction to the Force.com Web Services Connector" by Jeff Douglas, Developer Advocate, everything works just fine code-wise, until one gets to the WCS Metadata API Java code sample.   That sample code generates two syntax errors ...

Line 54: AsyncResult[] ars = metadataConnection.create(new CustomObject[] { co });
- The method create(CustomObject[]) is undefined for the type MetadataConnection

Line 72: arsStatus = metadataConnection.checkStatus(ids);
- The method checkStatus(String[]) is undefined for the type MetadataConnection

This currently occurs using the "force-wsc-38.0.0-uber.jar" jar file.  Can you kindly tell me what I need to do to fix these errors?  Cheers,

David
 
In this Understanding Query Results page:
https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_relationships_query_results.htm

There is a code sample with a querySample() method and a printContacts() method.  Presuming that the code is intended to be actually tried out, how is it supposed to be run?  And what language is it written in?  It doesn't appear to be Apex, judging from the use of 'int' instead of 'Integer' as the integer type, and the slew of other compile errors thrown.

I took a 'side trip' from my last Trailhead Challenge to research subqueries for parent-to-child relationships (which this sample alleges to demonstrate) and would like to run this code to get a better understanding of this topic.  Every other code sample I've encountered thus far runs without generating compile errors in the Execute Anonymous Window of the Apex Developer Console.  I'm surprised and perplexed that this sample is different!
 
Into the Apex Integration Services module, happily, I began.

In the Apex Web Services unit, blissfully, I continued.

At the Retrieve Data with a Custom GET Method section, without incident, I arrived.

Into the Retrieve Data Using cURL sub-section, with rapt anticipation, I delved.

The cURL command line tool, dutifully, I installed.

My 
 
Session ID: 00D36000000KIKL, 
Reccord ID: 50036000003Sv7IAAS
Instance: appliedconcepts-dev-ed.my


I saved.

The
 
'curl https://appliedconcepts-dev-ed.my.salesforce.com/services/apexrest/Cases/50036000003Sv7IAAS -H "Authorization: Bearer 00D36000000KIKL" -H "X-PrettyPrint:1"'

cURL command, diligently, I constructed.

A Windows command prompt, quickly, I opened.

The 
 
"[ {
  "message" : "Session expired or invalid",
  "errorCode" : "INVALID_SESSION_ID"
} ]"

error message, sadly, I encountered.

More on cURL from the Resources section, with mounting trepidation, I perused.

At a dead-end, afterward, I am.

About what has going wrong, perplexed, I wonder.

At the foot of the Salesforce masters, humbly, now, I bow.

 
Greetings - has anyone received the error "No Apex class named 'ParkServiceMock' was found."? I have the ParkServiceMock class defined, and called out in the ParkLocatorTest class using Test.setMock(WebServiceMock.class, new ParkServiceMock());

I also verified that the tests run with 100% code coverage, and the ParkLocator class returns the names of parks. 

Any idea what I'm doing wrong?  Thanks in advance.