We have imported a wsdl from a thirdparty. This gives us a set of interfaces with methods to call, and classes for parameters and returnvalues.
Now, the thirdparty have told us that one of the widestring values that we pass has to be wrapped in a CData-section.
In Delphi 2007, is there a way of controlling how a given property is converted into xml in a soaprequest, so that we can control if the value gets encoded or not, and if the value should be wrapped in a cdata-section or not?
Or do we control this by either encode the value or not, and wrap the value our self?
regards,
-Vegar
Cdata sections are simply character values that don’t need the usual XML escaping. For example, you can have a literal
<character instead of escaping it with<. That’s all Cdata is. If the vendor said the value must be in a Cdata section, then I see two possibilities:If it’s the former, then ignore the vendor’s instructions and continue creating ordinary text nodes with your XML library. The library’s serializer will escape the characters that need escaping automatically.
But if it’s the latter, then you should tell the vendor its system is broken. If it can’t handle Cdata correctly, what else is it doing wrong? Unless your vendor is very responsive, I think you’re out of luck. With Delphi SOAP, you’re not in control of how the XML is generated. You don’t provide an
IDomDocument, so you don’t get to callcreateCdataSectionon it to control the structure of the request your program sends.