Payload with CDATA

My requirement is I need to put the whole payload string with in CDATA tag.
Iam getting payload as String from SAP R/3 into XI and to third party system. Tird party system needs whole payload string with in CDATA tag.
When I do that all angular brackets,  quotations, ampersand <, >, ", & are turning to special characters &gt , &lt .
Please advise.

>
Farooq Farooqui wrote:
> >Tird party system needs whole payload string with in CDATA tag.
>
> What does means by this post? when you say whole payload..it means you are talking about complete xml..right?
>
> Are you sure that what you post is equal to what you implemented?
Yes I mean whole payload, remember Isaid whole payload is coming as string.
As I said it may not the good way to wrap the whole payload in CDATA, but it is working.
I tried Java map using DOM Parser, but I was stuck while the passing the input I received in output.
DocumentBuilder builderel = factory.newDocumentBuilder();
                                         //Document docIn = builderel.parse(in);
                                         //Create the output DOM
                                         Document docOut = builderel.newDocument();
                                         String msgName = "ns1:abcXMLRequest";
                                         String nameSpace="urn:com.abcdef.schemas:enttechservice:abc";
                                         root = docOut.createElement(msgName);
                                         root.setAttribute("xmlns:ns1", nameSpace);
                                         docOut.appendChild(root);
                                      Element idEl = docOut.createElement("applicationXMLString");
                                      root.appendChild(idEl);
                                          CDATASection cd = docOut.createCDATASection( got stuck here it expects a  string argument here); // I need to pass the input I recived in to XI as it is.
                                          root.appendChild(cd);
                         domS = new DOMSource(docOut);

Similar Messages

  • Proxy to SOAP Scenario, payload with the SOAP envelops

    Hi ,
    We have Scenario like Proxy to SOAP,As per Business requirement they are asking payload with ENVELOP . Like below message
    ================================================================
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding">
         <SOAP-ENV:Header>
              <nseps:endpoints xmlns:nseps="urn:schemas-IBX:/docs/endpoint.nsendpoint" SOAP-ENV:mustUnderstand="true">
                   <nseps:to>
                        <nseps:address>b2b2ce96-7a92-1000-910f-c0a8b4340001</nseps:address>
                   </nseps:to>
                   <nseps:from>
                        <nseps:address>b2b2ce96-7a92-1000-910f-c0a8b4340001</nseps:address>
                   </nseps:from>
              </nseps:endpoints>
              <nsprop:properties xmlns:nsprop="urn:schemas-IBX:/docs/property.nsproperty" SOAP-ENV:mustUnderstand="true">
                   <nsprop:identity>3198841w-fa4d-dafa-2797-89029c15255b</nsprop:identity>
                   <nsprop:sentAt>2010-01-18T02:42:08Z</nsprop:sentAt>
                   <nsprop:topic>CostObjectInformation</nsprop:topic>
              </nsprop:properties>
         </SOAP-ENV:Header>
         <SOAP-ENV:Body>
    //Payload of the message to be added here.
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    I am trying out this in XSLT, but I am not sure how to add the SOAP Envelops and these Envelops are Static.
    Can someone help me out in this.
    Joe

    But if you look at the SOAP Envelop Structure below it is not XI generated SOAP Envelop. IBX (3rd party) has its own standards, so XI has to Produce the SOAP Envelop according to their standards.
    I have created the XSD with SOAP Envelop stucture with what ever structure 3rd party wants, but the problem is when Creating the SOPA Envelp tag, where it has a ":" where its not allowing me to create the valid XSD. And at the same time 3rd party is not in position to give us even WSDL file and we are not using  Webservice call and they are not able to provide the XSD with SOAP envelop structure.
    I thought of going for XSLT and started doing as well with what ever XSD 3rd party has provided, which does not have the SOAP Envelop structure and has only payload XSD structure.
    80% of the SOAP Envelop structure is Static, it does not change. Only 2 fields keeps changing. IS there any solution that we can create XSD with the SOAP structure with Special Character ": "or is there any way in doing in XSLT.
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding">
    <SOAP-ENV:Header>
    <nseps:endpoints xmlns:nseps="urn:schemas-IBX:/docs/endpoint.nsendpoint" SOAP-ENV:mustUnderstand="true">
    <nseps:to>
    <nseps:address>b2b2ce96-7a92-1000-910f-c0a8b4340001</nseps:address>
    </nseps:to>
    <nseps:from>
    <nseps:address>b2b2ce96-7a92-1000-910f-c0a8b4340001</nseps:address>
    </nseps:from>
    </nseps:endpoints>
    <nsprop:properties xmlns:nsprop="urn:schemas-IBX:/docs/property.nsproperty" SOAP-ENV:mustUnderstand="true">
    <nsprop:identity>3198841w-fa4d-dafa-2797-89029c15255b</nsprop:identity>
    <nsprop:sentAt>2010-01-18T02:42:08Z</nsprop:sentAt>
    <nsprop:topic>CostObjectInformation</nsprop:topic>
    </nsprop:properties>
    </SOAP-ENV:Header>
    <SOAP-ENV:Body>
    its a high priority issue.
    Thanks in Advance.
    Joe.

  • BPM condition: Compare Payload with Constant

    Hi everybody,
    if I like to compare the payload with a constant, do I have to User
    a) MYCONSTANT
    b) 'MYCONSTANT'.
    Thanks, Ragards
    Mario

    Mario,
    Inside UDF? Then it is "MYCONSTANT"
    using std function? Then it is MYFUNCTION
    Regards,
    Jai Shankar

  • Payload with images processing

    Hello,
    My problem may be pretty common but i cannot decide on most suitable approach. So i turned to this forum where i always find an answer.
    I have to develop a flow, XML over JMS, to receive a message payload with number of images as base64Binary in specific elements e.g country, city, area
    <Payload>
    <country>
    <element/>
    <element/>
    <Image>EQ==</Image> <!-- Optional -->
    </country>
    <City>
    <element/>
    <element/>
    <CityImages><!-- Optional -->
    <Image>EQ==</Image>
    <Image>EQ==</Image>
    </Image>EQ==</Image>
    </CityImages>
    <Area>
    <element/>
    <element/>
    <Images> <!-- these images are must -->
    <Image1>EQ==</AreaImage1>
    <Image2>EQ==</AreaImage2>
    </Images>
    </Area
    </Payload>
    These images will be stored in a separate system before rest of the payload is forwarded to a different system.
    The system where images needs to be stored expose a web service and will return a unique image reference number for each image we store. Created a XQuery which will wrap all images in collection of documents sent to local service. And second XQuery will go through that collection of document and create a request payload for the image processing service. Second XQuery also assign Id to each image as serial number (1, 2, 3...) in the order they are present in the collection when it processes collection of document. The request to image web service goes as one payload with multiple images e.g. <DataSource><Query><id>1</id><image>EQ==</image></Query><Query><id>1</id><image>EQ==</image></Query></DataSource> with unique id and image content.Response contains Id and image reference number e.g. <QueryResult><result><id>1</id><ref>AB1312</ref><></result><result><id>2</id><ref>AB1124</ref><></result></QueryResult>.
    Images contents in original payload will then be replaced with the reference numbers returned from the images system.
    Now the problems i have is:
    1 - First Xquery which creates document collection goes through the payload and when it finds an image it create a document element but i am unable to generate unique ID, in xquery, for each image found in original payload. Second Xquery goes through document collection and uses 'at $count' in for loop as counter and assign that to Id attribute. Ideally unique id sould be generated in the flow or first xquery, instead of second xquery, some how and used as reference?
    2 - I intend to correlate returned image reference number based on the sequence(assumption) in which image appear in the original payload instead of using any cross refence mechanism.
    I seek guidance on my solution on how best to correlate image reference number with corresponding image in the original payload.
    Many Thanks for help!
    Sall0

    You can use the fn-bea:uuid() xquery function to generate unique id's for each image in the first xquery.
    For correlating the image ref no to the actual image in the payload , what you are following based on sequence looks ok, since there is no reference available for each image on the original payload, kind of using the image index within the original payload looks fine.

  • Has anyone used an XML payload with AQ on 9i?

    No problems with Raw types but can't find any examples of sending and XML doc as the payload. Getting the following error from the snippet I have included.
    oracle.AQ.AQException: JMS-195: Invalid object type: object must implement CustomDatum/ORAData or SQLData interface
    The queue payload is defined as an XMLType.
    /* Creating a message to contain raw payload: */
    message = queue.createMessage();
    /* Get handle to the ObjectPayload object and populate it with data: */
    Document doc = DOMBuilder.buildIt();
    obj_payload = message.getObjectPayload();
    obj_payload.setPayloadData(doc);
    /* Creating a AQEnqueueOption object with default options: */
    enq_option = new AQEnqueueOption();
    /* Enqueue the message: */
    queue.enqueue(enq_option, message);
    System.out.println("Successful enqueue");

    Which version are you using? I also had problems with XML as the payload with 9i Rel. 1. I upgraded to Rel. 2 and it works o.k.

  • Fatal error when updating Payload with Java hw Worklist API

    Hi all,
    I am receiving an error when I want to update some non-String-type fields
    of a task payload. I access the fields in the payload with facade-classes, generated by Schemac.
    The fact is that I can read all the payload fields, but when I try to set values in non-String typed fields of the payload I'm getting a run-time error:
    java.lang.NullPointerException at EDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap.hash(ConcurrentReaderHashMap.java:308) at EDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap.get(ConcurrentReaderHashMap.java:427) at org.collaxa.thirdparty.dom4j.tree.NamespaceCache.get(NamespaceCache.java:82) at org.collaxa.thirdparty.dom4j.Namespace.get(Namespace.java:60) at com.collaxa.cube.xml.dom.DOMUtil.createElement(DOMUtil.java:382) at com.collaxa.cube.xml.dom.DOMUtil.createElement(DOMUtil.java:350) at com.collaxa.cube.xml.BaseFacade.setChildElementValue(BaseFacade.java:323) at nl.nak.www.ns.vocht.Userpayload.setAge(Userpayload.java:327) at nl.nak.gui.action.ProcessTaskAction.execute(ProcessTaskAction.java:107) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482) at nl.nak.gui.custom.CustomActionServlet.process(CustomActionServlet.java:35) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:810) at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:322) at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:790) at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:270) at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112) at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192) at java.lang.Thread.run(Thread.java:534)
    My XSD file for the payload looks like this:
    <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.comp.nl/ns/vocht"
         xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://www.comp.nl/ns/vocht">
    <element name="userpayload">
    <complexType>
    <sequence>
    <element name="name" type="xsd:string" />
    <element name="lastname" type="xsd:string" />
    <element name="age" type="xsd:int" />
    <element name="amount" type="xsd:decimal"
    </complexType>
    </element>
    </schema>
    The code where I make a connection to the
    WorkList service and how I retrieve the payload is listed below.
    Note that a specific task is set in the Session at in a previous step:
    try{
    String user="jcooper";
    String password="welcome";
    //maak een verbinding
    RemoteWorklistServiceClient client = new RemoteWorklistServiceClient();
    client.init();
    out.println("connectie geinitialiseerd");
    //authenticatie
    IWorklistContext ctx = client.authenticateUser(user, password);
    Userpayload ut = (Userpayload) UserpayloadFactory.createFacade(payload);
    ut.setName("tom");
    ut.setLastname("Cooper");
    //EXCEPTION THROWN HERE
    ut.setAge(1);
    ut.setAmount(new BigDecimal(2));
    taak.setPayload(ut.getRootElement());
    String action = "DONE";
    client.customTaskOperation(ctx, taak.getTaskId(), action);
    out.println("taak geapproved :: "+payload.toString())
    return null;
    catch(Exception e)
    //PRINT DEBUG INFORMATIE
    e.printStackTrace(new PrintWriter(out));
    sp.addActionError(errors,"nl.nak.view.standaard.errors.system",null);
    saveErrors(request,errors);
    return null; //mapping.findForward("failure");
    At run-time the null-pointer exception is thrown when the Age field is set.
    Can anynone help me with this problem?
    Thanks in advance!
    Tom Hofte
    Message was edited by:
    [email protected]

    If it is a stored procedure, the action should be EXECUTE and not UPDATE and the structure should be similar to this:
    <StatementName5>
    <storedProcedureName action=u201D EXECUTEu201D>
        <table>realStoredProcedureeName</table>
    <param1 [isInput=u201Dtrueu201D] [isOutput=true] type=SQLDatatype>val1</param1>
    </storedProcedureName > 
      </StatementName5>
    From help.sap
    Regards,
    Prateek

  • Problem while creating xml with cdata section

    Hi,
    I am facing problem while creating xml with cdata section in it. I am using Oracle 10.1.0.4.0 I am writing a stored procedure which accepts a set of input parameters and creates a xml document from them. The code snippet is as follows:
    select xmlelement("DOCUMENTS",
    xmlagg
    (xmlelement
    ("DOCUMENT",
    xmlforest
    (m.document_name_txt as "DOCUMENT_NAME_TXT",
    m.document_type_cd as "DOCUMENT_TYPE_CD",
    '<![cdata[' || m.document_clob_data || ']]>' as "DOCUMENT_CLOB_DATA"
    ) from table(cast(msg_clob_data_arr as DOCUMENT_CLOB_TBL))m;
    msg_clob_data_arr is an input parameter to procedure and DOCUMENT_CLOB_TBL is a pl/sql table of an object containing 3 attributes: first 2 being varchar2 and the 3rd one as CLOB. The xml document this query is generating is as follows:
    <DOCUMENTS>
    <DOCUMENT>
    <DOCUMENT_NAME_TXT>TestName</DOCUMENT_NAME_TXT>
    <DOCUMENT_TYPE_CD>BLOB</DOCUMENT_TYPE_CD>
    <DOCUMENT_CLOB_DATA>
    &lt;![cdata[123456789012345678901234567890123456789012]]&gt;
    </DOCUMENT_CLOB_DATA>
    </DOCUMENT>
    </DOCUMENTS>
    The problem is instead of <![cdata[....]]> xmlforest query is encoding everything to give &lt; for cdata tag. How can I overcome this? Please help.

    SQL> create or replace function XMLCDATA_10103 (elementName varchar2,
      2                                             cdataValue varchar2)
      3  return xmltype deterministic
      4  as
      5  begin
      6     return xmltype('<' || elementName || '><![CDATA[' || cdataValue || ']]>
      7  end;
      8  /
    Function created.
    SQL>  select xmlelement
      2         (
      3            "Row",
      4            xmlcdata_10103('Junk','&<>!%$#&%*&$'),
      5            xmlcdata_10103('Name',ENAME),
      6            xmlelement("EMPID", EMPNO)
      7         ).extract('/*')
      8* from emp
    SQL> /
    <Row>
      <Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
      <Name><![CDATA[SMITH]]></Name>
      <EMPID>7369</EMPID>
    </Row>
    <Row>
      <Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
      <Name><![CDATA[ALLEN]]></Name>
      <EMPID>7499</EMPID>
    </Row>
    <Row>
      <Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
      <Name><![CDATA[WARD]]></Name>
      <EMPID>7521</EMPID>
    </Row>
    <Row>
      <Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
      <Name><![CDATA[JONES]]></Name>
      <EMPID>7566</EMPID>
    </Row>
    <Row>
      <Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
      <Name><![CDATA[MARTIN]]></Name>
      <EMPID>7654</EMPID>
    </Row>
    <Row>
      <Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
      <Name><![CDATA[BLAKE]]></Name>
      <EMPID>7698</EMPID>
    </Row>
    <Row>
      <Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
      <Name><![CDATA[CLARK]]></Name>
      <EMPID>7782</EMPID>
    </Row>
    <Row>
      <Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
      <Name><![CDATA[SCOTT]]></Name>
      <EMPID>7788</EMPID>
    </Row>
    <Row>
      <Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
      <Name><![CDATA[KING]]></Name>
      <EMPID>7839</EMPID>
    </Row>
    <Row>
      <Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
      <Name><![CDATA[TURNER]]></Name>
      <EMPID>7844</EMPID>
    </Row>
    <Row>
      <Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
      <Name><![CDATA[ADAMS]]></Name>
      <EMPID>7876</EMPID>
    </Row>
    <Row>
      <Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
      <Name><![CDATA[JAMES]]></Name>
      <EMPID>7900</EMPID>
    </Row>
    <Row>
      <Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
      <Name><![CDATA[FORD]]></Name>
      <EMPID>7902</EMPID>
    </Row>
    <Row>
      <Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
      <Name><![CDATA[MILLER]]></Name>
      <EMPID>7934</EMPID>
    </Row>
    14 rows selected.
    SQL>

  • OSB input payload with characters ' '  ' ' fails service invoke

    Hi,
    In OSB I am calling a USM service to search the contents. Created a Business Service out of USM Search WSDL and then a proxy service which calls the business service. When I am trying to test the service through SOAP UI with the below payload I get an error: *<faultstring>Error parsing the XML resource. The tag 'contains' has not been properly closed. Instead, the tag 'sear:queryText' was encountered.</faultstring>*
    and when I run the same payload through OSB test console get an error:
    The XML document is not well-formed:
    error: </sear:queryText> does not close tag <contains>.
    The same works in SOA Process but in OSB
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.stellent.com/Search/">
       <soapenv:Header/>
       <soapenv:Body>
          <ns1:AdvancedSearch>
             <ns1:queryText>(xIdcProfile<matches>`xxAB`)<AND>(x_ID<contains>`13-AZXX001-TST`)</ns1:queryText>
             <ns1:sortField>dInDate</ns1:sortField>
             <ns1:sortOrder>DESC</ns1:sortOrder>
          </sear:AdvancedSearch>
       </soapenv:Body>
    </soapenv:Envelope>Now if I replaced *<* with *&lt;* and *>* with *&gt;* it works fine.
    the below payload just works fine
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.stellent.com/Search/">
       <soapenv:Header/>
       <soapenv:Body>
          <ns1:AdvancedSearch>
             <ns1:queryText>(xIdcProfile&lt;matches&gt;`xxAB`)&lt;AND&gt;(x_ID&lt;contains&gt;`13-AZXX001-TST`)</ns1:queryText>
             <ns1:sortField>dInDate</ns1:sortField>
             <ns1:sortOrder>DESC</ns1:sortOrder>
          </sear:AdvancedSearch>
       </soapenv:Body>
    </soapenv:Envelope>But the consumers of this service pass the data in this format *(xIdcProfile<matches>`xxAB`)<AND>(x_ID<contains>`13-AZXX001-TST`)* only. How do I make sure OSB takes in this format payload and executes it properly.
    As the same thing works in Oracle SOA Process but in OSB it just chokes out. Any help is appreciated.
    Thanks

    Like others mentioned, the XML which your service consumer is sending is not a valid XML because of the special characters and you need to escape them.
    1. The best way is to ask the service consumer to send a proper XML with any special characters put in a CDATA section or escaped.
    2. If above is not possible, then you need to make sure that your first Proxy service which receives the message from service consumer is of Messaging type with text as input message format. AnyXML,AnySOAP or WSDL based services will error out because these types of services expect a proper valid XML document as input.
    So in the messaging type service, you read the input message as text and then use the fn-bea:inlined-XML() and fn-bea:serialize() functions or CDATA to create a valid XML from the text input and pass this XML to your business service.

  • AQ Adapter dequeue of xmltype payload with opaque schema doesn't work

    I am using 10.1.3.4 of SOA suite. I have a AQ with xmltype payload. In the dequeue operation I don't want to specify the xsd, so using opaque schema option.
    then the variable created will have opaque as part name and opaqueElement for the body of the payload. But during runtime I only see the variable with part.
    Design Time(JDEV):
    Has the following structure-
    'Receive_Dequeue_InputVariable','opaque','/ns2:opaqueElement'
    RunTime:
    <?xml version="1.0" encoding="UTF-8" ?>
    - <Receive_Dequeue_InputVariable>
    - <part>
    - <programUpdate xmlns="http://apollo/soa/internal/student">
    <ns1:finAidCertified xmlns:ns1="http://apollo/soa/internal/student">Y</ns1:finAidCertified>
    <ns1:programVersion xmlns:ns1="http://apollo/soa/internal/student">v1</ns1:programVersion>
    <ns1:program xmlns:ns1="http://apollo/soa/internal/student">m10</ns1:program>
    </programUpdate>
    </part>
    </Receive_Dequeue_InputVariable>
    Looks to me as bug.
    The question is whether there is any workaround. Or a better way to handle this ?
    Thanks

    I don't think so, I think you are getting mixed up between what is defined in the DB, and what is defined in the BPEL process.
    On the DB it is defined as xmltype, not Opaque therefore when it is read into BPEL it shows this. The question here is are the types compatible, was any error generated here.
    cheers
    James

  • XML Payload with attachment idoc to rnif

    Hi Experts,
    I am doing the scenario Idoc to RNIF. i have to pick up some1234 .pdf , fieldticket.pdf files and attached to the xml payload of out put and send it to the customers. How can we do this. please any one help me. If you have any documents please send me.

    Anyone working/worked with RNIF adapter would like to share their experience.

  • Soap receiver adapter payload with certficate signature

    I have a requirement.. where XI calls external webservice using SOAP.
    I have configured SOAP receiver adapter, but the webservice wants the certificate authentication.. From XI we sent the certficate to external webservice and then in the comm channel I did activate the 'certficate' check box. It did not work.
    For test purpose now they have deactivated the certficate authentication in their end.. it works if they deactivate. It means there is no issue with request structure.. purely the issue is when I use the certficate.
    External webservice sent me the copy of the soap request which works for them.. <b>that has security signature inside the payload.</b>  ( I have atteched below).
    If anybody has done it have an idea how to do it please let me know.
    - <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    - <soapenv:Header>
    - <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
      <wsse:BinarySecurityToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3" wsu:Id="CertId-62149565">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</wsse:BinarySecurityToken>
    - <ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
    - <ds:SignedInfo>
      <ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
      <ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
    - <ds:Reference URI="#id-24819136">
    - <ds:Transforms>
      <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
      </ds:Transforms>
      <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
      <ds:DigestValue>6Mzpm7P8k3f8UuxbBMP4ZTC83Yc=</ds:DigestValue>
      </ds:Reference>
      </ds:SignedInfo>
      <ds:SignatureValue>HcqMChOzlHFXTRRAf7kyTSQ5Jd53Yiu7oFLjkh5P3vayo2G4sjFv/qFKHX0E6a5xkBMTIRrW+30t7IdB4X0x35FPO1dTulz37KM1/jpLSGVxnjnWWeFZvseVjJsk5NTPiSE6GAjO7rFW/Vled2djATTmZsIgJCIfhLYVp112Uis=</ds:SignatureValue>
    - <ds:KeyInfo Id="KeyId-21369792">
    - <wsse:SecurityTokenReference xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="STRId-29015968">
      <wsse:Reference URI="#CertId-62149565" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3" />
      </wsse:SecurityTokenReference>
      </ds:KeyInfo>
      </ds:Signature>
      </wsse:Security>

    go through this webinar and follow the steps...It will solve your problem..
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/1b657d59-0c01-0010-4fa8-f792fa412823
    Regards,
    Ravi

  • Java Mapping with CDATA

    One simplest way is read the data element value as the string and ignore first  six or seven characters by using substring method or so... Use the return value string for parsing the values from respective tag element using parser or manually

    Hi Xinaxu,
    Here is the java mapping code.
    public class Cdata implements StreamTransformation{
         public static void main(String[] args) {
              try{
                   Cdata genFormat=new Cdata();
                   FileInputStream in=new FileInputStream("C:\\Apps\\acm\\cdata.xml");
                   FileOutputStream out=new FileOutputStream("C:\\Apps\\acm\\cdata1.xml");
                   genFormat.execute(in,out);
                   catch(Exception e)
                   e.printStackTrace();
         public void execute(InputStream in, OutputStream out)
                   throws StreamTransformationException {
              try
                   DocumentBuilderFactory factory=DocumentBuilderFactory.newInstance();
                   DocumentBuilder builderel=factory.newDocumentBuilder();
                   /*input document in form of XML*/
                   Document docIn=builderel.parse(in);
                   /*document after parsing*/
                   Document docOut=builderel.newDocument();
                   TransformerFactory tf=TransformerFactory.newInstance();
                   Transformer transform=tf.newTransformer();
                   Element root,child,child1;
                   root=docOut.createElement("Header");
                   root.setAttribute("xmlns","urn:bp:xi:hr:edm:test:100");
                   NodeList l;
                   Node n;
                   l=docIn.getElementsByTagName("Data");
                   int i,len=l.getLength();
                   String charSet[]={"&lt;","&gt;","&amp;","&apos;","&quot;"};
                   String replaceSet[]={"<",">","&","'","\""};
                   for(i=0;i<len;++i)
                        child=docOut.createElement("Data");
                        if(l.item(i).hasChildNodes())
                             n=l.item(i).getFirstChild();
                             //System.out.println(n.getNodeType());
                             //System.out.println(n.getNodeValue());
                             int j;
                             if(n.getNodeType()==3 && n.getNodeValue().indexOf("CDATA")>=0)
                                  // that means this is Cdata section
                                  //capture data in a string
                                  String s=n.getNodeValue();
                                  /*if you are sure that string contains
                                   * valid xml tags. You can parse
                                   * the tags.First replace
                                   * &lt; with < less than
                                     &gt; with > greater than
                                     &amp; with & ampersand 
                               &apos; with ' apostrophe
                               &quot; with " quotation mark
                               to avoid exceptions
                                  //System.out.println("s="+s);
                                  for(j=0;j<charSet.length;++j)
                                       s=s.replaceAll(charSet[j], replaceSet[j]);
                                  int ll;
                                  ll=s.length();
                                  String a="";
                                  int count=0;
                                  //extract only xml tags from string
                                  for(j=0;j<ll;++j)
                                       if(count<2)
                                            if(s.charAt(j)=='<')
                                                 count++;
                                            if(count<2)
                                                 continue;
                                       a=a+s.charAt(j);
                                  //System.out.println("a="+a);
                                  for(j=a.length()-1,count=0;j>=0;--j)
                                            if(a.charAt(j)=='>')
                                                 count++;
                                            if(count==2)
                                                 break;
                                  if(j>=0)
                                       s=a.substring(0,j+1);
                                  System.out.println(s);
                                  org.xml.sax.InputSource inStream = new org.xml.sax.InputSource();
                                 inStream.setCharacterStream(new java.io.StringReader(s));
                                  DocumentBuilder b=factory.newDocumentBuilder();
                                  Document cdataSection=b.parse(inStream);
                                  child1=(Element) docOut.importNode(cdataSection.getDocumentElement(),true);
                                  child.appendChild(child1);
                             else if(n.getNodeType()==4)
                                  // that means this is Cdata section
                                  //capture data in a string
                                  String s=n.getNodeValue();
                                  /*if you are sure that string contains
                                   * valid xml tags. You can parse
                                   * the tags.  replace invalid characters
                                   * before parsing
                                  for(j=0;j<charSet.length;++j)
                                       s=s.replaceAll(charSet[j], replaceSet[j]);
                                  org.xml.sax.InputSource inStream = new org.xml.sax.InputSource();
                                 inStream.setCharacterStream(new java.io.StringReader(s));
                                  DocumentBuilder b=factory.newDocumentBuilder();
                                  Document cdataSection=b.parse(inStream);
                                  child1=(Element) docOut.importNode(cdataSection.getDocumentElement(),true);
                                  child.appendChild(child1);
                        root.appendChild(child);
                   docOut.appendChild(root);
                   transform.transform(new DOMSource(docOut), new StreamResult(out));
              catch(Exception e)
                   e.printStackTrace();
         public void setParameter(Map arg0) {
              // TODO Auto-generated method stub
    Hope this solves your problem.
    regards
    Anupam

  • Problem with CDATA

    Hello
    I have this schema:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xs:schema targetNamespace="com/ejie/validationResponse/xml" xmlns:ns="com/ejie/validationResponse/xml" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
         <xs:element name="data">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element ref="ns:respuesta" maxOccurs="unbounded"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="respuesta" type="xs:string"/>     
         <xs:element name="serviceresponse">
              <xs:complexType>
                   <xs:sequence>                    
                        <xs:element ref="ns:data"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
    </xs:schema>
    and when i try to insert this in the "respuesta"
    <empresas><TIPOXML>OK</TIPOXML></empresas>
    it doesn't insert the CDATA and i want the CDATA to be inserted.
    if for example i insert this:
    <empresas><TIPOXML><value>OK</value></TIPOXML></empresas>
    it works ok ... i don't know why.
    The code i try is this way (very very simple)
    String sXML = "<empresas><TIPOXML>OK</TIPOXML></empresas>";
    ServiceresponseDocument srd = ServiceresponseDocument.Factory.newInstance();
    Serviceresponse sr = srd.addNewServiceresponse();
    Data data = sr.addNewData();
    data.addRespuesta(sXML);
    System.out.println(srd.xmlText());
    Even if i insert the CDATA manually then it appears:
    <[CDATA .........
    Any idea?
    thanks in advance
    Taja                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    And also with an XML that is more than 550 characters the CDATA is not added...
    We're lost. We have added the question also directly to bea but they don't respond.
    Any idea?
    For example:
    <empresas><TIPOXML><Value>OKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK</Value></TIPOXML></empresas>

  • Problem with CDATA and new line character

    I parse a xml document with org.w3c.dom, the document contain a CDATA section in which there are more lines of text, each line is terminated with the new line character (\n).
    Example:
    <nota>
    <[CDATA[
    first line
    second line
    third line
    ]]>
    </nota>
    When a parse this node:
    Text txt_nota=(Text)elm_nota.getFirstChild();
    String nota=txt_nota.getData();
    the value returned is one string with no new line characters, example:
    "first linesecond linethird line"
    what's wrong?

    Because i use the string nota into a jsp page and i print the string nota into a textarea and the text is with no newline, example:
    <textarea name="nota" rows="4" cols="60"><%= nota %></textarea>
    the text into textarea is:
    first linesecond linethird line
    but i want that the text displayed into textarea is equal the text into the CDATA section:
    first line
    second line
    third line

  • Replacing a value of a node with CDATA (as is)

    Hi All,
    How do I replace the value of a node such that it's CDATA format is preserved and not re-encoded. Currently, when I do similar to the following:
    replace value of node doc(doc_name)/parent/node with "<![CDATA[[the data]]]>"
    the less than and greater than signs are replaced with &lt ; and &gt ; respectively, losing its CDATA section status.
    How do I replace the value such that within the resulting XML it is exactly "<![CDATA[[the data]]]>" and not "&lt ;[CDATA[]the data]]&gt ;" ?
    Thanks in advance
    Cecil
    Edited by: user5969022 on Jan 8, 2009 9:41 PM
    Edited by: user5969022 on Jan 8, 2009 9:42 PM
    Edited by: user5969022 on Jan 8, 2009 9:44 PM
    Edited by: user5969022 on Jan 8, 2009 9:45 PM

    John,
    I am aware that it's synatic sugar. However, I actually need it to look that way. Thing is after edits, the resulting XML will be read by a component (that I have no access to change) which requires that node to have CDATA (as is) as it's value.
    Anymore ideas; Anyone?
    Instead of replacing the value (ie. replace value of node doc()...), I replaced the node (ie. replace node doc()...) with something similar to: <node>CDATA-section</node>. However, as expected only the data within the CDATA section gets persisted.
    In this case could I turn something off or on such that xmldb leaves the CDATA-section as is? e.g. http://www.xquery.com/tips_and_tricks/including_CDATA_in_results.html
    Thanks,
    Cecil

Maybe you are looking for