function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
alal 

using query always returns 'missing scope'

Have played with this for a number of days now.

We are using XML-RPC with salesforce API 2.0.

We have tried Java and VisualBasic with the same results.

Note that we can perform the login and describe calls without problem.

When we try to query anything (not search), we get this error:

<?xml version="1.0" encoding="UTF-8" ?><methodResponse><fault><value><struct><member><name>faultString</name><value>missing scope in query call</value></member><member><name>faultCode</name><value><int>1100</int></value></member></struct></value></fault></methodResponse>

Here is one of our queries:

----------------------------------------------------------------

<?xml version="1.0" encoding="UTF-8" ?>
<methodCall>
  <methodName>sfdc.query</methodName>
  <params><param><value><struct>
    <member>
      <name>version</name>
      <value><string>2.0</string></value>
    </member>
    <member>
      <name>type</name>
      <value><string>contact</string></value>
    </member>
    <member><name>filter</name>

    <value><array><value><struct>
    <member><name>operator</name><value>or</value></member>

 <member><name>value</name>
 <value><struct><member><name>operator</name>
 <value>starts with</value></member>
 <member><name>field</name><value>00N30000000bpgc</value></member>
 <member><name>value</name><value>TR</value></member></struct></value></member>

 <member><name>value</name>
 <value><struct><member><name>operator</name>
 <value>starts with</value></member>
 <member><name>field</name><value>00N30000000bpgc</value></member>
 <member><name>value</name><value>ET</value></member></struct></value></member>

 <member><name>value</name>
 <value><struct><member><name>operator</name>
 <value>starts with</value></member>
 <member><name>field</name><value>00N30000000bpgc</value></member>
 <member><name>value</name><value>EN</value></member></struct></value></member>

  </struct></value></array></value></member>

    <member>
      <name>select</name>
      <value><array>
        <value>accountID</value>
        <value>lastName</value>
        <value>firstName</value>
        <value>email</value>
      </array></value>
    </member>
  </struct></value></param></params></methodCall>

---------------------------------------------------

 

The fieldnames came from the describe call on the contacts.

There is no mention of 'scope' in the API manual, other than a reference to the type of data

we are querying (contact in this case).

We are sort of stuck.  Anyone have an idea? Anyone have a XML-RPC query that works?

 

Thanks for any assistance,

Al G

AlterPoint

DevAngelDevAngel

Hi Al,

First, which version of the documenation are you looking at?  In the 2.0 documentation for the query call the scope parameter is clearly defined.

That not withstanding, you need to include a scope parameter with any query call.  In the case of the query you are trying to make, the scope is "filter".

    <member>
      <name>scope</name>
      <value><string>filter</string></value>
    </member>

Cheers

alal

Downloaded PDF file at end of last week.

Scope is not mentioned, and is not in any of the 'query' XML-RPC examples either.

 

Thanks for the info anyhow, we will continue to march on.

 

Al G

AlterPoint

DevAngelDevAngel

Hi Al,

Downloaded at the end of last week.  Hmm....  It must have been updated since. 

http://www.salesforce.com/us/pdf/misc/sforce_API_reference_manual.pdf

Cheers.

alal

In this download I see scope mentioned in the table for the XML-RPC query call.

You will note that the XML-RPC sample for a query is still wrong though.

The sample does not have 'scope', and I think the xml formatting of the array is off

as the samples still do give errors like this:

<name>faultString</name><value>value of filter criterion for or operator must be of type array</value></member><member><name>faultCode</name>

Just an FYI for you. Its not to nitpick, but without your assistance we can only use trial and error to figure these things out.

In our case, this has cost us 4 work days and we still cannot get any queries to work.

Keep in mind that I can create a report online in under 5 minutes.

To do the same report via the API takes days to create and is a few hundred lines of code.

In fact, if we do not get the API query working by 5PM, we will drop the API and just define reports in salesforce.com that we will use HTTPS 'page scraping' to get to. That's less than 100 lines of code to implement and then we can just setup or edit reports online in much less time.

Thanks again for your priceless assistance.

Al G

AlterPoint

DevAngel2DevAngel2

Hi Al,

If I understand you last post, you are still unable to get a filter query to work, correct?

Below is the structure for a filter member, it's a simple filter but should provide some clues.

               <member>
                  <name>filter</name>
                  <value>
                     <array>
                        <data>
                           <value>
                              <struct>
                                 <member>
                                    <name>field</name>
                                    <value>
                                       <string>id</string>
                                    </value>
                                 </member>
                                 <member>
                                    <name>value</name>
                                    <value>
                                       <string>00630000000cwAE</string>
                                    </value>
                                 </member>
                              </struct>
                           </value>
                        </data>
                     </array>
                  </value>
               </member>