As I promised, here is the update. Salesforce.com now has fixed the problem in their SOAP API 2.0( I used 1.8 so far). Now they add cf_ to the beginning of an element name for custom data fields.
Colin -----Original Message----- From: Colin Ma Sent: Tuesday, July 22, 2003 9:05 AM To: '[EMAIL PROTECTED]' Subject: RE: Can an element name begin with numbers? Thanks to all of you who have offered info on this seemly silly question. Well, let me give some information on the circumstances. 1. Salesforce.com, our CRM vendor does use element names beginning with '00'. It has to do with the fact that their custom database columns are named in such a way and such column names in turn are used as element names. I agree with everyone that it is against XML standards since the XML 1.0 spec says a name should start with a letter, '_' or ':'. But salesforce.com has been using it for a while. 2. Salesforce.com use such naming convention for both its XML-SOAP API and XML-RPC API. Strangely I do have a XML-RPC implementation that accepts such names without problems. That led me to believe that some XML parsers must accept such names, even though it is against the standard. That is why I posted this message in the first place to see whether you are aware of any XML parsers that work with AXIS 1.1 and accept such names. In fact, I'm going to talk to folks at Salesforce.com to see what they are going to say. Will they insist on such names or will they agree to change the names to follow the standard? I'll let you guys know. Thanks, Colin Ma -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 22, 2003 5:12 AM To: [EMAIL PROTECTED] Subject: Re: Can an element name begin with numbers? No, it must not. See the XML spec, in production rule for NAME. First character must be "alphabetic", although you can use any script supported by Unicode. But you cannot use numbers from any script. Just put some prefix befor the element name, say "n". It doesn't matter which namespace you use. QNAME (qyualified names) use the NAME production, so don't even try. ============================================= Marcelo Jaccoud Amaral Petrobras - TI - Neg�cios Eletr�nicos mailto:jaccoud [at] petrobras.com.br voice: +55 21 2534-3485 fax: +55 21 2534-1809 ============================================= There are only 10 kinds of people in the world: those who understand binary and those who don't. Colin Ma <[EMAIL PROTECTED] Para: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]> ct.com> cc: (cco: Marcelo Jaccoud Amaral/RJ/Petrobras) Assunto: Can an element name begin with numbers? 2003-07-21 20:57 Favor responder a axis-user Hi there, I am a newbie to AXIS and SOAP. I just ran into a rather simple problem and I hope some of you there have the answers. I appreciate it if you can shed light on the problem. Here is the problem: I have a SOAP message which uses element names begining with numbers. I believe it causes the parsing to fail. Below are the SOAP message and the error message. Can someone tell me know to work around it, supposed that the element name has to begin with numbers? (By the way XML-RPC accepts it without problems). Many thanks. Colin Ma MedImpact Following is the message: HTTP/1.0 200 OK Server: Resin/2.1.9 Content-Type: text/xml; charset=UTF-8 Date: Mon, 21 Jul 2003 23:19:19 GMT <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="salesforce" xmlns:types="salesforce/encodedTypes" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" > <soap:Header/> <soap:Body> <return> <value xsi:type="tns:array"> <valueMap xsi:type="tns:map"> <type xsi:type="xsd:string">Test</type> <contactID xsi:type="xsd:string">00330000000v58X</contactID> <caseNumber xsi:type="xsd:string">00004277</caseNumber> <00N30000000bnSZ xsi:type="xsd:string">Marketing</00N30000000bnSZ> <ownerID xsi:type="xsd:string">00530000000bpXP</ownerID> <id xsi:type="xsd:string">5003000000093Fr</id> </valueMap> </value> </return> </soap:Body></soap:Envelope> Here is the error message I got with AXIS 1.1. Exception in thread "main" AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException faultSubcode: faultString: org.xml.sax.SAXParseException: The content of elements must consist of well-formed character data or marku p. faultActor: faultNode: faultDetail: {http://xml.apache.org/axis/}stackTrace: org.xml.sax.SAXParseException: The content of elements must consist of well-formed character data or markup. at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at javax.xml.parsers.SAXParser.parse(Unknown Source) at org.apache.axis.encoding.DeserializationContextImpl.parse(DeserializationCon textImpl.java:242) at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:538) at org.apache.axis.Message.getSOAPEnvelope(Message.java:376) at org.apache.axis.client.Call.invokeEngine(Call.java:2583) at org.apache.axis.client.Call.invoke(Call.java:2553) at org.apache.axis.client.Call.invoke(Call.java:2248) at org.apache.axis.client.Call.invoke(Call.java:2171) at org.apache.axis.client.Call.invoke(Call.java:1691) at salesforce.SalesforceConnectorBindingStub.query(SalesforceConnectorBindingSt ub.java:439) at salesforce.TestCase.myTest(TestCase.java:99) at salesforce.TestCase.main(TestCase.java:118)
