I'm working on the legacy soap API to modify. I have to add an email body in the payload when I'm sending simple text it works fine when I send "<p>test</p>" or HTML it gives me an error.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:Server</faultcode>
<faultstring>com.ctc.wstx.exc.WstxParsingException: Unexpected '<' in attribute value
at [row,col {unknown-source}]: [32,57]</faultstring>
<detail/>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
my soap API written in ColdFusion 10
XSD
<xs:element name="parameter" minOccurs="0" maxOccurs="unbounded">
<xs:complexType mixed = "true">
<xs:attribute name="name" use="required">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="value" use="required" type="xs:string" />
</xs:complexType>
</xs:element>
You want to use encodeForXML (https://helpx.adobe.com/coldfusion/cfml-reference/coldfusion-functions/functions-e-g/encodeforxml.html) to escape the content first. If that's not available in CF10, the older XmlFormat (https://helpx.adobe.com/coldfusion/cfml-reference/coldfusion-functions/functions-t-z/xmlformat.html).