Results 1 to 2 of 2

Thread: XML inside XML without CDATA

  1. #1
    Join Date
    Mar 2010
    Posts
    1

    Default XML inside XML without CDATA

    Hello everyone,

    I have a question and I am kind of new to spring and webservices.

    I want to create a webservice for our customers. This webservice should validate xml files (different xml files with different xsd's).
    So my step-into method has two parameters (String xmldata, String xmltype)

    The xmltype is the kind of xml file that needs to be validated, the xmldata should be the xml content.

    Now I want to test this webservice with Altova XML Spy and it is working if I use

    PHP Code:
                <xmldata><![CDATA[
                    <
    CSFile version="1.05">
                        <
    Message>
                            <
    SenderID>HLCU</SenderID>
                            <
    ReceiverID>XX</ReceiverID>
                            <
    Timezone>Europe/Berlin</Timezone>
                            <
    MessageID>892</MessageID>
                            <
    MessageDate>
                                <
    DateTime>2010-03-24T00:00:00</DateTime>
                            </
    MessageDate>
                        </
    Message>
                        <
    File>
                            <
    FileNumber>
                                <
    Number>HLCUBC1100305947</Number>
                                <
    Company Code="001"/>
                                <
    Office Code="WOB"/>
                            </
    FileNumber>
                        </
    File>
                    </
    CSFile>
                    ]]>
                </
    xmldata
    But I want that without the <![CDATA[ tags. Is that possible?
    I thought about an other annotation or a different data type then String as argument, but without any luck.

    Can somebody give me a hint or tell me what I have to look for?

    Thanks a lot and many greetings,
    Hauke

  2. #2
    Join Date
    May 2007
    Posts
    18

    Default

    You could try changing the following character(s)

    < with &lt;
    & with &amp;
    > with &gt;
    ' with &apos;
    " with &quot;

    I have had the misfortune of working with some web services where CDATA enclosures contain an XML document which is in turned parsed again once the XML payload is received as in the sample provided. I would recommend discontinue that practice if it's possible.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •