• professore
  • NEWBIE
  • 55 Points
  • Member since 2011

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 18
    Replies

Hi

 

As in the subject.  For all other data stores (Accounts, Opportunities, Leads etc) it works perfectly. The system works by selecting the ID of the relevant data store (e.g. for Documents it's a DocumentID, Accounts is AccountID etc ... ) and then saving an Attachment with the data store ID as the Attachment  parent ID.

 

For Campaigns the error I get back is :

 

insufficient access rights on cross-reference id

 

For Documents I get :

 

Parent ID: ID value of incorrect type

 

Any ideas what the problem might be ?

 

Thanks

 

Hi,

 

 

  • Is it possible to have a single API key for an organisation ?
  • Is it possible to disable the feature that when the username and password changes, the API key does too ?

 

 

Thanks

 

 

Hi

 

I need to be able to work out if a user has permission to attach an attachment to a tab, and also to a record, in salesforce.  For example Opportunities allows attachments but Leads do not.  Also perhaps certain records might have read only permissions.

 

What fields should I look at ? I am using the SOAP messaging API.

 

Thanks

 

Bob

I have developed an API connection with Visual C++ 6.  It works great for my user but when other users try to login they get access denied.  What do I need to enable to allow them to log on ?

 

I am using the developer version of salesforce currently.

 

Thanks

Hi,

 

Not sure if anyone can help, but I am trying to send a gzip encoded POST request and failing miserably. Below is my code ...

 

I think someone who has done this would be able to tell me a .if it's possible and b if so how to do it.

 

Thanks

 

Bob


  IXMLDOMDocument2Ptr pXMLDoc = NULL;
  EVAL_HR(pXMLDoc.CreateInstance("Msxml2.DOMDocument.6.0"));
  // Load the document asynchronously
  pXMLDoc->async = true;
 MyApp* pApp = ((CSyntaxis2App*)AfxGetApp());
  string source_file;
  source_file = pApp->GetWorkingDirectory() + "\\SOAPCall.xml";
  //Check the content type
  // Step 3: Create XMLHTTP and send a POST request to the Web service
  IXMLHTTPRequestPtr pXH = NULL;
  EVAL_HR (pXH.CreateInstance("Msxml2.XMLHTTP.5.0"));
 COleVariant vPostURL(m_csEndpointURL + m_csEndpointSuffix,VT_BSTR);
  EVAL_HR (pXH->open("POST", vPostURL.bstrVal, 
  _variant_t(VARIANT_FALSE), _variant_t(""), _variant_t("")));
  string dest_file = source_file + ".gz";
  if(m_bUseCompression)
  {
  EVAL_HR (pXH->setRequestHeader("Content-Encoding", "gzip"));
  GZip gzip;
  FILE* source = fopen(source_file.c_str(),"rb");
  FILE* dest = fopen(dest_file.c_str(),"wb");
  if(gzip.compress(source,dest,-1) != Z_OK)
  {
  m_csLastError = "Failed compressing source file in SOAPAPIBase::Execute()";
  fclose(source);
  fclose(dest);
  return FALSE;
  }
  fclose(source);
  fclose(dest);
  unlink(source_file.c_str());
  source_file = dest_file;
  }
  _bstr_t btSourceFile(source_file.c_str());
  pXMLDoc->load(btSourceFile);
  unlink(source_file.c_str());
  vector<CSOAPAPIParameterPair>::iterator iter;
  iter = m_vCustomHTTPHeaders.begin();
  CString strHeader,strHeaders;
  iter = m_vCustomHTTPHeaders.begin();
  while(iter != m_vCustomHTTPHeaders.end())
  {
  COleVariant vtName(iter->m_csName,VT_BSTR);
  COleVariant vtValue(iter->m_csValue,VT_BSTR);
  EVAL_HR (pXH->setRequestHeader(vtName.bstrVal,vtValue.bstrVal));
  iter++;
  }
  if(m_bUseCompression)
  EVAL_HR (pXH->send(btSourceFile));
  else
  EVAL_HR (pXH->send(pXMLDoc->xml));

Hi,

 

How long should this take ? To upload takes 20 seconds and to use the create call after base64 encoding is taking about 1 minute 30 seconds. Is this normal ?

 

I am using IXMLHTTPRequestPtr in Visual C++ to send the xml.

 

Thanks

I have the following problem.  I need to be able to create attachments in salesforce from my client app.  These are mostly Word documents. Many of them have a lot of hi-res images. This means for a typical file size of 3 -4 MB even the most efficient base 64 encoders take 20 + minutes.  If I upload the same file manually to salesforce it takes 20 seconds.

 

Is there any alternative to base64 encoding ?

Hi,

 

I am trying to add an attachment to an opportunity using a SOAP message.  Below is the soap message :

 

 

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:enterprise.soap.sforce.com" xmlns:urn1="urn:sobject.enterprise.soap.sforce.com">
   <soapenv:Header>
      <urn:SessionHeader>
         <urn:sessionId>00DA0000000aBVb!AREAQBukBuFfuoatmzmtcp4lg8rPIobjbXbosShxu._d7g_eRrrZVh3fmaXH.CAesIQmGyvUPjF5oTMnYXGwoODbSz7Fbrvs</urn:sessionId>
      </urn:SessionHeader>
   </soapenv:Header>
   <soapenv:Body>
      <urn:create>
  <urn:Name>zxcxzcxzc.doc</urn:Name>
 <urn:Body> BASE 64 stuff in here ... </urn:Body>
         <urn:sObjects urn:type="Attachment">
            <urn1:fieldsToNull>true</urn1:fieldsToNull>
    <urn1:ParentId>006A0000006dGDkIAM</urn1:ParentId>
    <urn1:OwnerId>005A0000000KRJv</urn1:OwnerId>
    <urn1:ContentType>doc</urn1:ContentType>
         </urn:sObjects>
      </urn:create>
   </soapenv:Body>
</soapenv:Envelope>

 

 

I get the following response :

 

 

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sf="urn:fault.enterprise.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

   <soapenv:Body>

      <soapenv:Fault>

         <faultcode>sf:INVALID_TYPE</faultcode>

         <faultstring>INVALID_TYPE: Must send a concrete entity type.</faultstring>

         <detail>

            <sf:InvalidSObjectFault xsi:type="sf:InvalidSObjectFault">

               <sf:exceptionCode>INVALID_TYPE</sf:exceptionCode>

               <sf:exceptionMessage>Must send a concrete entity type.</sf:exceptionMessage>

               <sf:row>-1</sf:row>

               <sf:column>-1</sf:column>

            </sf:InvalidSObjectFault>

         </detail>

      </soapenv:Fault>

   </soapenv:Body>

</soapenv:Envelope>

 

 

The doc is an MS Word doc.  Any ideas what I am doing wrong ? I am able to run queries no problem.

 

Thanks,

 

Prof

 

 

Hi

 

As in the subject.  For all other data stores (Accounts, Opportunities, Leads etc) it works perfectly. The system works by selecting the ID of the relevant data store (e.g. for Documents it's a DocumentID, Accounts is AccountID etc ... ) and then saving an Attachment with the data store ID as the Attachment  parent ID.

 

For Campaigns the error I get back is :

 

insufficient access rights on cross-reference id

 

For Documents I get :

 

Parent ID: ID value of incorrect type

 

Any ideas what the problem might be ?

 

Thanks

 

Hi,

 

 

  • Is it possible to have a single API key for an organisation ?
  • Is it possible to disable the feature that when the username and password changes, the API key does too ?

 

 

Thanks

 

 

I have developed an API connection with Visual C++ 6.  It works great for my user but when other users try to login they get access denied.  What do I need to enable to allow them to log on ?

 

I am using the developer version of salesforce currently.

 

Thanks

Hi,

 

Not sure if anyone can help, but I am trying to send a gzip encoded POST request and failing miserably. Below is my code ...

 

I think someone who has done this would be able to tell me a .if it's possible and b if so how to do it.

 

Thanks

 

Bob


  IXMLDOMDocument2Ptr pXMLDoc = NULL;
  EVAL_HR(pXMLDoc.CreateInstance("Msxml2.DOMDocument.6.0"));
  // Load the document asynchronously
  pXMLDoc->async = true;
 MyApp* pApp = ((CSyntaxis2App*)AfxGetApp());
  string source_file;
  source_file = pApp->GetWorkingDirectory() + "\\SOAPCall.xml";
  //Check the content type
  // Step 3: Create XMLHTTP and send a POST request to the Web service
  IXMLHTTPRequestPtr pXH = NULL;
  EVAL_HR (pXH.CreateInstance("Msxml2.XMLHTTP.5.0"));
 COleVariant vPostURL(m_csEndpointURL + m_csEndpointSuffix,VT_BSTR);
  EVAL_HR (pXH->open("POST", vPostURL.bstrVal, 
  _variant_t(VARIANT_FALSE), _variant_t(""), _variant_t("")));
  string dest_file = source_file + ".gz";
  if(m_bUseCompression)
  {
  EVAL_HR (pXH->setRequestHeader("Content-Encoding", "gzip"));
  GZip gzip;
  FILE* source = fopen(source_file.c_str(),"rb");
  FILE* dest = fopen(dest_file.c_str(),"wb");
  if(gzip.compress(source,dest,-1) != Z_OK)
  {
  m_csLastError = "Failed compressing source file in SOAPAPIBase::Execute()";
  fclose(source);
  fclose(dest);
  return FALSE;
  }
  fclose(source);
  fclose(dest);
  unlink(source_file.c_str());
  source_file = dest_file;
  }
  _bstr_t btSourceFile(source_file.c_str());
  pXMLDoc->load(btSourceFile);
  unlink(source_file.c_str());
  vector<CSOAPAPIParameterPair>::iterator iter;
  iter = m_vCustomHTTPHeaders.begin();
  CString strHeader,strHeaders;
  iter = m_vCustomHTTPHeaders.begin();
  while(iter != m_vCustomHTTPHeaders.end())
  {
  COleVariant vtName(iter->m_csName,VT_BSTR);
  COleVariant vtValue(iter->m_csValue,VT_BSTR);
  EVAL_HR (pXH->setRequestHeader(vtName.bstrVal,vtValue.bstrVal));
  iter++;
  }
  if(m_bUseCompression)
  EVAL_HR (pXH->send(btSourceFile));
  else
  EVAL_HR (pXH->send(pXMLDoc->xml));

I have the following problem.  I need to be able to create attachments in salesforce from my client app.  These are mostly Word documents. Many of them have a lot of hi-res images. This means for a typical file size of 3 -4 MB even the most efficient base 64 encoders take 20 + minutes.  If I upload the same file manually to salesforce it takes 20 seconds.

 

Is there any alternative to base64 encoding ?

Hi,

 

I am trying to add an attachment to an opportunity using a SOAP message.  Below is the soap message :

 

 

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:enterprise.soap.sforce.com" xmlns:urn1="urn:sobject.enterprise.soap.sforce.com">
   <soapenv:Header>
      <urn:SessionHeader>
         <urn:sessionId>00DA0000000aBVb!AREAQBukBuFfuoatmzmtcp4lg8rPIobjbXbosShxu._d7g_eRrrZVh3fmaXH.CAesIQmGyvUPjF5oTMnYXGwoODbSz7Fbrvs</urn:sessionId>
      </urn:SessionHeader>
   </soapenv:Header>
   <soapenv:Body>
      <urn:create>
  <urn:Name>zxcxzcxzc.doc</urn:Name>
 <urn:Body> BASE 64 stuff in here ... </urn:Body>
         <urn:sObjects urn:type="Attachment">
            <urn1:fieldsToNull>true</urn1:fieldsToNull>
    <urn1:ParentId>006A0000006dGDkIAM</urn1:ParentId>
    <urn1:OwnerId>005A0000000KRJv</urn1:OwnerId>
    <urn1:ContentType>doc</urn1:ContentType>
         </urn:sObjects>
      </urn:create>
   </soapenv:Body>
</soapenv:Envelope>

 

 

I get the following response :

 

 

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sf="urn:fault.enterprise.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

   <soapenv:Body>

      <soapenv:Fault>

         <faultcode>sf:INVALID_TYPE</faultcode>

         <faultstring>INVALID_TYPE: Must send a concrete entity type.</faultstring>

         <detail>

            <sf:InvalidSObjectFault xsi:type="sf:InvalidSObjectFault">

               <sf:exceptionCode>INVALID_TYPE</sf:exceptionCode>

               <sf:exceptionMessage>Must send a concrete entity type.</sf:exceptionMessage>

               <sf:row>-1</sf:row>

               <sf:column>-1</sf:column>

            </sf:InvalidSObjectFault>

         </detail>

      </soapenv:Fault>

   </soapenv:Body>

</soapenv:Envelope>

 

 

The doc is an MS Word doc.  Any ideas what I am doing wrong ? I am able to run queries no problem.

 

Thanks,

 

Prof