10

This might seem like an oddly specific question, but hear me out.

I have an application that I distribute freely to whoever wants to use it that talks to Salesforce via the Partner API. Right now the current release is using the Spring '19 WSDL (v45.0) and the corresponding API endpoints.

That works great, but now the Summer '19 (v46.0) release is hitting sandboxes and very soon production orgs as well. I'm starting to get error reports from people using my tool against Summer '19 sandboxes.

The following error is coming back from a describeSObjects() Partner API v45.0 call.

System.InvalidOperationException: Instance validation error: 'tns:json' is not a valid value for soapType.

It was recommended that I check the v46.0 Partner API WSDL. Sure enough, it now has json as a fieldType and a soapType of tns:json.

So it would appear that a field type defined in v46.0 is leaking back into a v45.0 API call. That's a bit of a problem as it potentially breaks any pre-Summer `19 integration that makes a describe sObject call on the corresponding type(s).

I'm going to raise a support case for this, but I don't know under what circumstances the new tns:json field type is coming back. The first question Salesforce support is going to ask is how to reproduce the error. It isn't in any of the sandboxes I have access to.

So my question is:
Which sObject type(s) are returning a field with the soapType tns:json?

Update: Raised as case 23206206

3

Apparently, there is a bug on Salesforce API v45.0 which leaks the new type JSON designed for Salesforce API v46.0. This is observed on the APIEvent object on the RecordData field whose type is json. Here is a plug from the documentation:

RecordData

Type json Properties Nillable Description A JSON string that represents the queried objects’ metadata. This metadata includes the number of results of a query per entity type and the entity IDs. Example

{ "totalSize" : 1,
  "done" : true,
  "records" : [ {
    "attributes" : {
      "type" : "Account"
    },
    "Id" : "001xx000003DMvCAAW",
    "Contacts" : {
      "totalSize" : 3,
      "done" : true,
      "records" : [ {
        "attributes" : {
          "type" : "Contact"
        },
        "Id" : "003xx000004U7xKAAS"
      }, {
        "attributes" : {
          "type" : "Contact"
        },
        "Id" : "003xx000004U7xLAAS"
      }, {
        "attributes" : {
          "type" : "Contact"
        },
        "Id" : "003xx000004U7xMAAS"
      } ]
    }
  } ]
}

This is already reported to Salesforce and they have worked on it. Currently, the support did suggest to disable the beta which wasn't what we expected though.

Known Issue: DescribeSObject call using the v45.0 Partner API are failing due to a complex type(json) that isn't defined in the WSDL

0

Since ApiEvent (introduce in 36) and ApiEventStream (introduce in 41) are no longer for only customers with Real-Time Event Monitoring, preview org using with the API 46 available can have access to the definition of both objects. Meaning: if we describe the Salesforce Org using the REST or SOAP api v45 , we will have access to those objects.

Those objects use the field 'RecordData' of type 'json'.

  • 1
    I believe all orgs are on v46 (or higher) now. So if you are using the Partner API to describe all sObject types it will need to be updated to v46 at least or you will get errors around the json complex type coming back in the response. – Daniel Ballinger Jun 26 at 20:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.