Regular Visitor
andrew21
Posts: 8
Registered: 03-01-2010

SOAP - escaping characters?

Hi, In experimenting with the SOAP api, I have a general question about SOAP that I ran into when using the query language (ZOQL).

 

Are SOAP messages supposed to be HTML-escaped ?

For example, the SOAP library i'm using for Ruby (soap4r) seems to be escaping all my XML text.

Thus some comparison operators such as >, <, and apostrophes (') will be escaped to their respective HTML escape sequences (ie. &gt; &lt; &apos:smileywink:.

 

What results is that I'm not able to send properly formatted requests in ZOQL.

 

I'm not an XML expert, so please correct me if I am wrong, but here's another page on XML-escaping:

http://www.rtslink.com/introductionxmlsoap.html

This seems to say that the SOAP requests should indeed be html-escaped for these special characteres.

 

If my ZOQL query is:

"select id from Account where AccountNumber='123'"  it is currently being sent to Zuora as:

"select id from Account where AccountNumber=&apos;123&apos;" 

 

Of course, this does not return the proper result.

 

Any suggestions?

Thanks !

 

 

Regular Visitor
liangzan
Posts: 9
Registered: 02-11-2010

Re: SOAP - escaping characters?

I'm also using Ruby. I've chosen Savon. My query method is below.

 

 

 def query(query_string)
    @client.query do |soap|
      soap.header = { "wsdl:SessionHeader" => {"wsdl:session" => @session_id } }
      soap.body = { "wsdl:queryString" => query_string }
    end
  end

It works fine for me.

 

Regular Visitor
andrew21
Posts: 8
Registered: 03-01-2010

Re: SOAP - escaping characters?

Thanks for the quick reply. I found that it was another error that led me to this query error.

 

In the end, my HTML-escaped queries were being processed just fine.

 

The HTML-escaped entities are parsed and interpreted as they should be.