Skip Menu |

This queue is for tickets about the WWW-Salesforce CPAN distribution.

Report information
The Basics
Id: 75389
Status: new
Priority: 0/
Queue: WWW-Salesforce

People
Owner: Nobody in particular
Requestors: rjk [...] tamias.net
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.14
Fixed in: (no value)



Subject: Explicit types bypass SOAP::Lite handling, including string encoding
WWW::Salesforce::Constants sets explicit types for known fields. Known string fields are given the type 'xsd:string'. This bypasses SOAP::Lite's as_string() method, which would have called SOAP::Utils::encode_data() to encode < and &. This results in the following problematic behavior: $sforce->create(type => 'lead', Email => 'foo@example.com', Company => 'Foo & Bar', Custom__c => 'Bar & Foo'); ... <sObjects xsi:type="sfons:lead"> <sfons:Email xsi:type="xsd:string">foo@example.com</sfons:Email> <sfons:Company xsi:type="xsd:string">Foo & Bar</sfons:Company> <sfons:Custom__c xsi:type="xsd:string">Bar &amp; Foo</sfons:Industry__c> </sObjects> ... Observe that the value for Company was not encoded, but the value for Custom__c was. I believe the appropriate fix is to update WWW::Salesforce::Constants to remove the 'xsd:' from all the type names. If the type is 'string' instead of 'xsd:string', then SOAP::Lite will call as_string(), and the value will be encoded. Of course, this is not a backwards compatible change... WWW::Salesforce 0.14 SOAP::Lite 0.710.10 perl 5.10.1