• Barry L
  • NEWBIE
  • 0 Points
  • Member since 2003

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 4
    Replies

I'm not sure where to put this, so I'll start here. 

I spend a lot of time working with databases, and after reading the SFDC API documentation, I didn't think that I would ever get it right, so I wrote a .NET provider in the style of Sytem.Data.SqlClient.  It uses SfdcConnection, SfdcCommand, and a language syntax that looks like SQL wrapped in XML.  Only 'select' is supported - no insert/update/delete.  The output can be fed directly into a DataSet.  While I was at it, I added a few SQL-like things:

  • Standarizes naming conventions (all uppercase with underscores)
  • Automatically generates friendly names for custom fields from labels
  • Strong data typing
  • Rename columns
  • Reorder columns
  • An 'in' operator so you don't have to write all of those 'or' statements
  • Enforces NOT NULL constraints

Sample code looks like this (contents of CONNECTION_STRING and XMLSQL not shown) :
          SfdcConnection conn = new SfdcConnection(CONNECTION_STRING);
          SfdcCommand com = conn.CreateCommand();
          com.CommandText  = XMLSQL;
          com.CommandType  = SfdcCommandType.XMLSQLText;
   
          //-- Populate the dataset 
          DataSet dataSet1 = new DataSet();
          dataSet1.ReadXml(com.ExecuteXmlReader());

There's also a simple query tool in the style of MS Query Analyzer.  You can just type into it and hit F5 to get results back in a grid.  You can also watch the request going to SFDC.  Originally, this was my testing harness, so it's a little rough, but it's great if you need help developing complex "WHERE" statements.

Barry

P.S.  Some help testing would be appreciated, but this is alpha code, so be nice.

P.P.S. Although it's written in .NET, internally, it's designed with a Java port in mind.  I just don't need it in Java right now.

http://www.armeta.com/download/SfdcClient/SfdcClient.zip

I moved this to the General Board.  Please look there.

Message Edited by Barry L on 11-06-2003 01:09 PM

Hi,

As a company, we tend to prefer working in XML technologies directly. Being new to SFDC development, I assumed that I'd go the XML-RPC, however, from reading the boards and looking at the toolkits, it seems as if SOAP is the preferred method.  This kind of suprized me, since we generally think of SOAP as a stopgap measure until XML-RPC is fully adopted.  Maybe we're out of synch with everyone else.

Some questions:

1) Are there XML-RPC samples and code that I've missed?

2) What's "native" API and archtecture?  I'm assuming that XML-RPC and SOAP are both layers over a native Java implementation.  If so, is there a performance difference between the two layers?  Normally, I'd expect XML-RPC to be much faster.

3) What's the recommended XML-RPC client for .NET developers?  One would think that HttpWebRequest/HttpWebResponse would work just fine.

Thanks,

Barry

I'm not sure where to put this, so I'll start here. 

I spend a lot of time working with databases, and after reading the SFDC API documentation, I didn't think that I would ever get it right, so I wrote a .NET provider in the style of Sytem.Data.SqlClient.  It uses SfdcConnection, SfdcCommand, and a language syntax that looks like SQL wrapped in XML.  Only 'select' is supported - no insert/update/delete.  The output can be fed directly into a DataSet.  While I was at it, I added a few SQL-like things:

  • Standarizes naming conventions (all uppercase with underscores)
  • Automatically generates friendly names for custom fields from labels
  • Strong data typing
  • Rename columns
  • Reorder columns
  • An 'in' operator so you don't have to write all of those 'or' statements
  • Enforces NOT NULL constraints

Sample code looks like this (contents of CONNECTION_STRING and XMLSQL not shown) :
          SfdcConnection conn = new SfdcConnection(CONNECTION_STRING);
          SfdcCommand com = conn.CreateCommand();
          com.CommandText  = XMLSQL;
          com.CommandType  = SfdcCommandType.XMLSQLText;
   
          //-- Populate the dataset 
          DataSet dataSet1 = new DataSet();
          dataSet1.ReadXml(com.ExecuteXmlReader());

There's also a simple query tool in the style of MS Query Analyzer.  You can just type into it and hit F5 to get results back in a grid.  You can also watch the request going to SFDC.  Originally, this was my testing harness, so it's a little rough, but it's great if you need help developing complex "WHERE" statements.

Barry

P.S.  Some help testing would be appreciated, but this is alpha code, so be nice.

P.P.S. Although it's written in .NET, internally, it's designed with a Java port in mind.  I just don't need it in Java right now.

http://www.armeta.com/download/SfdcClient/SfdcClient.zip

Is there a Query sample which includes construction of the "NOT" operation?

I'm trying to construct a filter something like: firstName starts with "abc" and NOT lastName contains "xyz"

My attempts so far result in "value of filter criterion for not must be of type struct".

Hi.

I'm trying to create a complex query that can be made up of 2-n conditions by parsing a psuedo sql statement. This is working fine when using just 2 statements. when I up this to 3 statements the code bombs out with a stack overflow error.

Algorithmically I am:

creating a simple Query statement.
creating a second simple query statement.
combining these into a complex query using makeAndOrFilter function.

creating a third simple query statement.
combining this into a complex query using the makeAndOrFilter funtion and the previously created complex query.


Is the nesting of queries in this way supported? or can I only create complex queries when I have an even number of query statements to use as the example QueryFilter.java file?

my succesfull soap request is detailed below:


OST /servlet/servlet.SoapApi HTTP/1.0
Content-Type: text/xml; charset=utf-8
Accept: application/soap+xml, application/dime, multipart/related, text/*
User-Agent: Axis/1.1
Host: na1-api.salesforce.com
Cache-Control: no-cache
Pragma: no-cache
SOAPAction: "sfconnector:SalesforceConnector#query"
Content-Length: 2836





s23uXwpju4AY_wPjB1t.K.VclJYSpLhLHkoVtihD5pMHQNt0.3NyFs6j_tlxtBQiBK_XYAh9q6xyi4Rib7quMvbtzKggVlhL
2.0




filter
user
1

id




value



field
username


value
joe.bloggs@address.com.au


operator
equals




field
firstName


value
Joe


operator
equals





operator
and




1970-02-01T06:03:16.838Z
false


Message Edited by Richard on 10-17-2003 10:26 AM

Hi guys,

Does anyone out there have a piece of code to insert the results of a query into a dataset?

Thanks!

Hi,

As a company, we tend to prefer working in XML technologies directly. Being new to SFDC development, I assumed that I'd go the XML-RPC, however, from reading the boards and looking at the toolkits, it seems as if SOAP is the preferred method.  This kind of suprized me, since we generally think of SOAP as a stopgap measure until XML-RPC is fully adopted.  Maybe we're out of synch with everyone else.

Some questions:

1) Are there XML-RPC samples and code that I've missed?

2) What's "native" API and archtecture?  I'm assuming that XML-RPC and SOAP are both layers over a native Java implementation.  If so, is there a performance difference between the two layers?  Normally, I'd expect XML-RPC to be much faster.

3) What's the recommended XML-RPC client for .NET developers?  One would think that HttpWebRequest/HttpWebResponse would work just fine.

Thanks,

Barry