This discussion is archived
7 Replies Latest reply: Nov 12, 2010 12:56 AM by SaleGuru RSS

GWWS does not accept CDATA

SaleGuru Newbie
Currently Being Moderated
Hi,

I implement a service with three FML32 fields: FI_DATUM, ROUTING_INST and ROUTING_DIS. In the field FI_DATUM I want to put XML data using CDATA syntax.
Here is the simple SOAP-request message:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:pack.OCA_SRV_typedef.salt11">
<soapenv:Header/>
<soapenv:Body>
<urn:OCA_SRV>
<urn:inbuf>
<urn:FI_DATUM><![CDATA[this is some text]]></urn:FI_DATUM>
<urn:ROUTING_INST>1</urn:ROUTING_INST>
<urn:ROUTING_DIS>34</urn:ROUTING_DIS>
</urn:inbuf>
</urn:OCA_SRV>
</soapenv:Body>
</soapenv:Envelope>

from GWWS I got the following answer:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>SOAP-ENV:Client</faultcode>
<faultstring>GWWS_CAT:1022: SOAP Error: Invalid SOAP Body.</faultstring>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Can someone explain why this happens ? For a perfect SOAP-message I got "Invalid SOAP Body". Does this means that GWWS does not support CDATA?

The HTTP-Header is:
POST http://10.32.22.60:51209/OCA_SRV HTTP/1.1
Content-Type: text/xml;charset=iso-8859-1
SOAPAction: "OCA_SRV"
User-Agent: Jakarta Commons-HttpClient/3.1
Host: 10.32.22.60:51209
Content-Length: 454

thanks,

Sasa
  • 1. Re: GWWS does not accept CDATA
    Todd Little Expert
    Currently Being Moderated
    Hi Sasa,

    I'm not sure if this is the issue and maybe it's just a typo in your simple SOAP-request message or some weirdness in how the forums rendered what you typed. But normally a CDATA section ends with ]]> yet I don't see that terminating sequence in your post. Also, although you don't explicitly state this, I'm assuming the FML32 fields are of type FLD_STRING. Could you also post your service metadata description of the Tuxedo service?

    Regards,
    Todd Little
    Oracle Tuxedo Chief Architect
  • 2. Re: GWWS does not accept CDATA
    SaleGuru Newbie
    Currently Being Moderated
    Hi Todd,

    this was a typo in my SOAP-message.
    Here is the service metadata description of the OCA_SRV service:

    ============================
    service=OCA_SRV
    tuxservice=OCA_SRV
    servicetype=service
    inbuf=FML32
    outbuf=FML32
    param=FI_DATUM
    type=string
    access=inout
    size=64000
    requiredcount=1
    param=ROUTING_INST
    type=string
    access=inout
    size=16
    param=ROUTING_DIS
    type=string
    access=inout
    size=3
    ============================

    and here is the FML32 field description:

    *base 100
    # name number type flags comments
    ...
    FI_DATUM 22 string - -
    ...
    ROUTING_INST 24 string - -
    ...
    ROUTING_DIS 26 string - -

    I hope it helps!

    Thanks in advance,

    Sasa
  • 3. Re: GWWS does not accept CDATA
    651249 Journeyer
    Currently Being Moderated
    Sasa,

    I would give some comments here also other customers can benefit from this.

    GWWS does not support CDATA's contents to be mapped to Tuxedo buffer. For XML in Tuxedo STRING case, this is also not a rare usage. Usually the web service programming tool will normalize the XML to a "string" representation and GWWS will delivery the true XML to Tuxedo server. It also applies to Tuxedo service that if a service return a XML string in a Tuxedo STRING buffer, GWWS will normalize it and the web service client will get an exact XML string same as in Tuxedo service.
    But if SOAP UI is used to test GWWS service, the normalization has to be done manually.

    Regards,
    Wayne
  • 4. Re: GWWS does not accept CDATA
    SaleGuru Newbie
    Currently Being Moderated
    Hi Wayne,

    it is interesting to note, that the next example will deliver XML inside a CDATA element from GWWS:

    Here is the input:

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:pack.OCA_SRV2_typedef.salt11">
    <soapenv:Header/>
    <soapenv:Body>
    <urn:OCA_SRV2>
    <urn:inbuf>
    <urn:FI_DATUM>&lt;?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?&gt;
    &lt;If version="1.00.11.00_196"&gt;
    &lt;adsAdresse&gt;
    &lt;aktion&gt;S&lt;/aktion&gt;
    &lt;adsAdresseAdresse&gt;
    &lt;adresseId&gt;7313271&lt;/adresseId&gt;
    &lt;plzArt&gt;6&lt;/plzArt&gt;
    &lt;plz&gt;*&lt;/plz&gt;
    &lt;ortsname&gt;*&lt;/ortsname&gt;
    &lt;ortsteil&gt;*&lt;/ortsteil&gt;
    &lt;ortszusatz&gt;*&lt;/ortszusatz&gt;
    &lt;strasse&gt;*&lt;/strasse&gt;
    &lt;hausNr&gt;*&lt;/hausNr&gt;
    &lt;hausNrZusatz&gt;*&lt;/hausNrZusatz&gt;
    &lt;kgs&gt;*&lt;/kgs&gt;
    &lt;/adsAdresseAdresse&gt;
    &lt;/adsAdresse&gt;
    &lt;/If&gt;</urn:FI_DATUM>
    <urn:ROUTING_INST>1</urn:ROUTING_INST>
    <urn:ROUTING_DIS>292</urn:ROUTING_DIS>
    </urn:inbuf>
    </urn:OCA_SRV2>
    </soapenv:Body>
    </soapenv:Envelope>

    and the output:

    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tuxedo="urn:pack.OCA_SRV2_typedef.salt11">
    <SOAP-ENV:Body>
    <tuxedo:OCA_SRV2Response>
    <tuxedo:outbuf>
    <tuxedo:FI_DATUM><![CDATA[<?xml version="1.0" encoding="ISO-8859-1" standalone="yes" ?><If version="17.02.01.00_7020"><adsAdressListe><aktion>L</aktion><adsAdrListeMeldungen><meldung><code>0</code><text>ERROR_SUCCESS</text></meldung></adsAdrListeMeldungen><adsAdrListe><adsAdresse><modifiziertZeitpunkt>28.02.2006 10:12:50</modifiziertZeitpunkt><feldPb>B</feldPb><nutzer><kennung>004204228</kennung></nutzer><service>N</service><bestaetigt>J</bestaetigt><adsAdresseAdresse><hausNr>46</hausNr><strasse>Selma-Lagerlöf-Str.</strasse><adresseId>7313271</adresseId><ortsteil>Trudering-Riem</ortsteil><plz>81829</plz><ortsname>München</ortsname><laenderkennung>DEU</laenderkennung><kgs>09162000</kgs><plzArt>6</plzArt></adsAdresseAdresse></adsAdresse></adsAdrListe></adsAdressListe></If>]]></tuxedo:FI_DATUM>
    <tuxedo:ROUTING_INST>1</tuxedo:ROUTING_INST>
    <tuxedo:ROUTING_DIS>292</tuxedo:ROUTING_DIS>
    </tuxedo:outbuf>
    </tuxedo:OCA_SRV2Response>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>


    I wanted to use toXML function and get a string and put it inside CDATA and send it, but this is not possible with GWWS, so I have to normilize it myself as you wrote.

    The tuxedo service should be called from a BPEL process and there I have to do something similiar to this:
    ...
    <xsl:template match="/">
    <ns0:input_fml>
    <xsl:attribute name="ROUTING_INST">
    <xsl:text disable-output-escaping="no">99</xsl:text>
    </xsl:attribute>
    <xsl:attribute name="ROUTING_DIS">
    <xsl:text disable-output-escaping="no">ADS_IF20</xsl:text>
    </xsl:attribute>
    <xsl:attribute name="FI_DATUM">
    <xsl:text>&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;</xsl:text>
    <xsl:apply-templates select="/client:TransformationRequest/RequestData/*"/>
    </xsl:attribute>
    </ns0:input_fml>
    </xsl:template>
    <xsl:template match="*">
    <xsl:text>&lt;</xsl:text>
    <xsl:value-of select="local-name()"/>
    <xsl:text>&gt;</xsl:text>
    <xsl:choose>
    <xsl:when test="count(./*)=0">
    <xsl:value-of select="."/>
    </xsl:when>
    <xsl:otherwise>
    <xsl:apply-templates select="./*"/>
    </xsl:otherwise>
    </xsl:choose>
    <xsl:text>&lt;/</xsl:text>
    <xsl:value-of select="local-name()"/>
    <xsl:text>&gt;</xsl:text>
    </xsl:template>
    </xsl:stylesheet>


    which you cannot do in Design View in JDeveloper 10.1.3.3.4 for example. So the problem is not just Soap UI, but everywhere where you need to put XML as a string in another XML. All our tuxedo services accept XML-string in FI_DATUM element. Therefore we have to normalize it before we call the tuxedo service, instead of just using the string from toXML enclosed in CDATA element.

    thanks.

    best regards,
    Sasa
  • 5. Re: GWWS does not accept CDATA
    SaleGuru Newbie
    Currently Being Moderated
    in the last reply the CDATA element was not correctly interpreted, it should be this:

    <tuxedo:FI_DATUM> CDATA_BEGIN <?xml version="1.0" encoding="ISO-8859-1" standalone="yes" ?><If version="17.02.01.00_7020"><adsAdressListe><aktion>L</aktion><adsAdrListeMeldungen><meldung><code>0</code><text>ERROR_SUCCESS</text></meldung></adsAdrListeMeldungen><adsAdrListe><adsAdresse><modifiziertZeitpunkt>28.02.2006 10:12:50</modifiziertZeitpunkt><feldPb>B</feldPb><nutzer><kennung>004204228</kennung></nutzer><service>N</service><bestaetigt>J</bestaetigt><adsAdresseAdresse><hausNr>46</hausNr><strasse>Selma-Lagerlöf-Str.</strasse><adresseId>7313271</adresseId><ortsteil>Trudering-Riem</ortsteil><plz>81829</plz><ortsname>München</ortsname><laenderkennung>DEU</laenderkennung><kgs>09162000</kgs><plzArt>6</plzArt></adsAdresseAdresse></adsAdresse></adsAdrListe></adsAdressListe></If> CDATA_END></tuxedo:FI_DATUM>

    Edited by: SaleGuru on 24.02.2009 03:47
  • 6. Re: GWWS does not accept CDATA
    651249 Journeyer
    Currently Being Moderated
    Hi Sasa,

    Not sure why GWWS accepts your last CDATA message:). But I would not like to encourage do that. If the XML string put to the string in programming manner, the normalization at application level is not needed. For example, I can access Tuxedo service through axis by,
    "
    try {

    String send = "<abc>a</abc>";

    TuxedoWebServiceStub stub = new TuxedoWebServiceStub();

    TuxedoWebServiceStub.ToUpperWS request = new TuxedoWebServiceStub.ToUpperWS();



    request.setInbuf( send );



    TuxedoWebServiceStub.ToUpperWSResponse

    response = stub.ToUpperWS( request );



    String ret = response.getOutbuf();

    System.out.println( "Sent '" + send + "'" );

    System.out.println( "Got '" + ret + "'" );

    } catch (Exception e) {

    System.err.println( e.toString() );

    }



    "

    Wayne
  • 7. Re: GWWS does not accept CDATA
    SaleGuru Newbie
    Currently Being Moderated
    thx

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points