You need to sign in to do that
Don't have an account?
hjethava1.3969505581221326E12
Getting Error "Transport error: 411 Error: Length Required" when trying to get Objects using Branded Cloudforce URL
We have a Salesforce connector for API version 26 as well as 28 for extracting the data using corresponding WSDL from a Salesforce Org. We are able to get objects and extract data for customer which does not use branded Cloudforce URL.
But We are facing issue when we try to extract the data from a Salesforce Org which has branded cloudforce URL.
We get Transport error: 411 Error: Length Required when trying get objects for user and when we try to extract the data.
Following is code snippet where we are getting this error(It gives above error when we call stub.describeGlobal(..)) :
stub = createStub();
DescribeGlobal describeGlobal = new DescribeGlobal();
PackageVersionHeader packageVersionHeader = new PackageVersionHeader();
DescribeGlobalResponse dgrs = stub.describeGlobal(describeGlobal, sessionHeader, co, packageVersionHeader);
It fails with following Error from salesforce side:
Transport error: 411 Error: Length Required
...
at com.sforce.soap.partner.SforceServiceStub.describeGlobal(SforceServiceStub.java:10059)
Note: we are passing sessionHeader,CallOptions correctly.
Code Snippet for same:
Options options = stub._getServiceClient().getOptions();
String SFDCClientID = getBirstParameter(SFDC_CLIENT_ID);
if (SFDCClientID != null && SFDCClientID.trim().length() > 0)
{
co = new CallOptions();
co.setClient(SFDCClientID);
}
SforceServiceStub stub = new SforceServiceStub(stubServerUrl);
Options options = stub._getServiceClient().getOptions();
options.setProperty(HTTPConstants.MC_ACCEPT_GZIP, Boolean.TRUE);
options.setProperty(HTTPConstants.MC_GZIP_REQUEST, Boolean.TRUE);
options.setTimeOutInMilliSeconds(timeoutInMilliseconds);
options.setProperty(HTTPConstants.AUTO_RELEASE_CONNECTION, Constants.VALUE_TRUE);
Also Note that we use SOAP API and use WSDL to provide us the default login URL for to connect and upon connect, we use the URL return by the Salesforce for data extraction.
Can someone suggest us on how we can fix this issue.
But We are facing issue when we try to extract the data from a Salesforce Org which has branded cloudforce URL.
We get Transport error: 411 Error: Length Required when trying get objects for user and when we try to extract the data.
Following is code snippet where we are getting this error(It gives above error when we call stub.describeGlobal(..)) :
stub = createStub();
DescribeGlobal describeGlobal = new DescribeGlobal();
PackageVersionHeader packageVersionHeader = new PackageVersionHeader();
DescribeGlobalResponse dgrs = stub.describeGlobal(describeGlobal, sessionHeader, co, packageVersionHeader);
It fails with following Error from salesforce side:
Transport error: 411 Error: Length Required
...
at com.sforce.soap.partner.SforceServiceStub.describeGlobal(SforceServiceStub.java:10059)
Note: we are passing sessionHeader,CallOptions correctly.
Code Snippet for same:
Options options = stub._getServiceClient().getOptions();
String SFDCClientID = getBirstParameter(SFDC_CLIENT_ID);
if (SFDCClientID != null && SFDCClientID.trim().length() > 0)
{
co = new CallOptions();
co.setClient(SFDCClientID);
}
SforceServiceStub stub = new SforceServiceStub(stubServerUrl);
Options options = stub._getServiceClient().getOptions();
options.setProperty(HTTPConstants.MC_ACCEPT_GZIP, Boolean.TRUE);
options.setProperty(HTTPConstants.MC_GZIP_REQUEST, Boolean.TRUE);
options.setTimeOutInMilliSeconds(timeoutInMilliseconds);
options.setProperty(HTTPConstants.AUTO_RELEASE_CONNECTION, Constants.VALUE_TRUE);
Also Note that we use SOAP API and use WSDL to provide us the default login URL for to connect and upon connect, we use the URL return by the Salesforce for data extraction.
Can someone suggest us on how we can fix this issue.
options.setProperty(HTTPConstants.MC_ACCEPT_GZIP, Boolean.FALSE);
options.setProperty(HTTPConstants.MC_GZIP_REQUEST, Boolean.FALSE);
options.setProperty(HTTPConstants.CHUNKED,false);
Can someone help us understand why would this be a problem only for branded cloudforce url only?
I have exactly this problem with the salesforce adapter, and so far cannot get the web service working any help would be awesome, thanks.
Hello All,
Please refer the below code:
Enjoy My Dost....!!!!!!