Adding an extra element to a XML message

Hello,
We are generating XML-files using DBMS_XMLQUERY on a Oracle Database 10g Enterprise Edition Release 10.2.0.3.0.
This works fine. But now one of our customers needs an extra element (header) in the XML file. How do I get this job done?
The XML-file needs to look like this:
<?xml version="1.0" encoding="UTF-8"?>
<aankomstBevestiging>
<header>
<retailPartnerCode>retailPartnerCode</retailPartnerCode>
<bestandsNaam>bestandsNaam</bestandsNaam>
<berichtNaam>berichtNaam</berichtNaam>
<berichtDatumTijd>2001-12-31T12:00:00</berichtDatumTijd>
</header>
<aankomst>
<artikelNummer>artikelNummer</artikelNummer>
<kleurNummer>kleurNummer</kleurNummer>
<maat>maat</maat>
<status>status</status>
<aantalOntvangen>1</aantalOntvangen>
<werkelijkeAankomstDatum>2001-01-01</werkelijkeAankomstDatum>
<ggb>1</ggb>
<goederenSoort>goederenSoort</goederenSoort>
</aankomst>
</aankomstBevestiging>
Currently the output looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<aankomstBevestiging>
<aankomst>
<artikelNummer>artikelNummer</artikelNummer>
<kleurNummer>kleurNummer</kleurNummer>
<maat>maat</maat>
<status>status</status>
<aantalOntvangen>1</aantalOntvangen>
<werkelijkeAankomstDatum>2001-01-01</werkelijkeAankomstDatum>
<ggb>1</ggb>
<goederenSoort>goederenSoort</goederenSoort>
</aankomst>
</aankomstBevestiging>
The code generating this XML:
procedure create_xml_file(
is
l_xml clob;
l_ctx DBMS_XMLQUERY.ctxhandle;
PROCEDURE clob_to_xml (p_file IN VARCHAR2,
p_clob IN CLOB,
p_dir in varchar2,
p_setrowsettag in varchar2 default 'Dataset',
p_setrowtag in varchar2 default 'Table'
IS
l_output UTL_FILE.file_type;
l_amt NUMBER DEFAULT 5000;
l_offset NUMBER DEFAULT 1;
l_length NUMBER DEFAULT NVL (DBMS_LOB.getlength (p_clob), 0);
BEGIN
l_output := UTL_FILE.fopen (p_dir, p_file, 'w', 32760);
WHILE (l_offset < l_length)
LOOP
UTL_FILE.put (l_output, DBMS_LOB.SUBSTR (p_clob, l_amt, l_offset));
UTL_FILE.fflush (l_output);
l_offset := l_offset + l_amt;
END LOOP;
UTL_FILE.new_line (l_output);
UTL_FILE.fclose (l_output);
END clob_to_xml;
BEGIN
l_ctx := DBMS_XMLQUERY.newcontext('select mvw.rpr_artikel_nr "artikelNummer",
mvw.rpr_kleur_nr "kleurNummer",
mvw.rpr_maat_code "Maat",
mat.locus_status_code "Status",
mat.ontvangen_aantal "aantalOntvangen",
mat.werkelijke_aankomst_datum "werkelijkeAankomstDatum",
mat.ontvangst_order_nr "ggb",
mat.ontvangst_order_nr "goederenSoort"
from wdp_magazijn_aankomsten mat
, wdp_rpr_artikel_maat_vw mvw
where mvw.maa_id = mat.maa_id;);
DBMS_XMLQUERY.setrowsettag (l_ctx, 'aankomstBevestiging' );
DBMS_XMLQUERY.setrowtag (l_ctx, 'aankomst');
DBMS_XMLQUERY.setdateformat (l_ctx, 'dd-MM-yyyy HH:mm:ss');
DBMS_XMLQUERY.setencodingtag (l_ctx, 'UTF-8');
l_xml := DBMS_XMLQUERY.getxml(l_ctx);
DBMS_XMLQUERY.closecontext (l_ctx);
clob_to_xml (p_file_name,l_xml, l_dir );
end if;
end;
/

Posted this messages also in PL/SQL XML programming
Adding an extra element to a XML message

Similar Messages

  • Namespace Element within Outbound XML Message

    Hi there,
    I am using XI 2.0 and trying to map an IDoc to an XML message to be passed onwards via JMS to a 3rd Party MQ System.
    I've created the mapping without too many issues but the 3rd Party says that I need to remove the namespace element tag from my final message as they don't want to see this (It's not in their DTD). Is there any way in XI 2.0 to suppress this part of the XML output so that you only get the main XML definition tag...
    i.e. rather than the final message being...
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MessageType xmlns:ns0="namespace">
    <first_tag>Data<first_tag/>...
    Instead produce...
    <?xml version="1.0" encoding="UTF-8"?>
    <first_tag>Data<first_tag/>...
    Any help would be much appreciated.
    Regards,
    Gordon

    Gordon--
    I think I have some good news, and some bad news.
    The good news is that you should be able to remove the namespace alias declaration attribute ('xmlns:ns0=...')  and namespace qualifiers ('ns0:[tagname]').  You can do this by writing a dispatcher function and adding it to the JMS adapter.
    The bad news is that this means you'll have to code the transformation that removes the tags.  Dispatchers are essentially the 'user exits' of XI.  This transformation can be either Java or XSLT -- XSLT is probably easier for a case like this.
    There is a touch of documentation about how to do this in the adapter engine online help (or the 'Adapter Engine' guide for XI 2.0 SR1).  See the sections for the JMS adapter for help on installing your dispatcher transformation.  See the section "Using the Dispatcher: Example" for a bit of help on using dispatchers.
    If you do it in Java, your dispatcher class will have to be accessible in the adapter engine classpath.  If you do it in XSLT, I'm not sure where the .xsl file goes -- perhaps in the Adapter Engine working directory?
    --Dan King
    Capgemini

  • [svn] 4277: Added descriptions for throttling in resources/config/ messaging-config.xml.

    Revision: 4277
    Author: [email protected]
    Date: 2008-12-10 09:03:08 -0800 (Wed, 10 Dec 2008)
    Log Message:
    Added descriptions for throttling in resources/config/messaging-config.xml.
    Modified Paths:
    blazeds/trunk/resources/config/messaging-config.xml

    Hey Everyone - a quick update. A very helpful friend gave me a hand figuring this out turns out the wikid process was failing because of a blog plist file. Replacing the metadata.plist files for all the users (whom had blogs in the collab data store) along with all the metadata.plist files for the groups as well got the service back up and running. When I say replace, I mean we renamed them all metadataplist.old and the system rebuilt the files and then loaded up without crashing.
    I'll try and better document this whole issue (with more research into the cause) and update this for anyone facing this in the future.

  • Retrieve element from an XML variable

    I have a BPEL process that takes in a XML message and from that message I want to parse out one element.
    Using BPEL v10.1.3.3.0
    Here is the xsd's, (use a wrapper for adding the name space)
    <?xml version="1.0" encoding="UTF-8"?>
    <schema xmlns="http://www.w3.org/2001/XMLSchema"
    targetNamespace="TempNamespace"
    xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd"
    nxsd:version="DTD">
    <include schemaLocation="VendorMasterBridge_2_1.xsd"/>
    </schema>
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="VendorMasterBridge">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="VendorMaster" minOccurs="1" maxOccurs="unbounded">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="VendorNumber" minOccurs="1" type="xs:string"/>
    <xs:element name="VendorName" minOccurs="0" type="xs:string"/>
    <xs:element name="BatchCtrlNbr" minOccurs="0" type="xs:string"/>
    <xs:element name="Error" minOccurs="0" type="xs:string"/>
    <xs:element name="VendorMasterFields" minOccurs="0">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="DateCreated" minOccurs="0" type="xs:dateTime"/>
    <xs:element name="Address1" minOccurs="0" type="xs:string"/>
    <xs:element name="Address2" minOccurs="0" type="xs:string"/>
    <xs:element name="PassReqdAutoCreate" minOccurs="0" type="xs:string"/>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:sequence>
    <xs:attribute name="id" use="optional" type="xs:string"/>
    <xs:attribute name="version" use="optional" type="xs:string" default="2.1"/>
    <xs:attribute name="timestamp" use="optional" type="xs:dateTime"/>
    </xs:complexType>
    </xs:element>
    </xs:schema>
    I use the Assign activity to try and get the Address1 field
    <assign name="Assign_1">
    <copy>
    <from variable="Vendxml" part="VendorMasterBridge"
    query="/ns3:VendorMasterBridge/VendorMaster/VendorMasterFields/Address1"/>
    <to variable="addr"/>
    </copy>
    </assign>
    When I deploy and run the BPEL process I get this error
    <selectionFailure xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/"><part name="summary"><summary>empty variable/expression result.
    xpath variable/expression expression "/ns3:VendorMasterBridge/VendorMaster/VendorMasterFields/Address1" is empty at line 87, when attempting reading/copying it.
    Please make sure the variable/expression result "/ns3:VendorMasterBridge/VendorMaster/VendorMasterFields/Address1" is not empty.
    </summary>
    </part></selectionFailure>
    Here is the XML used for input
    <invWriteVendor_Enqueue_InputVariable>
    <part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="VendorMasterBridge">
    <VendorMasterBridge xmlns:ns0="TempNamespace" id="RMS">
    <VendorMaster xmlns="">
    <VendorNumber>1077952523</VendorNumber>
    <VendorName>UNIFLEX</VendorName>
    <VendorMasterFields>
    <Address1>383 W COMBO AVE</Address1>
    <Address2>PO BOX 9004</Address2>
    <City>HICKSVILLE</City>
    <StateCode>NY</StateCode>
    <Zip>11801-9004</Zip>
    <Country>USA</Country>
    <TelephoneNumber>05169322400</TelephoneNumber>
    <StatusCode>00</StatusCode>
    </VendorMasterFields>
    </VendorMaster>
    </VendorMasterBridge>
    </part></invWriteVendor_Enqueue_InputVariable>
    Can someone help me know what I am doing wrong?
    If I do an assign of the input xml to another xml of the same message type all the fields transfer. I only run into this issue if I am trying to access a specific element.
    Thanks for any help on this,

    Thanks for the reply, but could you be a little more specific? Problem with the namespace where, in the incoming message? Is it defined wrong in the BPEL process? A mis-match somewhere?
    I kind of figured it was a namespace issue but I can not seem to track it down.

  • Removing XML definition & XML tage from the XML message....

    Dear All,
    We are using PI 7.1 and implementing a scenario in which we need to send a signed payment message to our partner, our implemented scenario goes as follows:
    1) We are using SOAP without header to send the message.
    2) We are signing the payload using our own java code as UDF in graphical mapping.
    3) the main issue that we have is that in the final XML message which is being sent to our partnet, XMl definition and the topmode XML tage are again added to the signed message. Please see the following for reference:
    Source Message:
    We are using only I node in the graphical mapping and one UDF to sign in between the source and the target node. So after signingwe get the following in the target node:
    Signed Message
    0u201A#u0152# *u2020Hu2020÷ ### u201A#}0u201A#y###1#0 ##+######0u201A#h# *u2020Hu2020÷ ### u201A#Y#u201A#U
    u201A#ý0u201A#¸0u201A#  ######5gu0152yu2022ݬ½´b#¿#u2019 u01780 # *u2020Hu2020÷ #####0�Ý1#0 ##U####US1#0###U# ##VeriSign, Inc.1#0###U####VeriSign Trust Network1;09##U### BLAH BLAH BLAH SOME VERISGIN CERTIFICATE SIGNING INFORMATION
    but the final message that get through the SOAP and reaches our partner look liks the following:
    , as all this is appearing twice in our final message.
    I'll appriciate if anyone can help us finding a solution for that, as we tried to remove it in our java class at the adapter level in the module tab, but that produces java error.
    Regards,

    Vijaya, we already have solved this problem by creating an EJB and adding it to SOAP Adapter processing modules, so rather signing our payload in the UDF in graphical mapping we are now signing the payload in the SOAP adapter module and removing any unwarranted characters etc over there as well. We cannot send SOAP with header in our scenario as it is adding hell lot of extra bites that our partner system cannot understand, so we have adapted the EJB way of solving it. Thanks anyways for your suggestion.
    Athar Ullah Khan

  • Testcase, how to split up an xml message and call a BPEL process.

    Another question.
    Considering the following XML message.
    <?xml version="1.0" encoding="UTF-8"?>
    <rows>
    <row>
    <id>10</id>
    <naam>A</naam>
    </row>
    <row>
    <id>20</id>
    <naam>B</naam>
    </row>
    </rows>
    An input message can consist of 1 to about 20000 <row></row> elements. I would like to split up this message into individual <row></row> and call a BPEL process for further processing.
    I've tried to use the file adapters feature "Files contain Multiple Messages" Publish Messages in batches of.." This did not work. ( root element expected exceptions ).
    I've also tried to invoke an extra async routing service with a mapping which removes the root element. This also doesn't work as it leaves the following ( incorrect ) xml message at the end.
    <row>
    <id>10</id>
    <naam>A</naam>
    </row>
    <row>
    <id>20</id>
    <naam>B</naam>
    </row>
    Which is logical considering how an XSL transformation works.
    Is there any way to achieve this?
    Any help is appreciated!

    You shoul create a while loop, that loops through XML payload for each row. Than you can process each individual row. See also example:
    C:\orabpel\samples\tutorials\112.Arrays\ArraySample.bpel

  • How to read elements in a xml file sent as a string

    Hi,
    I am new to BPEL and i am working on a requirement where i receive the XML message as a String from an AQ. And I am not able parse the xml to read the individual elements of it. Appreciate your help on this.
    The (sample)input message from Q is which i am able to see in the BPEL console:
    <BUGINFO_XML>
    <XML_MESSAGE>
    <?xml version="1.0"?>
    <BUGINFO>
    <SR_ID>3-29OU7OF</SR_ID>
    <OBJECT_TYPE>UPDATE_PREBUG</OBJECT_TYPE>
    <RESERVED_BUG_NUM>8221084</RESERVED_BUG_NUM>
    <TYPE>Predefect Update</TYPE>
    <AUDIENCE>INTERNAL</AUDIENCE>
    <COMMENT>TEST activity by Sireesha</COMMENT>
    </BUGINFO>
    </XML_MESSAGE>
    </BUGINFO_XML>
    and the corresponding xsd file is:
    <schema targetNamespace="http://xmlns.oracle.com/xdb/ORIONCC"
    xmlns="http://www.w3.org/2001/XMLSchema"
    xmlns:ORIONCC="http://xmlns.oracle.com/xdb/ORIONCC"
    elementFormDefault="unqualified" attributeFormDefault="qualified">
    <complexType name="BUGINFO_XML">
    <sequence>
    <element name="XML_MESSAGE" type="string" nillable="true" minOccurs="0"/>
    </sequence>
    </complexType>
    <element name="BUGINFO_XML" type="ORIONCC:BUGINFO_XML" />
    </schema>
    i have created a variable(called VariableXML) of element type of the above xsd type({http://xmlns.oracle.com/xdb/ORIONCC}BUGINFO_XML) and using ora:parseEscapedXML method, i copied the input data to this variable and i can see the data copied fine to this variable, but after that i am not able to traverse to the individual element of it say i want the value of SR_ID which i am not able to get.
    <VariableXML>
    <BUGINFO_XML>
    <SR_ID>3-29OU7OF</SR_ID>
    <OBJECT_TYPE>UPDATE_PREBUG</OBJECT_TYPE>
    <RESERVED_BUG_NUM>8221084</RESERVED_BUG_NUM>
    <TYPE>Predefect Update</TYPE>
    <AUDIENCE>INTERNAL</AUDIENCE>
    <COMMENT>TEST activity by Sireesha</COMMENT>
    </BUGINFO_XML>
    </VariableXML>
    When i see the structure of this variable in the Assign activity i can see only up to '/ns2:BUGINFO_XML/XML_MESSAGE' but not the individual elements.
    Please let me know how can i parse this xml to read the elements of it.
    I am using jdev 11.1.1.4 and weblogic 10.3
    Thanks,
    Sireesha
    Edited by: user12217808 on Jul 27, 2012 7:10 AM

    Thanks for replying Tarak,
    I have taken the XML generated by VariableXML variable and generated a XSD out of it and that looks like below.
    <?xml version="1.0" encoding="windows-1252" ?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns="http://www.example.org"
    targetNamespace="http://www.example.org"
    elementFormDefault="qualified">
    <xsd:element name="BUGINFO_XML">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="SR_ID" type="xsd:string"/>
    <xsd:element name="OBJECT_TYPE" type="xsd:string"/>
    <xsd:element name="RESERVED_BUG_NUM" type="xsd:integer"/>
    <xsd:element name="TYPE" type="xsd:string"/>
    <xsd:element name="AUDIENCE" type="xsd:string"/>
    <xsd:element name="COMMENT" type="xsd:string"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>
    Then I have created a variable called VariableBugInfo of this element type ({http://www.example.org}BUGINFO_XML) and tried parsing it as below.
    <assign name = 'Assign2'>
    <copy>
    <from expression="oraext:parseXML(bpws:getVariableData('VariableXML','/ns2:BUGINFO_XML'))"/>
    <to variable="VariableBugInfo" query="/ns4:BUGINFO_XML"/>
    </copy>
    </assign>
    then i got the below error in the bpel console when im testing my bpel process.
    The following exception occurred while attempting to execute operation copy at line 118
    <?xml-stylesheet href="chrome://global/locale/intl.css" type="text/css"?>
    -<parsererror>
    XML Parsing Error: junk after document element
    Location: http://slce26vm164.us.oracle.com:7001/em/ai/sca/share/audit/nfdg/displayInstance.jsp?locatorobjkey=Farm_mosbpelmosbpelsoa_server1soa-infra&instanceid=bpel%3A70555
    Line Number 7, Column 1:
    <sourcetext>
    <root class="javax.xml.xpath.XPathExpressionException">internal xpath error<stack><f>oracle.xml.xpath.JXPathExpression.evaluate#242</f><f>com.collaxa.cube.xml.xpath.BPELXPathUtil.evaluate#240</f><f>com.collaxa.cube.engine.ext.bpel.common.BPELWMPHelper.evalFromValue#339</f><f>com.collaxa.cube.engine.ext.bpel.v1.wmp.BPEL1AssignWMP.__executeStatements#137</f><f>com.collaxa.cube.engine.ext.bpel.common.wmp.BaseBPELActivityWMP.perform#158</f><f>com.collaxa.cube.engine.CubeEngine._performActivity#2463</f><f>com.collaxa.cube.engine.CubeEngine.performActivity#2334</f><f>com.collaxa.cube.engine.CubeEngine.handleWorkItem#1115</f><f>com.collaxa.cube.engine.dispatch.message.instance.PerformMessageHandler.handleLocal#73</f><f>com.collaxa.cube.engine.dispatch.DispatchHelper.handleLocalMessage#220</f><f>com.collaxa.cube.engine.dispatch.DispatchHelper.sendMemory#328</f><f>com.collaxa.cube.engine.CubeEngine.endRequest#4350</f><f>com.collaxa.cube.engine.CubeEngine.endRequest#4281</f><f>com.collaxa.cube.engine.CubeEngine.createAndInvoke#679</f><f>com.collaxa.cube.engine.delivery.DeliveryService.handleInvoke#654</f><f>com.collaxa.cube.engine.ejb.impl.CubeDeliveryBean.handleInvoke#293</f><f>...</f></stack></root>
    ^
    </sourcetext>
    </parsererror>
    but when i tried a normal copy from VariableXML BUGINFO to VariableBugInfo as below, i am not getting any error but its not actually copying the contents to individual tags, because after this Assign i created a simple string variable(objTypeVar) and when i tried to copy TYPE element value to it, it says 'The result is empty for the XPath expression : "/ns4:BUGINFO_XML/ns4:TYPE".'
    <assign name="Assign2">
    <copy>
    <from variable="VariableXML" query="/ns2:BUGINFO_XML"/>
    <to variable="VariableBugInfo" query="/ns4:BUGINFO_XML"/>
    </copy>
    </assign>
    <assign name="Assign3">
    <copy>
    <from variable="VariableBugInfo"
    query="/ns4:BUGINFO_XML/ns4:TYPE"/>
    <to variable="objTypeVar"/>
    </copy>
    </assign>
    Result in console for VariableBugInfo for Assign2:
    <VariableBugInfo>
    <BUGINFO_XML>
    <SR_ID>3-29OU7OF</SR_ID>
    <OBJECT_TYPE>UPDATE_PREBUG</OBJECT_TYPE>
    <RESERVED_BUG_NUM>8221084</RESERVED_BUG_NUM>
    <TYPE>Predefect Update</TYPE>
    <AUDIENCE>INTERNAL</AUDIENCE>
    <COMMENT>TEST activity by Sireesha</COMMENT>
    </BUGINFO_XML>
    </VariableBugInfo>
    For Assign 3:
    Error in evaluate <from> expression at line "141". The result is empty for the XPath expression : "/ns4:BUGINFO_XML/ns4:TYPE".
    I feel there is something i am missing in the XSD and the target namespace which is causing the issue. I am not sure what i should provide in the target namesapce in the new xsd which i created based on the value of VariableXML , so that it actually parses the xml and copies exact elements of it.
    Please let me know if i am doing something wrong anywhere.
    Thanks,
    Sireesha

  • XML message as input for webservice gives deserialization error

    Hi,
    jDeveloper 10.1.3
    BPEL PM 10.1.2.0.2
    Carrental example
    Problem:
    For the Business Rule Engine I did the Carrental XML example. Based on the java application that connects to the BR engine, I created a webservice in jDeveloper and deployed it to my localhost AS 10.1.3. The webservice has a testRule method that accepts a String buf as input. For now, the only thing the webservice does is return a 'do nothing' string. This works fine:
    When deployed the testpage generates the following SOAP message:
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body xmlns:ns1="http://carrental/types/">
    <ns1:testRuleElement>
    <ns1:buf>my xml message</ns1:buf>
    </ns1:testRuleElement>
    </soap:Body>
    </soap:Envelope>
    The SOAP response is:
    <?xml version="1.0" encoding="UTF-8"?>
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns0="http://carrental/types/"><env:Body><ns0:testRuleResponseElement><ns0:result>do nothing...</ns0:result></ns0:testRuleResponseElement></env:Body></env:Envelope>
    In BPEL Designer I create a new asynchronous process ValidateBR, with a partnerlink for the webservice, based on the following WSDL file:
    <definitions
    name="Rent"
    targetNamespace="http://carrental/"
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:tns="http://carrental/"
    xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
    xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
    xmlns:tns0="http://carrental/types/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    >
    <types>
    <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://carrental/types/"
    elementFormDefault="qualified" xmlns:tns="http://carrental/types/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/">
    <complexType name="testRule">
    <sequence>
    <element name="buf" type="string" nillable="true"/>
    </sequence>
    </complexType>
    <complexType name="testRuleResponse">
    <sequence>
    <element name="result" type="string" nillable="true"/>
    </sequence>
    </complexType>
    <complexType name="version">
    <sequence/>
    </complexType>
    <complexType name="versionResponse">
    <sequence>
    <element name="result" type="string" nillable="true"/>
    </sequence>
    </complexType>
    <element name="testRuleElement" type="tns:testRule"/>
    <element name="testRuleResponseElement" type="tns:testRuleResponse"/>
    <element name="versionElement" type="tns:version"/>
    <element name="versionResponseElement" type="tns:versionResponse"/>
    </schema>
    </types>
    <message name="Rent_testRule">
    <part name="parameters" element="tns0:testRuleElement"/>
    </message>
    <message name="Rent_testRuleResponse">
    <part name="parameters" element="tns0:testRuleResponseElement"/>
    </message>
    <message name="Rent_version">
    <part name="parameters" element="tns0:versionElement"/>
    </message>
    <message name="Rent_versionResponse">
    <part name="parameters" element="tns0:versionResponseElement"/>
    </message>
    <portType name="Rent">
    <operation name="testRule">
    <input message="tns:Rent_testRule"/>
    <output message="tns:Rent_testRuleResponse"/>
    </operation>
    <operation name="version">
    <input message="tns:Rent_version"/>
    <output message="tns:Rent_versionResponse"/>
    </operation>
    </portType>
    <binding name="RentSoapHttp" type="tns:Rent">
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    <operation name="testRule">
    <soap:operation soapAction="http://carrental//testRule"/>
    <input>
    <soap:body use="literal" parts="parameters"/>
    </input>
    <output>
    <soap:body use="literal" parts="parameters"/>
    </output>
    </operation>
    <operation name="version">
    <soap:operation soapAction="http://carrental//version"/>
    <input>
    <soap:body use="literal" parts="parameters"/>
    </input>
    <output>
    <soap:body use="literal" parts="parameters"/>
    </output>
    </operation>
    </binding>
    <service name="Rent">
    <port name="RentSoapHttpPort" binding="tns:RentSoapHttp">
    <soap:address location="http://localhost:7780/Rules-rent-context-root/RentSoapHttpPort"/>
    </port>
    </service>
    </definitions>
    I defined the process variable inputVariable to be defined based on the carrental.xsd schema. I assign the inputVariable to the 'buf' parameter of the webservice as shown below in the ValidateBR.bpel
    <!--
    // Oracle JDeveloper BPEL Designer
    // Created: Mon Mar 27 16:02:22 CEST 2006
    // Author: haanrw
    // Purpose: Asynchronous BPEL Process
    -->
    <process name="ValidateBR" targetNamespace="http://xmlns.oracle.com/ValidateBR" xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/" xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20" xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/" xmlns:ns1="http://rules.oracle.com/carrental" xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns3="http://carrental/types/" xmlns:ns2="http://carrental/" xmlns:client="http://xmlns.oracle.com/ValidateBR" xmlns:bpelx="http://schemas.oracle.com/bpel/extension" xmlns:ora="http://schemas.oracle.com/xpath/extension" xmlns:orcl="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc"><!-- ================================================================= --><!-- PARTNERLINKS --><!-- List of services participating in this BPEL process --><!-- ================================================================= -->
    <partnerLinks><!--
    The 'client' role represents the requester of this service. It is
    used for callback. The location and correlation information associated
    with the client role are automatically set using WS-Addressing.
    -->
    <partnerLink name="client" partnerLinkType="client:ValidateBR" myRole="ValidateBRProvider" partnerRole="ValidateBRRequester"/>
    <partnerLink name="CheckBR" partnerRole="Rent_Role" partnerLinkType="ns2:Rent_PL"/>
    </partnerLinks><!-- ================================================================= --><!-- VARIABLES --><!-- List of messages and XML documents used within this BPEL process --><!-- ================================================================= -->
    <variables><!-- Reference to the message passed as input during initiation -->
    <variable name="inputVariable" messageType="client:ValidateBRRequestMessage"/><!-- Reference to the message that will be sent back to the
    requester during callback
    -->
    <variable name="outputVariable" messageType="client:ValidateBRResponseMessage"/>
    <variable name="InvokeValidateBR_testRule_InputVariable" messageType="ns2:Rent_testRule"/>
    <variable name="InvokeValidateBR_testRule_OutputVariable" messageType="ns2:Rent_testRuleResponse"/>
    </variables><!-- ================================================================= --><!-- ORCHESTRATION LOGIC --><!-- Set of activities coordinating the flow of messages across the --><!-- services integrated within this business process --><!-- ================================================================= -->
    <sequence name="main"><!-- Receive input from requestor.
    Note: This maps to operation defined in ValidateBR.wsdl
    -->
    <receive name="receiveInput" partnerLink="client" portType="client:ValidateBR" operation="initiate" variable="inputVariable" createInstance="yes"/><!-- Asynchronous callback to the requester.
    Note: the callback location and correlation id is transparently handled
    using WS-addressing.
    -->
    <assign name="Assign_1">
    <copy>
    <from variable="inputVariable" part="payload" query="/ns1:repository"/>
    <to variable="InvokeValidateBR_testRule_InputVariable" part="parameters" query="/ns3:testRuleElement/ns3:buf"/>
    </copy>
    </assign>
    <invoke name="InvokeValidateBR" partnerLink="CheckBR" portType="ns2:Rent" operation="testRule" inputVariable="InvokeValidateBR_testRule_InputVariable" outputVariable="InvokeValidateBR_testRule_OutputVariable"/>
    <invoke name="callbackClient" partnerLink="client" portType="client:ValidateBRCallback" operation="onResult" inputVariable="outputVariable"/>
    </sequence>
    </process>
    When I deploy the process and initiate a testinstance from the BPEL console, the assign looks as follows:
    <InvokeValidateBR_testRule_InputVariable>
    <part name="parameters" >
    <testRuleElement>
    <buf>
    <driver>
    <driver-license-number>15-PS-FZ</driver-license-number>
    <name>Rob de Haan</name>
    <age>39</age>
    <vehicle-type>Saab</vehicle-type>
    <license-type>B</license-type>
    <pre-convictions>0</pre-convictions>
    <pre-accidents>0</pre-accidents>
    <able-to-drive>true</able-to-drive>
    </driver>
    </buf>
    </testRuleElement>
    </part>
    </InvokeValidateBR_testRule_InputVariable>
    The InvokeValidateBR shows the following error:
    <remoteFault>
    <part name="code" >
    <code>Client</code>
    </part>
    <part name="summary" >
    <summary>when invoking endpointAddress 'http://localhost:7780/Rules-rent-context-root/RentSoapHttpPort', caught exception while handling request: deserialization error: unexpected XML reader state. expected: END but found: START: {http://rules.oracle.com/carrental}driver</summary>
    </part>
    <part name="detail" >
    <detail>AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Client faultSubcode: faultString: caught exception while handling request: deserialization error: unexpected XML reader state. expected: END but found: START: {http://rules.oracle.com/carrental}driver faultActor: faultNode: faultDetail: {http://xml.apache.org/axis/}stackTrace:caught exception while handling request: deserialization error: unexpected XML reader state. expected: END but found: START: {http://rules.oracle.com/carrental}driver at org.collaxa.thirdparty.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:221) at org.collaxa.thirdparty.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:128) at org.collaxa.thirdparty.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1083) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at javax.xml.parsers.SAXParser.parse(Unknown Source) at org.collaxa.thirdparty.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:226) at org.collaxa.thirdparty.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:645) at org.collaxa.thirdparty.apache.axis.Message.getSOAPEnvelope(Message.java:424) at org.collaxa.thirdparty.apache.axis.client.Call.invokeEngine(Call.java:2754) at org.collaxa.thirdparty.apache.axis.client.Call.invoke(Call.java:2715) at org.collaxa.thirdparty.apache.axis.client.Call.invoke(Call.java:1737) at com.collaxa.cube.ws.wsif.providers.axis.WSIFOperation_ApacheAxis.invokeAXISMessaging(WSIFOperation_ApacheAxis.java:2113) at com.collaxa.cube.ws.wsif.providers.axis.WSIFOperation_ApacheAxis.invokeRequestResponseOperation(WSIFOperation_ApacheAxis.java:1611) at com.collaxa.cube.ws.wsif.providers.axis.WSIFOperation_ApacheAxis.executeRequestResponseOperation(WSIFOperation_ApacheAxis.java:1083) at com.collaxa.cube.ws.WSIFInvocationHandler.invoke(WSIFInvocationHandler.java:452) at com.collaxa.cube.ws.WSInvocationManager.invoke2(WSInvocationManager.java:327) at com.collaxa.cube.ws.WSInvocationManager.invoke(WSInvocationManager.java:189) at com.collaxa.cube.engine.ext.wmp.BPELInvokeWMP.__invoke(BPELInvokeWMP.java:601) at com.collaxa.cube.engine.ext.wmp.BPELInvokeWMP.__executeStatements(BPELInvokeWMP.java:317) at com.collaxa.cube.engine.ext.wmp.BPELActivityWMP.perform(BPELActivityWMP.java:188) at com.collaxa.cube.engine.CubeEngine.performActivity(CubeEngine.java:3408) at com.collaxa.cube.engine.CubeEngine.handleWorkItem(CubeEngine.java:1836) at com.collaxa.cube.engine.dispatch.message.instance.PerformMessageHandler.handleLocal(PerformMessageHandler.java:75) at com.collaxa.cube.engine.dispatch.DispatchHelper.handleLocalMessage(DispatchHelper.java:166) at com.collaxa.cube.engine.dispatch.DispatchHelper.sendMemory(DispatchHelper.java:252) at com.collaxa.cube.engine.CubeEngine.endRequest(CubeEngine.java:5438) at com.collaxa.cube.engine.CubeEngine.createAndInvoke(CubeEngine.java:1217) at com.collaxa.cube.engine.delivery.DeliveryService.handleInvoke(DeliveryService.java:511) at com.collaxa.cube.engine.ejb.impl.CubeDeliveryBean.handleInvoke(CubeDeliveryBean.java:335) at ICubeDeliveryLocalBean_StatelessSessionBeanWrapper16.handleInvoke(ICubeDeliveryLocalBean_StatelessSessionBeanWrapper16.java:1796) at com.collaxa.cube.engine.dispatch.message.invoke.InvokeInstanceMessageHandler.handle(InvokeInstanceMessageHandler.java:37) at com.collaxa.cube.engine.dispatch.DispatchHelper.handleMessage(DispatchHelper.java:125) at com.collaxa.cube.engine.dispatch.BaseScheduledWorker.process(BaseScheduledWorker.java:70) at com.collaxa.cube.engine.ejb.impl.WorkerBean.onMessage(WorkerBean.java:86) at com.evermind.server.ejb.MessageDrivenBeanInvocation.run(MessageDrivenBeanInvocation.java:123) at com.evermind.server.ejb.MessageDrivenHome.onMessage(MessageDrivenHome.java:755) at com.evermind.server.ejb.MessageDrivenHome.run(MessageDrivenHome.java:928) at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186) at java.lang.Thread.run(Thread.java:534) {http://xml.apache.org/axis/}hostname:NL-GRH-L120981 </detail>
    </part>
    </remoteFault>
    FYI: the webservice only contains a return "do nothing"
    Question:
    What is the proper way to assign an XML message to the web service?
    Any help would be appreciated.
    Rob
    Message was edited by:
    [email protected]

    Hi,
    Reading only is not possible..
    I will be still more clear in my question this time..
    I have deployed my bpel. My receiveInputVariable is of type xsd:string.
    So when i run the bpel in my console, i will be asked to give input as string data.
    So when i go to the XMLView, it will be like this.
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
         <soap:Body xmlns:ns1="http://xmlns.oracle.com/Sabari_POC_Appln/DOM_Parser/ConvertToBLOB">
              <ns1:process>
                   <ns1:input></ns1:input>
    </ns1:process>
    </soap:Body>
    </soap:Envelope>
    Now, i am going to give my input like this. --- which leads to error.
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
         <soap:Body xmlns:ns1="http://xmlns.oracle.com/Sabari_POC_Appln/DOM_Parser/ConvertToBLOB">
              <ns1:process>
                   <ns1:input>
    *<?xml version="1.0" encoding="UTF-8"?>*
    *<projects>*
    *<project id = "BP001">*
    *<name>Banking Project</name>*
    *<start-date>Jan 10 1999</start-date>*
    *<end-date>Jan 10 2003</end-date>*
    *</project>*
    *<project id = "TP001">*
    *<name>Telecommunication Project</name>*
    *<start-date>March 20 1999</start-date>*
    *<end-date>July 30 2004</end-date>*
    *</project>*
    *<project id = "PP001">*
    *<name>Portal Project</name>*
    *<start-date>Dec 10 1998</start-date>*
    *<end-date>March 10 2006</end-date>*
    *</project>*
    *</projects>*
    </ns1:input>
    </ns1:process>
    </soap:Body>
    </soap:Envelope>
    This xml is not accepted as string input.. so kindly suggest me some other solution.
    I also tried.. like.. making my receiveInputVariable of type xsd:anyType, it also dint help. same error occurred.
    Thanks,
    Sabarisri. N
    Edited by: Sabarisri N on Jul 20, 2011 1:03 PM

  • XI have to break/split XML-File into N times a XML Message

    Hello,
    Can anyone help with this one. I guess this is not an easy exercise but I need to solve it urgently.
    XI gets a XML-file from a system.
    This file has N times a element <XBT>.
    Every time XI gets such a file the number of <XBT> is different.
    XI haves to break this xml into N xml messages according to element ><XBT> in order to send them to Sap sequentially.
    For example the following XML file have to split up into 2 xml files (the elements XBT occurs 2 times)
    How can this be done?
    <mt_BubaBestand>
    <b><XBT></b>
      <Algemeen>
         <Verkooporganisatie>5000</Verkooporganisatie>
         <Distributiekanaal>50</Distributiekanaal>
         <Productgroep>50</Productgroep>
         <Ordernummer>123123</Ordernummer>
         <Verkoopgroep/>
         <Documentdatum>20061207</Documentdatum>
         <Medewerker_nr>e60217</Medewerker_nr>
         <Medewerker_naam>Hermans</Medewerker_naam>
         <CRM_nr/>
         <CIFDedicated/>
         <Klantgroep/>
      </Algemeen>
    <b></XBT></b>
    <b><XBT></b>
      <Algemeen>
         <Verkooporganisatie>5000</Verkooporganisatie>
         <Distributiekanaal>50</Distributiekanaal>
         <Productgroep>50</Productgroep>
         <Ordernummer>123123</Ordernummer>
         <Verkoopgroep/>
         <Documentdatum>20061207</Documentdatum>
         <Medewerker_nr>e60217</Medewerker_nr>
         <Medewerker_naam>Hermans</Medewerker_naam>
         <CRM_nr/>
         <CIFDedicated/>
         <Klantgroep/>
      </Algemeen>
    <b></XBT></b>
    </mt_BubaBestand>

    This is pretty standard procedure if you are posting these messages to R/3.  As was pointed out in the weblogs above, when using IDocs you don't need to do any tricky configuration.  Just make sure that your XML structure is set correctly (ie:  1 to unbounded, etc) to the limits that you want, and XI will automatically loop the mapping process for each instance of the <XBT> item that it detects in the source message.  You mentioned:
    <i>For example the following XML file have to split up into 2 xml files (the elements XBT occurs 2 times)</i>
    Well, you don't actually split it into two XML files per say, XI just processes the source message straight to multiple IDocs using the IDoc adapter.

  • Specifying Case-Insensitive Element Names in XML Schema

    Hope someone knows this!
    Is it possible to define an an XML Schema Definition so that Element names in the target XML File can be case insensitive.
    At the moment my Parser throws an error if the element names in the XML file do not have the exact same case as the definition in the XML schema.
    E.g
    In Schema i have:
    <xsd:element name="HOSTINVENTORYLINE" type="HostInventoryLineType" maxOccurs="unbounded" minOccurs="0"/>
    but in xml file i have
    <HostInventoryLine field=""/>
    or
    <hostinventoryline field=""/>
    Does anyone know anyway to get around this, so that the parser accepts the HostInventoryLine element in the xml as an instance of the HOSTINVENTORYLINE element defined in the schema.
    Thanks in Advance
    JJ
    Message was edited by:
    [email protected]

    You could use substitution groups to handle this. You would need an entry in the schema for each valid capitalization. This won't scale well if you want to be completely case insensitive, but if you only support lower case, upper case, and camel case it should do the trick.
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
         <xs:complexType name="HostInventoryLineType">
              <xs:sequence>
                   <xs:element name="an-element" type="xs:string"/>
              </xs:sequence>
         </xs:complexType>
         <xs:element name="HostInventoryLine" type="HostInventoryLineType"/>
         <xs:element name="HOSTINVENTORYLINE" type="HostInventoryLineType" substitutionGroup="HostInventoryLine"/>
         <xs:element name="hostinventoryline" type="HostInventoryLineType" substitutionGroup="HostInventoryLine"/>
    </xs:schema>-Blaise

  • Accessing Element's name in Message mapping

    Hi,
       I need to Access the Element's name in Message mapping (Using graphical tool or in user defined function).
    For Example:
    Element: <Company_Name>XYZ Co </Company_Name>
    I need to access the Element's name(i.e.)<b>"Company_Name"</b>. So that I can map it as
    <Element>Company_Name</Element>
    <Element_Value>XYZ Co </Element_Value>
    in the target message.
    Kindly provide your inputs.

    Hi Santhosh,
    I am not sure if this can be done using your Graphical Mapping, but this is possible using JAVA mapping. Your SAX and DOM parsers for JAVA mapping provides methods like getChildNodes, getElementName using which you can get the name of the element.
    Check this link for the methods available for Java Mapping,
    http://java.sun.com/j2se/1.4.2/docs/api/javax/xml/parsers/package-summary.html
    I think the same can also be done using XSL mapping. Though, I am not sure what method should be used for the same.
    Hope this helps,
    Regards,
    Bhavesh

  • Inserting an element into an XML document

    I am simply looking insert a new element into an existing XML Document using JDOM. Here is my code so far:
    public class UserDocumentWriter {
         private SAXBuilder builder;
         private Document document;
         private File file = new File("/path/to/file/users.xml");
         private Element rootElement;
         public UserDocumentWriter() {
              builder = new SAXBuilder();
              try {
                   document = builder.build(file);
                   rootElement = document.getRootElement();
              } catch (IOException ioe) {
                   System.err.println("ERROR: Could not build the XML file.");
              } catch (JDOMException jde) {
                   System.err.println("ERROR: " + file.toString() + " is not well-formed.");
         public void addContact(String address, String contact) {
              List contactList = null;
              Element contactListElement;
              Element newContactElement = new Element("contact");
              newContactElement.setText(contact);
              List rootsChildren = rootElement.getChildren();
              Iterator iterator = rootsChildren.iterator();
              while (iterator.hasNext()) {
                   Element e = (Element) iterator.next();
                   if (e.getAttributeValue("address").equals(address)) {
                        contactListElement = e.getChild("contactlist");
                        contactListElement.addContent(newContactElement);
                        writeDocument(document);
         public void writeDocument(Document doc) {
              try {
                   XMLOutputter output = new XMLOutputter();
                   OutputStream out = new FileOutputStream(file);
                   output.output(doc, out);
              } catch (FileNotFoundException ntfe) {
                   System.err.println("ERROR: Output file not found.");
              } catch (IOException ioe) {
                   System.err.println("Could not output document changes.");
         }However, the problem is, the newly added element will always be appended to the end of the last line, resulting in the following:
    <contactlist>
                <contact>[email protected]</contact><contact>[email protected]</contact></contactlist>Is there anyway in which I can have the newly added element create it's own line for the purpose of tidy XML? Alternatively is there a better methodology to do the above entirely?

    Your question is not very clear.
    Do you want to know How to insert an element into an XML document?
    Answer: I can see you already know how to do it. You have added the element using addContent()
    or do you want to know How to display the XML in a tidy format?
    Answer: to view the XML in a properly formatted style you can you the Format class. A very basic way of viewing the XML would be:
       * Prints the Document to the specified file.
       * @param doc
       * @param filename
       * @param formatting
      public static void printDocToFile(Document doc, String strFileName,
          boolean formatting)
        XMLOutputter xmlOut = null;
        if (!formatting)
          xmlOut = new XMLOutputter();
        } else
          Format prettyFormat = Format.getPrettyFormat();
          prettyFormat.setOmitEncoding(false);
          prettyFormat.setOmitDeclaration(false);
          xmlOut = new XMLOutputter(prettyFormat);
        try
          if (doc != null)
            FileWriter writer = new java.io.FileWriter(strFileName, true);
            xmlOut.output(doc, writer);
            writer.flush();
            writer.close();
          } else
            System.out.println("Document is null.");
        catch (Exception ex)
          System.out.println(ex);
      }

  • Is there any way in the SOA suite to reject XML messages over certain size?

    I am working for a client at the moment and we are currently in the system test phase of the first SOA implementation project.
    We have a process that is made externally available to third parties via an ESB service which is secured using the OWSM. The problem we are having is that the XML message schema has some elements that are unbounded meaning that potentially the messages could be submitted into our system of an unprocessable size. We have been testing with message of 10Mb which fail and 5Mb which have severe performance problems. We would like to be able to reject messages over a specified limit (3Mb for example) to ensure our service is not detrimentally affected by a single message.
    Does anyone know of a way of checking a message size before processing it in either OWSM, ESB or BPEL processes?

    I don't know your deployment details, but I would definitely try something easy and straightforward. If there is HTTP transport layer used, my first choice would be Apache HTTP Server.
    http://httpd.apache.org/docs/2.0/mod/core.html#limitrequestbody
    At least for WebLogic, there is very good Apache plugin.

  • RE: Validating XML message...

    Actually I stand corrected. XML Spy does seem to provide an OLE API to XML
    validation ( the isValid method on the IDocument class ) although I haven't
    tested it yet.
    In my previous post I was thinking of another XML product I tested earlier
    in the week which did not.
    -----Original Message-----
    From: Shaughnessy, Kevin
    Sent: Friday, April 20, 2001 08:59
    To: 'Rumen Georgiev'
    Cc: [email protected]
    Subject: RE: Validating XML message...
    Rumen,
    One idea that is possible is to use an OLE interface to a 3rd party XML
    product. This assumes your logic which needs to validate is running on a
    Windows box. But if so, it may work. Many products have type libraries which
    can be run through OLEGen to create Forte classes. Then you can use TOOL to
    talk OLE to that product.
    For example, XML Spy 3.5 has a type library from which I created a Forte
    project. Unfortunately this product didn't offer any extra features than
    Forte's XMLParser ( i.e. the API didn't allow me to validate the XML ) so I
    am back to using Forte's parser until I can test another product. If you
    find one that does what you want let me know.
    I've used OLE a lot with Forte to get functionality from other products (
    VISIO, MS Office ) that Forte doesn't provide and it works well. Its a
    platform dependent solution but one that may work for you.
    Kevin
    -----Original Message-----
    From: Rumen Georgiev [mailto:[email protected]]
    Sent: Friday, April 20, 2001 07:21
    To: [email protected]
    Cc: [email protected]
    Subject: RE: Validating XML message...
    Hi Kevin,
    From the answers I've got it seems Forte parser is anon-validating one. So we have to look for an external
    tool to validate these messages. What I am concerned
    about is the integration with Forte.
    Thanks for your help!
    Rumen
    Rumen,
    From Tech Note 11811:
    "ParserFactory.makeParser() will return a default,
    non-validating XML parser."
    My experience is that Forte's default XML parser will
    not validate but will throw an exception if the XML
    document is not well formed. I'm using the DOM
    model and this exception happens on the
    Document.importDocument( ) method.
    If you want anything more than that you'll have to do
    it externally.
    Kevin-----Original Message-----
    From: Rumen Georgiev [mailto:[email protected]]
    Sent: Thursday, April 19, 2001 11:49 AM
    To: [email protected]
    Subject: Validating XML message...
    We have to validate inbound XML messages before
    processing them. The guys on the other side are
    following XMLSchema recommendations to create their
    messages using xsd file for validation. We plan to
    use XMLParser Forte library and as far as I know it
    validates against dtd file (haven't tried yet). If
    this is true we have two options:
    1. Find a program to convert xsd into dtd file and
    use Forte XMLParser for validation.
    2. Validate the message beforehand with an external
    tool. That means integration between Forte and this
    tool.
    I would appreciate any help with either approach. Do
    you know of a program doing xsd into dtd? Have you
    used any existing tool on the market to validate
    using XMLSchema? Or may be there is another solution
    to
    this?
    Thank you in advance,
    Rumen
    =====
    Rumen Georgiev
    Forte Developer
    EXE Technologies
    (610) 872-4400 Ext.222
    Do You Yahoo!?
    Yahoo! Auctions - buy the things you want at great prices
    http://auctions.yahoo.com/

    Hi,
    there is some change in the XMLSPy4.3/XMLType Library 1.2 :
    Validation
    One common task on documents is to validate them against an assigned schema or DTD. If the XML file has no schema or DTD already assigned, use "Document.AssignSchema" or "Document.AssignDTD" to add the necessary references to the document.
    Examples:
    objSpy.ActiveDocument.AssignSchema "C:\mySchema.xsd", False
    or
    objSpy.ActiveDocument.AssignDTD "C:\myDTD.dtd", False
    If you want the user to select a schema or DTD, pass True as the second parameter to these functions to display a file-dialog. These methods only put the reference into the document and do not check the existence of the specified file. If the file path is not valid, the validation will fail.
    After you have assigned a valid schema or DTD reference to your file, you are able to validate it with "Document.IsValid". IsValid needs some out-parameters that must be declared as VARIANTs to be accessible from script languages like VBScript and JavaScript.

  • Mapping entire XML message to a database table field

    I receive a XML message from a topic. I want to store that entire XML message in database field of XMLType. My components are lined like this.
    JMS Adapter (Consumer) ---> Mediator ---DBAdapter
    My question is how will I use XSL tranformation in this case to put the XML message I receive to the XML type data field. Should I be using any other approach.
    Regarsd
    Thomas

    have a look at this code for reference. Not sure what you mean my map the whole message. It should be such a matter of dragging the route element to the blob object of the DB adapter.
    create or replace PROCEDURE INSERT_INBOUND_MESSAGE (
           p_ID       in out nocopy varchar2
        ,  p_Payload  in out nocopy blob
        ,  p_Date     in date
        ,  p_Error   out varchar2
        ,  p_Status  out varchar2)
    IS
    l_clob        CLOB;
    l_dest_offset NUMBER          := 1;
    l_src_offset  NUMBER          := 1;
    l_amount      INTEGER         := dbms_lob.lobmaxsize;
    l_blob_csid   NUMBER          := dbms_lob.default_csid;
    l_lang_ctx    INTEGER         := dbms_lob.default_lang_ctx;
    l_warning     INTEGER;
    l_length      BINARY_INTEGER;
    l_error_text  VARCHAR2(80);
    BEGIN
      p_Error  := 'SUCCESS';
      p_Status := 'S';
      dbms_lob.createtemporary( lob_loc => l_clob
                              , cache   => TRUE
                              , dur     => dbms_lob.session);
      dbms_lob.converttoclob  ( l_clob
                              , p_Payload
                              , l_amount
                              , l_dest_offset
                              , l_src_offset
                              , l_blob_csid
                              , l_lang_ctx
                              , l_warning);
      Begin
        Insert Into inbound_message values (p_ID, p_Payload, p_Date);
      Exception
        When others Then
          p_Status := 'E';
          p_Error  := SQLERRM;
      End;
    END INSERT_INBOUND_MESSAGE;
    --EXIT

Maybe you are looking for