Construct XI Message from XML
Hello!
Is there a Java library that creates XI Message by XML, iterface name, namaspace etc. ?
Of course I can do it by hand but I want to find more standard way.
Hi Sergey,
Java Mapping uses 2 types of parsers. DOM and SAX. DOM is easier to use with lots of classes to help you create nodes and elements, but , DOM is very processor intensive.
SAX parser is something that parses your XML one after the other, and so is not processor intensive. But, it is
not exaclty easy to develop either.
<u><b>Java Mapping</b></u>
http://help.sap.com/saphelp_nw04/helpdata/en/e2/e13fcd80fe47768df001a558ed10b6/content.htm
<u><b>DOM parser API</b></u>
http://java.sun.com/j2se/1.4.2/docs/api/org/w3c/dom/package-frame.html
Regards,
abhy
Similar Messages
-
Construct Mime message from text file
Hi
I have a text file which is a saved email (see below)
I then construct a MimeMessage from this as follows using bouncycastle
MimeMessage msg = new MimeMessage(session, new FileInputStream("file.txt"));
The resulting msg has three headers which looks right
How can I obtain the attachment?
Thanks in advance
This is a multipart message in MIME format.
--=_mixed 00561CF28025770E_=
Content-Type: multipart/alternative; boundary="=_alternative 00561CF28025770E_="
--=_alternative 00561CF28025770E_=
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: base64
--=_alternative 00561CF28025770E_=
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: base64
DQo=
--=_alternative 00561CF28025770E_=--
--=_mixed 00561CF28025770E_=
Content-Type: text/plain; name="TEST.txt"
Content-Disposition: attachment; filename="TEST.txt"
Content-Transfer-Encoding: quoted-printable
Some text
Some more text
And some more
--=_mixed 00561CF28025770E_=--I don't know why you started a new thread for this same issue.
See my response in your original thread:
[http://forums.sun.com/thread.jspa?threadID=5441777|http://forums.sun.com/thread.jspa?threadID=5441777] -
Send messages from XML server to ip Phone
Hello,
I want send text messages to IP phone (when I want) using an XML programm.
Somebody can help me????
ThanksTry award-winning PhoneTop Messenger. It provides audio paging, wave file broadcast, text notification, local weather alerts, Ambert alerts and more. You can download free evaluation copy.
-
Reading multiple messages from XML file.
Hi, I have such XML file:
<?xml version="1.0" encoding="UTF-8"?>
<dataroot xmlns:od="urn:schemas-microsoft-com:officedata" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:SchemaLocation="xml_table.xsd" generated="2007-09-30T17:40:55">
<xml_table>
<id>1</id>
<name>Pablik</name>
<phone>7777777</phone>
</xml_table>
<xml_table>
<id>2</id>
<name>SomeName</name>
<phone>2929292</phone>
</xml_table>
</dataroot>
I have past this file through file adapter (using schema definition etc). I can read content of file:
ora:getContentAsString(bpws:getVariableData('XMLType','dataroot'))
But I can’t get xml element value, for example name... :
bpws:getVariableData('XMLType','dataroot','/ns15:dataroot/ns15:xml_table/ns15:name')
Error: com.oracle.bpel.client.delivery.ReceiveTimeOutException: Waiting for response has timed out. The conversation id is 16d59568a10954ee:-4254ad7e:11580ba6d96:-7f38. Please check the process instance for detail.
bpws:getVariableData('XMLType','dataroot','/ns15:dataroot/ns15:xml_table[0]/ns15:name')
Error: com.oracle.bpel.client.delivery.ReceiveTimeOutException: Waiting for response has timed out. The conversation id is 16d59568a10954ee:-4254ad7e:11580ba6d96:-7f3f. Please check the process instance for detail.
ora:getNodeValue(bpws:getVariableData('XMLType','dataroot','/ns15:dataroot/ns15:xml_table/ns15:name'))
Result: oracle.xml.parser.v2.XMLNodeList@1aa98f1
ora:getNodeValue(bpws:getVariableData('XMLType','dataroot','/ns15:dataroot/ns15:xml_table[0]/ns15:name'))
Result: oracle.xml.parser.v2.XMLNodeList@14cb6a0
Etc.
How can I get value through assign method?It looks to me that your XML data does not have a default namespace.
You defined namespace "ns15" in your bpel process.
Are you able to set the default name space in your xml data.
Marc
http://orasoa.blogspot.com -
Hi
i have a multi-language application, i need to read validation message from xml file to get message as languageSee the Fusion Developer's Guide section 4.7. "Working with Resource Bundles" (http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/bcentities.htm#BABJACFB) and section 7.7.2 "How to Localize Validation Messages" (http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/bcvalidation.htm#sthref729)
-
Dreamweaver encountered problems while constructing the menus from the current menus.xml file
So, after having trouble with my Photoshop scratch disk, I had to do an archive and install of my Mac OS 10.6.1 then reinstall the Adobe suite. I then had to run the Licensing Repair Tool (http://www.adobe.com/support/contact/licensing.html).
Now everything works but Dreamweaver, which is throwing the following error:
"Dreamweaver encountered problems while constructing the menus from the current menus.xml file.
Please delete the current menus.xml file and rename menus.bak to menus.xml"
I tried that. menus.bak is a directory, not a file. Even renaming the directory didn't work.
I saw this http://forums.adobe.com/message/2188511#2188511
but I don't have a /FlashPlayerTrust/ directory, nor do I see what that has to do with Dreamweaver.
I couldn't find a corresponding solution for this http://forums.adobe.com/message/862339#862339 for the Mac OS.
This http://forums.adobe.com/message/3396334#3396334 didn't help, either.
Anybody have any ideas?
Thanks!This is the error I got after deleting (moving) the configuration directory.
"No document types have been found in the Configuration/DocumentTypes/ folder. The MMDocumentTypes.xml file may be missing or corrupted. The application will exit now."
I've reinstalled the entire Adobe CS4 (which fixed my Photoshop problem but created this Dreamweaver problem) and then reinstalled Dreamweaver alone.
I've also attached a screenshot of the Dreamweaver directory tree with the menus.xml files. -
Sending XML messages from server to client using POST method
Dear everyone,
I have a simple client server system - using Socket
class on the server side and URLConnection class on
the client side. The client sends requests to the
server in the form of an XML message using POST method.
The server processes the request and responds with
another XML message through the same connection.
That's the basic idea.
I have a few questions about headers and formats
especially with respect to POST.
1. In what format should the response messages from the
server be, for the client? Does the server need to
send the HTTP headers - for the POST type requests?
Is this correct?:
out.println("HTTP/1.1 200 My Server\r");
out.println("Content-type: text/xml\r");
out.println("Content-length: 1024\r");
out.println("\r");
out.println("My XML response goes here...");2. How do I read these headers and the actual message
in the client side? I figured my actual message was
immediately after the blank line. So I wrote
something like this:
String inMsg;
// loop until the blank line is through.
while (!"".equals(inMsg = reader.readLine()))
System.out.println(inMsg);
// get the actual message and process it.
inMsg = reader.readLine();
processMessage(inMsg);But the above did not work for me. Because I seem to
be receiving a blank line after each header! (I suppose
that was because of the "\r".) So what should I do?
3. What are the different headers I must pass from
server to the client to safeguard against every
possible problem?
4. What are the different exceptions I must be prepared
for this situation? How could I cope with them? For
example, time outs, IOExceptions, etc.
Thanks a lot! I appreciate all your help!
Georgehello,
1) if you want to develop a distributed application with XML messages, you can look in SOAP.
it's a solution to communicate objects distributed java (or COM or other) and it constructs XML flux to communicate between them.
2) if it can help you, I have developed a chat in TCP/IP and, to my mind, when you send datas it's only text, so the format isn't important, the important is your traitement behind.
examples :
a client method to send a message to the server :
public void send(String message)
fluxOut.println(message);
fluxOut.flush();
whith
connexionCourante = new Socket(lAdresServeur, noPort);
fluxOut= new PrintWriter( new OutputStreamWriter(connexionCourante.getOutputStream()) );
a server method in a thread to receive and print the message :
while(true)
if (laThread == null)
break;
texte = fluxIn.readLine();
System.out.println(texte);
that's all ! :)
If you want to use it for your XML communication, it could be a good idea to use a special message, for example "@end", to finish the server
ex :
while(true)
if (laThread == null)
break;
texte = fluxIn.readLine();
// to stop
if (texte.equals("@end"))
{break;}
processMessage(texte );
hope it will help you
David -
We are currently receiving XML messages from a business partner that goes
through a transformation/parser first to make sure the xml document was
in MISMO form (Mortgage Industry Standard Message Organization). Then the
document is stored in a clob in a table. The document is stored Without
the tags. We are storing these XML messages into a CLOB datatype for
later processing. I want to read the CLOB and then parse out the
individual fields to store into a table. What is the best way to
accomplish this in PL/SQL? Here is one sample record:
<MORTGAGEDATA>
<APPLICATION LoanPurposeType="OTHER">
<LenderCaseIdentifier>3631681</LenderCaseIdentifier>
<LendersBranchIdentifier>2966448</LendersBranchIdentifier>
</APPLICATION>
<PROPERTY PropertyUsageType="Primary">
<Address1>1335 test</Address1>
<City>las cruces</City>
<State>NM</State>
<PostalCode>88001</PostalCode>
</PROPERTY>
<SUBJECTPROPERTY>
<SubjectPropertyEstimatedValueAmount>69000</SubjectPropertyEstimatedValueAmount>
</SUBJECTPROPERTY>
<BORROWERRECONCILEDLIABILITY LiabilityType="HelocSubjectProperty">
<LiabilityUnpaidBalanceAmount>0</LiabilityUnpaidBalanceAmount>
<LiabilityMonthlyPaymentAmount>0</LiabilityMonthlyPaymentAmount>
</BORROWERRECONCILEDLIABILITY>
<BORROWERRECONCILEDLIABILITY LiabilityType="MortgageLoanSubjectProperty">
<LiabilityUnpaidBalanceAmount>0</LiabilityUnpaidBalanceAmount>
</BORROWERRECONCILEDLIABILITY>
<BORROWER>
<FirstName>scooby</FirstName>
<MiddleName/>
<LastName>doo</LastName>
<NameSuffix/>
<MothersMaidenName>velma</MothersMaidenName>
</BORROWER>
</MORTGAGEDATA>
NOTE: I have tried to use DBMS_XMLQUERY and it comes out like this using a
stored procedure called printclob: When I do this the data is put into
one field called xml_app_msg. The problem is how do I reference the
individual fields like FirstName and so on to store in another table? Can
I apply a stylesheet and if so, how?
Or do I create an object type called xml_app_msg with the fields lastname
and so on?
-- The table is raw_xml_msg_tbl and the field with the stored infomation is
xml_app_msg.
set serveroutput on size 50000
declare
queryCtx DBMS_XMLquery.ctxType;
result CLOB;
begin
queryCtx := DBMS_XMLQuery.newContext('select xml_app_msg from raw_xml_msg_tbl where app_id = :APP_ID');
-- DBMS_XMLQuery.clearBindValue(queryCtx);
DBMS_XMLQuery.setBindValue(queryCtx,'APP_ID','LT1001');
-- get the result..!
result := DBMS_XMLQuery.getXML(queryCtx);
-- Now you can use the result to put it in tables/send as messages..
printClobOut(result);
DBMS_XMLQuery.closeContext(queryCtx); -- you must close the query handle..
end;
OUTPUT:
<?xml version = '1.0'?>
<ROWSET>
<ROW num="1">
<XML_APP_MSG><MORTGAGEDATA>
<BORROWER>
<FirstName>Falls</FirstName>
<MiddleName/>
<LastName>Water</LastName>
<NameSuffix/>
<SSN>123-45-6789</SSN>
</BORROWER>
</MORTGAGEDATA>
</XML_APP_MSG>
</ROW>
</ROWSET>
nullI parse the XML doc into a domdocument and then loop through using xpath.valueof to pull the individual values from the nodes and then build a generic insert. It works quite well with a small number of columns. I'm not sure how it would work with a lot of columns. You can get code examples from Steve Muench's book "Developing Oracle XML Applications".
-
Please help me in inserting data into table from XML message.
Hi Experts,
Please provide a procedure to implement my below requirement.
Since I am new to queue concept.
[code]- <MESSAGES>
- <MESSAGE ID="3026900">
<MSG_ID>3026900</MSG_ID>
<DT_POSTED>6/20/2013 08:15:48</DT_POSTED>
<POSTED_BY>GPD_MSG_EXTRACTOR</POSTED_BY>
<DT_LAST_QUEUED />
- <MSG>
- <WORK_SET TRANSACTION_ID="@TRANS_ID" TRANSACTION_TYPE="Batch" IS_ACID="@IS_ACID">
- <WORK_UNIT GROUP="LEAD_TIME" ACTION="UPDATE" AFFECTED="LEAD_TIME">
- <RECORDSET TABLE_NAME="LEAD_TIME">
- <xml xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema">
- <rs:data>
<z:row business_unit_id="3838" geo="AT" sku="A0814818" dw_maint_flag="False" stock_status_id="0" lead_time="30" est_qty="0" leadtime_lock="False" update_dts="2013-06-12T02:08:30.367" update_uid="DEACTIVATE_SKU_PROCESS" leadtime_dts="2010-05-22T02:21:21.707" leadtime_uid="Lead_Time_Rules" />
<z:row business_unit_id="202" geo="GB" sku="A0814819" dw_maint_flag="False" stock_status_id="0" lead_time="30" est_qty="0" leadtime_lock="False" update_dts="2013-06-12T02:08:30.367" update_uid="DEACTIVATE_SKU_PROCESS" leadtime_dts="2010-05-22T02:21:21.707" leadtime_uid="Lead_Time_Rules" />
<z:row business_unit_id="2828" geo="BE" sku="A0814820" dw_maint_flag="False" stock_status_id="0" lead_time="30" est_qty="0" leadtime_lock="False" update_dts="2013-06-12T02:08:30.367" update_uid="DEACTIVATE_SKU_PROCESS" leadtime_dts="2010-05-22T02:21:21.707" leadtime_uid="Lead_Time_Rules" />
</rs:data>
</xml>
</RECORDSET>
</WORK_UNIT>
- <WORK_UNIT GROUP="LEAD_TIME" ACTION="ADD" AFFECTED="LEAD_TIME">
- <RECORDSET TABLE_NAME="LEAD_TIME">
- <xml xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema">
- <rs:data>
<z:row business_unit_id="202" geo="GB" sku="A0814821" dw_maint_flag="False" stock_status_id="0" lead_time="30" est_qty="0" leadtime_lock="False" update_dts="2013-06-12T02:08:30.367" update_uid="DEACTIVATE_SKU_PROCESS" leadtime_dts="2010-05-22T02:21:21.707" leadtime_uid="Lead_Time_Rules" />
<z:row business_unit_id="2828" geo="BE" sku="A0814822" dw_maint_flag="False" stock_status_id="0" lead_time="30" est_qty="0" leadtime_lock="False" update_dts="2013-06-12T02:08:30.367" update_uid="DEACTIVATE_SKU_PROCESS" leadtime_dts="2010-05-22T02:21:21.707" leadtime_uid="Lead_Time_Rules" />
</rs:data>
</xml>
</RECORDSET>
</WORK_UNIT>
- <WORK_UNIT GROUP="LEAD_TIME" ACTION="DELETE" AFFECTED="LEAD_TIME">
- <RECORDSET TABLE_NAME="LEAD_TIME">
- <xml xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema">
- <rs:data>
<z:row business_unit_id="202" geo="GB" sku="A0814817" dw_maint_flag="False" stock_status_id="0" lead_time="30" est_qty="0" leadtime_lock="False" update_dts="2013-06-12T02:08:30.367" update_uid="DEACTIVATE_SKU_PROCESS" leadtime_dts="2010-05-22T02:21:21.707" leadtime_uid="Lead_Time_Rules" />
<z:row business_unit_id="2828" geo="BE" sku="A0814816" dw_maint_flag="False" stock_status_id="0" lead_time="30" est_qty="0" leadtime_lock="False" update_dts="2013-06-12T02:08:30.367" update_uid="DEACTIVATE_SKU_PROCESS" leadtime_dts="2010-05-22T02:21:21.707" leadtime_uid="Lead_Time_Rules" />
</rs:data>
</xml>
</RECORDSET>
</WORK_UNIT>
</WORK_SET>
</MSG>
</MESSAGE>
</MESSAGES>[/code]
The above XML message is receieved by our oracle queue.Once the message is receieved to our queue.
We have to process the message according to the action(UPDATE ADD DELETE).
From this message we have to process only 3 fields (geo sku lead_time).
These three feilds data should be processed into the SKU_LEAD_TIME table based on the action.
Req1:
IF the action is update then the records should be updated in the "LEAD_TIME_TABLE" table
IF the action is update then the records should be updated in the "LEAD_TIME_TABLE" table
based on the below condition.
[code]UPDATE LEAD_TIME_TABLE SET lead_time= lead time from xml message
WHERE LEAD_TIME_TABLE.SKU=sku from xml message AND LEAD_TIME_TABLE.GEO=geo from xml message;[/code]
Req2:
IF the action is delete then the records should be deleted from the "LEAD_TIME_TABLE" table.
based on the below condition.
[code]DELETE FROM LEAD_TIME_TABLE
WHERE LEAD_TIME_TABLE.SKU=sku from xml message AND LEAD_TIME_TABLE.GEO=geo from xml message;[/code]
Req3:
IF the action is add then the records should be inserted in the "LEAD_TIME_TABLE" and "LEAD_TIME_TABLE_STAGING" table
based on the below conditions.
Req3.1:
If SKU from XML message is available in "SKU_TABLE" table
then the three parameter(GEO SKU LEAD_TIME) values from XML message should be inserted into "LEAD_TIME_TABLE" table.
Req3.2:
If SKU from XML message is not available in "SKU_TABLE" table
then the three parameter(GEO SKU LEAD_TIME) values from XML message should be inserted into "LEAD_TIME_TABLE_STAGING" table.
Req3.3:
Once the new SKU is avilable in "SKU_TABLE" table then the corresponding SKU record should be
inserted into "LEAD_TIME_TABLE" table and that record should be deleted from "LEAD_TIME_TABLE_STAGING" table.
I am posting required scripts and test cases.
[code]CREATE TABLE LEAD_TIME_TABLE(sku VARCHAR2(20),model VARCHAR2(20),class CHAR(1),geo VARCHAR2(6),lead_time NUMBER,created DATE);
CREATE TABLE LEAD_TIME_TABLE_STAGING(sku VARCHAR2(20),geo VARCHAR2(6),lead_time NUMBER);
CREATE TABLE SKU_TABLE(sku VARCHAR2(20),geo VARCHAR2(6),lead_time NUMBER);
INSERT INTO SKU_TABLE VALUES('A0814817','GB',30);
INSERT INTO SKU_TABLE VALUES('A0814818','AT',30);
INSERT INTO SKU_TABLE VALUES('A0814819','GB',30);
INSERT INTO SKU_TABLE VALUES('A0814820','BE',30);
INSERT INTO SKU_TABLE VALUES('A0814821','GB',30);
INSERT INTO LEAD_TIME_TABLE(SKU,GEO,LEAD_TIME) VALUES('A0814817','GB',30);
INSERT INTO LEAD_TIME_TABLE(SKU,GEO,LEAD_TIME) VALUES('A0814818','AT',20);
INSERT INTO LEAD_TIME_TABLE(SKU,GEO,LEAD_TIME) VALUES('A0814819','GB',20);
INSERT INTO LEAD_TIME_TABLE(SKU,GEO,LEAD_TIME) VALUES('A0814820','BE',20);
INSERT INTO LEAD_TIME_TABLE_STAGING VALUES('A0814822','BE',30);[/code]
From the above message.
Test case for req3.1:
The action for SKU numbers "A0814821" "A0814822" are insert.
The SKU number "A0814821" is available in SKU_TABLE table.
so the record should be inserted in the LEAD_TIME_TABLE.
[code]SELECT * FROM LEAD_TIME_TABLE;
SKU GEO LEAD_TIME
A0814817 GB 30
A0814818 AT 20
A0814819 GB 20
A0814820 BE 20
A0814821 GB 30[/code]
Test case for req3.2:
The action for SKU numbers "A0814821" "A0814822" are insert.
The SKU number "A0814822" is not available in SKU_TABLE table.
so the record should be inserted in the LEAD_TIME_TABLE_STAGING.
[code]SELECT * FROM LEAD_TIME_TABLE_STAGING;
SKU GEO LEAD_TIME
A0814822 BE 30[/code]
Test case for req3.3:
The action for SKU numbers "A0814821" "A0814822" are insert.
The SKU number "A0814822" is not available in SKU_TABLE table.
Once I insert SKU number "A0814822" in SKU_TABLE table.
The corresponding records automatically should be inserted in the LEAD_TIME_TABLE
and should be deleted from LEAD_TIME_TABLE_STAGING.
[code]SELECT * FROM LEAD_TIME_TABLE_STAGING; --- should return NULL.
SELECT * FROM LEAD_TIME_TABLE;
SKU GEO LEAD_TIME
A0814817 GB 30
A0814818 AT 20
A0814819 GB 20
A0814820 BE 20
A0814821 GB 30
A0814822 BE 30[/code]
Please help me.
Thanks in advance.Hi,
I have resolved this issue.
But I have stuck up in implementing some of the scenarios.
Req1:
IF the action is update then the records should be updated in the "LEAD_TIME_TABLE" table
IF the action is update then the records should be updated in the "LEAD_TIME_TABLE" table
based on the below condition.
UPDATE LEAD_TIME_TABLE SET lead_time= lead time from xml message
WHERE LEAD_TIME_TABLE.SKU=sku from xml message AND LEAD_TIME_TABLE.GEO=geo from xml message;
Req3:
IF the action is add then the records should be inserted in the "LEAD_TIME_TABLE" and "LEAD_TIME_TABLE_STAGING" table
based on the below conditions.
Req3.1:
If SKU from XML message is available in "schema_name.SKU_TABLE" table.
The schema_name.SKU_TABLE table should be selected based on "business_unit_id" of XML message and "sid" of MAPPING table WHERE business_unit_id=sid.
then the three parameter(GEO SKU LEAD_TIME) values from XML message and two fields MODEL,CLASS from SKU_TABLE
should be inserted into "LEAD_TIME_TABLE" table.
Req3.2:
If SKU from XML message is not available in "schema_name.SKU_TABLE" table
The schema_name.SKU_TABLE table should be selected based on "business_unit_id" of XML message and "sid" of MAPPING table WHERE business_unit_id=sid.
then the four parameter(BUSINESS_UNIT_ID GEO SKU LEAD_TIME) values from XML message
should be inserted into "LEAD_TIME_TABLE_STAGING" table.
Req3.3:
Once the new SKU is avilable in "schema_name.SKU_TABLE" table then the corresponding SKU record should be
inserted into "LEAD_TIME_TABLE" table and that record should be deleted from "LEAD_TIME_TABLE_STAGING" table.
The schema_name.SKU_TABLE table should be selected based on "business_unit_id" of LEAD_TIME_TABLE_STAGING and "sid" of MAPPING table WHERE business_unit_id=sid.
I am posting required scripts and test cases.
[code]CREATE TABLE LEAD_TIME_TABLE(sku VARCHAR2(20),model VARCHAR2(20),class CHAR(1),geo VARCHAR2(6),lead_time NUMBER,created DATE);
CREATE TABLE LEAD_TIME_TABLE_STAGING(business_unit_id NUMBER,sku VARCHAR2(20),geo VARCHAR2(6),lead_time NUMBER);
CREATE TABLE SKU_TABLE(sku VARCHAR2(20),model VARCHAR2(20),class VARCHAR2(10));
CREATE TABLE mapping(sid NUMBER,schema_name VARCHAR2(20));
INSERT INTO LEAD_TIME_TABLE(SKU,GEO,LEAD_TIME) VALUES('A0814817','GB',30);
INSERT INTO LEAD_TIME_TABLE(SKU,GEO,LEAD_TIME) VALUES('A0814818','AT',20);
INSERT INTO LEAD_TIME_TABLE(SKU,GEO,LEAD_TIME) VALUES('A0814819','GB',20);
INSERT INTO LEAD_TIME_TABLE(SKU,GEO,LEAD_TIME) VALUES('A0814820','BE',20);
INSERT INTO SKU_TABLE VALUES('A0814817','M125','C111');
INSERT INTO SKU_TABLE VALUES('A0814818','M127','A111');
INSERT INTO SKU_TABLE VALUES('A0814819','M126','A111');
INSERT INTO SKU_TABLE VALUES('A0814820','N100','B111');
INSERT INTO SKU_TABLE VALUES('A0814821','P123','B111');
INSERT INTO mapping VALUES(202,'WEDB');
INSERT INTO mapping VALUES(2828,'HR');
INSERT INTO mapping VALUES(3838,'BB');
[/code]
Test case for req3.1:
The action for SKU numbers "A0814821" "A0814822" are insert.
The SKU number "A0814821" is available in schema_name.SKU_TABLE table.
so the record should be inserted in the LEAD_TIME_TABLE.
[code]SELECT * FROM LEAD_TIME_TABLE;
SKU MODEL CLASS GEO LEAD_TIME
A0814817 M125 C111 GB 30
A0814818 M127 A111 AT 20
A0814819 M126 A111 GB 20
A0814820 N100 B111 BE 20
A0814821 P123 B111 GB 30
[/code]
Test case for req3.2:
The action for SKU numbers "A0814821" "A0814822" are insert.
The SKU number "A0814822" is not available in SKU_TABLE table.
so the record should be inserted in the LEAD_TIME_TABLE_STAGING.
[code]SELECT * FROM LEAD_TIME_TABLE_STAGING;
BUSINESS_UNIT_ID SKU GEO LEAD_TIME
2828 A0814822 BE 30[/code]
Test case3.3.3:
The action for SKU numbers "A0814821" "A0814822" are insert.
The SKU number "A0814822" is not available in SKU_TABLE table.
Once I insert SKU number "A0814822" in SKU_TABLE table.
The corresponding records automatically should be inserted in the LEAD_TIME_TABLE
and should be deleted from LEAD_TIME_TABLE_STAGING.
[code]INSERT INTO SKU_TABLE VALUES('A0814822','P123','B111');
SELECT * FROM LEAD_TIME_TABLE_STAGING; --- should return NULL.
SELECT * FROM LEAD_TIME_TABLE;
SKU MODEL CLASS GEO LEAD_TIME
A0814817 M125 C111 GB 30
A0814818 M127 A111 AT 20
A0814819 M126 A111 GB 20
A0814820 N100 B111 BE 20
A0814821 P123 B111 GB 30
A0814822 P123 B111 GB 30[/code]
I am able to implement Req1 and Req3.1 for action UPDATE and INSERT in single merge statement.
However my code is not taking care of all my requirements.
Please find my below code.
[code] CREATE OR REPLACE PACKAGE BODY messg_values_process
AS
procedure ProcessInboundLtimeMessage(p_xml_message XmlType)
is
begin
for work_unit in (
select message.MESSAGE_ID
, work_unit.ACTION
, work_unit.LEADTIME_NODES
from XmlTable(
'/MESSAGES/MESSAGE'
passing p_xml_message
columns
MESSAGE_NO for ordinality
, MESSAGE_ID number path '@ID'
, WORK_UNIT_NODES XmlType path 'MSG/WORK_SET/WORK_UNIT'
) message
, XmlTable(
XmlNamespaces(
'urn:schemas-microsoft-com:rowset' as "rs"
, '#RowsetSchema' as "z"
'/WORK_UNIT'
passing message.WORK_UNIT_NODES
columns
WORK_UNIT_NO for ordinality
, ACTION varchar2(10 char) path '@ACTION'
, LEADTIME_NODES XmlType path 'RECORDSET[@TABLE_NAME="LEAD_TIME"]/xml/rs:data/z:row'
) work_unit
LOOP
CASE work_unit.ACTION
WHEN 'ADD' THEN MergeData(work_unit.LEADTIME_NODES);
WHEN 'UPDATE' THEN MergeData(work_unit.LEADTIME_NODES);
WHEN 'DELETE' THEN RemoveData(work_unit.LEADTIME_NODES);
ELSE null;
END CASE;
END LOOP;
END ProcessInboundLtimeMessage;
procedure MergeData(p_leadtime_nodes XmlType)
is
begin
if (p_leadtime_nodes is not null) then
merge into LEAD_TIME_TABLE old
using(
select *
from XmlTable(
XmlNamespaces(
'urn:schemas-microsoft-com:rowset' as "rs"
, '#RowsetSchema' as "z"
'/z:row[not(@business_unit_id=following-sibling::z:row/@business_unit_id)]'
passing p_leadtime_nodes
columns
ITEM_NO for ordinality
, BUSINESS_UNIT_ID number path '@business_unit_id'
, GEO varchar2(20 char) path '@geo'
, SKU varchar2(20 char) path '@sku'
, LEAD_TIME number path '@lead_time'
) NEW
ON (old.VK_UNIT = new.SKU
AND old.GEO=new.GEO)
when matched then update
set old.LEAD_TIME = new.LEAD_TIME
when not matched then INSERT
( old.VK_UNIT
, old.MODEL
, old.CLASS
, old.GEO
, old.LEAD_TIME
, old.COUNTDOWN
, old.LAST_UPDATED_DATE
values
( new.SKU
,'A123'
,'A1234'
, new.GEO
, new.LEAD_TIME
, 'N'
, sysdate
end if;
exception
when others then
LogDataError(
'MergeData Procedure Failed #: '||chr(10)||sqlerrm
, null
, null
END MergeData;
END messg_values_process;
/[/code]
Please help me.
Thanks. -
Hi,
We have some errored XML messages, we need to correct these messages in SXMB_MONI and restart from BI. We are on BI 7 SP15.
I understand that SP19 has enabled this functionality in the editor. However we are on SP15 and we have to urgently fix the issue.
Any ideas ? Is there SAP note?
thank you
UmangOne option,
Use Runtime work bench and manually send the message from the runtime work bench with the corrected payload.
RWB --> Integration Engine --> Test Message.
Fill the sender details as is in the Receiver Determination of your interface, give the correct payload, user id and password and message should go through.
But like mentioned, if in production, make sure you know what you are doing and more importantly are authorized to do so.
Regards
Bhavesh -
How to get the XML messages from JMS Queue in BPM
I have one requirement in my application.we are sending XML messages to the JMS Queue.How to get the XML messages from JMS Queue and how to Extract the details from XMl.
can you please send me the code to get the XML messages from the JMS Queue.
Thank you,Hi,
Sure others will have some other ideas, but here's what I typically do to get the XML from a JMS queue. Inside the Global Automatic that pops the messages off the queue you'd have logic similar to this:
artifactInfoNodes as Any[]
xmlObject as Fuego.Xml.XMLObject = XMLObject()
load xmlObject using xmlText = message.textValue
. . . Once you have this, it's a matter of deciding what you want to do with the message. Most times you'll parse the XML (using XPATH statemens), set argument variables and create a work item instance.
Hope this helps,
Dan -
I want to use ODI to read XML messages from JMS queue and then process it..
I want to use oracle ODI (Oracle Data Integrator) to read XML messages from JMS queue and then process it.. i also want to process and validate the data in it....
Could anyone please tell me the steps to achieve the same. I tried some ways which i got on OTN, but not able to implement it exactly...
As i m very new to ODI, it will be great if you provide detailed steps..
Thanks in advance for your help....Hi,
Were you able to do it? We are facing this same issue now and, despite the fact the docs say otherwise, it does not seem to be a trivial task.
TIA,
Tedi -
Reading an ebXML message from a JAXMServlet
I have the following servlet in Tomcat 4.1.18, using the contents of java_xml_pack-summer02_01:
public class Consume extends JAXMServlet implements OnewayListener
private ProviderConnectionFactory pcf;
private ProviderConnection pc;
private static final String providerURI = "http://java.sun.com/xml/jaxm/provider";
//private MessageFactory messageFactory;
public void init(ServletConfig servletConfig) throws ServletException
super.init(servletConfig);
try
pcf = ProviderConnectionFactory.newInstance();
pc = pcf.createConnection();
setMessageFactory(new EbXMLMessageFactoryImpl());
catch (Exception e)
e.printStackTrace();
throw new ServletException("Couldn't initialize " + this.getClass().getName() + " servlet: " + e.getMessage());
public void onMessage(SOAPMessage message)
EbXMLMessageImpl ebXML = null;
try
System.out.println("== messagetype=" + message.getClass().getName());
System.out.println("== constructing EbXMLMessage");
ebXML = (EbXMLMessageImpl)message;
System.out.println("== got EbXMLMessage " + ebXML.toString());
catch(Exception e)
System.out.println("== Couldn't create ebXML message from SOAP message: " + e);
if(ebXML!=null)
System.out.println("EbXML: From " + ebXML.getFrom().toString());
System.out.println("EbXML: To " + ebXML.getTo().toString());
System.out.println("EbXML: Sender " + ebXML.getSender().toString());
System.out.println("EbXML: Receiver " + ebXML.getReceiver().toString());
System.out.println("EbXML: CPAId " + ebXML.getCPAId());
System.out.println("EbXML: Conversation " + ebXML.getConversationId());
System.out.println("EbXML: Action " + ebXML.getAction());
System.out.println("EbXML: MessageId " + ebXML.getMessageId());
Manifest manifest = ebXML.getManifest();
Reference[] refs = manifest.getReferences();
for(int i=0; i<refs.length; i++)
System.out.println("EbXML ref " + refs.getId() + ": " + refs[i].getDescription());
...etc
However, after the "ebXML = (EbXMLMessageImpl)message;" line, all of the ebXML.get*() calls return null. If I use "ebXML = new EbXMLMessageImpl(message);", I get the same null results.
I can continue on successfully deal with the SOAPMessage, but how do I correctly interpret the SOAPMessage as an EbXMLMessageImpl?
Thanks.
PJDMAfter investigating this, the problem seems to be that com.sun.xml.messaging.jaxm.ebxml.EbXMLMessageImpl is using the namespace
NS_URI = "http://www.ebxml.org/namespaces/messageHeader";
instead of
NS_URI = "http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd";
Subsequently, the same class attempts to parse timeStamp as a long, instead of an ISO8601 string. -
OSB - Service to receive message from JMS and route to different queues
Hi,
I am completely new to SOA suite, so please bear my question :)
I have a requirement to send XML messages to the different queues(external client facing queue) based on their contents. These XML messages are generated inside the application based of various business scenarios.
We have adapted following approach to do it
1. Application Service will construct the message and send it to the internal JMS queue (We are intending to use JAXB objects to construct message)
2. On the OSB, we need to define a service, which will keep polling messages from this intermediate jms queue
and somehow based on some routing information, it will post those messages to the respective external facing queue.
For the first part I am using spring's JmsTemplate to send message to queue
For second part - I am not sure what should be the approach?
we are using Oracle 10g Fusion Middleware
Please guide
CheersThank you guys for all your help. Very soon I will try and see how it works. Meantime just an additional question
Do I need to define a canonical xsd for all different types of xml messages? so that proxy can extract the routing info and route the actual message to different queues?
And re-directing to different queue in OSB means I need to define business service for each queue or I can put message directly into the destination queue by referring its jndi name in the proxy service configuration?
Regards,
Y -
Sending message from oracle to middleware through oracle messaging gateway
Hi,
I am very new to oracle AQ and oracle messaging gateway. I am actually trying to propagate a message from oracle to middleware through oracle messaging gateway.
I have created the link between oracle messaging gateway and middleware(IBM Websphere).
1.*Created an object type with a single attribute of type sys.xmltype*.
create or replace type xpctas_type as object(payload sys.xmltype);
2.*Created a qtable with payload type as xpctas_type, a queue and started the queue.*begin
dbms_aqadm.create_queue_table(
queue_table => 'xpctas_qtab',
queue_payload_type => 'xpctas_type',
multiple_consumers => TRUE
dbms_aqadm.create_queue(queue_name =>'xpctas_q',
queue_table => 'xpctas_qtab',
max_retries => 16);
dbms_aqadm.start_queue('xpctas_q');
end;
3.*Created a transformation that converts user defined type xpctas_type to messaging gateway canonical type sys.MGW_BASIC_MSG_T.*
For this I created a function that converts xpctas_type to messaging gateway canonical type sys.MGW_BASIC_MSG_T.
CREATE OR REPLACE FUNCTION APPS.order_2_basic(my_order in xpctas_type)
RETURN sys.mgw_basic_msg_t
IS
v_xml XMLTYPE;
v_text varchar2(4000);
v_clob CLOB;
v_basic sys.mgw_basic_msg_t;
text_body sys.mgw_text_value_t;
header sys.mgw_name_value_array_t;
BEGIN
v_xml := XMLTYPE.createXML(my_order,NULL,NULL);
v_basic := sys.mgw_basic_msg_t.construct;
header := sys.mgw_name_value_array_t(sys.mgw_name_value_t.construct_integer('MGW_MQ_characterSet','1208'),
sys.mgw_name_value_t.construct_integer('MGW_MQ_priority', '7'));
IF(LENGTH(v_xml.getstringval())>0 AND LENGTH(v_xml.getstringval())<=4000) THEN
v_text := v_xml.getStringVal();
text_body := sys.mgw_text_value_t(v_text,NULL);
ELSE
dbms_lob.createtemporary(v_clob,TRUE,dbms_lob.session);
v_clob:=v_xml.getClobVal();
text_body := sys.mgw_text_value_t(NULL,v_clob);
dbms_lob.freetemporary(v_clob);
END IF;
v_basic:=sys.mgw_basic_msg_t(header,text_body,NULL);
RETURN v_basic;
END order_2_basic;
begin
dbms_transform.create_transformation(
schema => 'apps',
name => 'order_to_basic',
from_schema => 'apps',
from_type => 'xpctas_type',
to_schema => 'sys',
to_type => 'mgw_basic_msg_t',
transformation => 'Apps.order_2_basic(source.user_data)');
end;
4. Registered a foreign queue.
declare
v_options sys.mgw_properties;
gv_mq_queue_name VARCHAR2(32);
begin
gv_mq_queue_name := 'MB.O2C.SOFTWARESOLUTION';
v_options := sys.mgw_properties(
sys.mgw_property('MQ_openOptions', '2066') );
dbms_mgwadm.register_foreign_queue(
name => 'destq', -- MGW foreign queue name
linkname => 'mqlink', -- name of link to use
provider_queue => RTRIM(gv_mq_queue_name), -- name of MQSeries queue
domain => dbms_mgwadm.DOMAIN_QUEUE, -- single consumer queue
options => v_options );
end;
5. Added a subscriber with transformation.
begin
dbms_mgwadm.add_subscriber(
subscriber_id => 'sub_aq2mq', -- MGW subscriber name
propagation_type => dbms_mgwadm.outbound_propagation,
queue_name => 'apps.xpctas_q',
destination => 'destq@mqlink',
transformation => 'apps.order_to_basic');
end;
6. Added a scheduler
begin
dbms_mgwadm.schedule_propagation(
-- schedule name
schedule_id => 'sch_aq2mq',
-- outbound propagation
propagation_type => dbms_mgwadm.outbound_propagation,
-- AQ queue name
source =>'apps.xpctas_q',
-- MGW foreign queue with link
destination =>'destq@mqlink');
-- The remaining fields currently not used by MGW
end;
7. Enqueued a user defined data type into the qtable.
declare
l_xmlstring varchar2(2000);
l_payload sys.xmltype;
my_order xpctas_type;
enqueue_options DBMS_AQ.enqueue_options_t;
message_properties DBMS_AQ.message_properties_t;
msgid RAW( 16 );
v_num Number;
begin
SELECT '<?xml version="1.0" encoding="UTF-8" ?>
<Q1:XXRFG_PRCS_CNCT_TO_ASSETS_STG xmlns:Q1="http://www.ibm.com/websphere/crossworlds/2002/BOSchema/XXRFG_PRCS_CNCT_TO_ASSETS_STG" version="3.0.0" verb="Create" locale="en_US.UTF-8" delta="false">
<Q1:STAGING_ID>221</Q1:STAGING_ID>
<Q1:SW_INSTANCE_ID>18595755</Q1:SW_INSTANCE_ID>
<Q1:MC_INSTANCE_ID>194734</Q1:MC_INSTANCE_ID>
<Q1:OPCO>NUK</Q1:OPCO>
<Q1:RELATIONSHIP_FLAG>N</Q1:RELATIONSHIP_FLAG>
<Q1:RELATIONSHIP_TYPE>Connected To</Q1:RELATIONSHIP_TYPE>
<Q1:ObjectEventId />
</Q1:XXRFG_PRCS_CNCT_TO_ASSETS_STG>'
INTO l_xmlstring
FROM dual;
SELECT XMLTYPE(l_xmlstring)
INTO l_payload
FROM dual;
my_order:=xpctas_type(l_payload);
dbms_output.put_line(my_order.payload.getstringval());
DBMS_AQ.enqueue( queue_name => 'APPS.xpctas_q',
enqueue_options => enqueue_options,
message_properties => message_properties,
payload => my_order,
msgid => msgid
COMMIT;
END;
As soon as I enqueued the message the subscriber picked the message and sent it to middleware. I found the below message in the middleware
MD ÿÿÿÿ ¸ MQSTR AMQ HBU473QC61 PTÀ+H^ HBU473QC61 mqm 2012112109335869 ÿÿÿÿ
*<XPCTAS_TYPE><PAYLOAD><Q1:XXRFG_PRCS_CNCT_TO_ASSETS_STG xmlns:Q1="http://www.ibm.com/websphere/crossworlds/2002/BOSchema/XXRFG_PRCS_CNCT_TO_ASSETS_STG" version="3.0.0" verb="Create" locale="en_US.UTF-8" delta="false">*
*<Q1:STAGING_ID>221</Q1:STAGING_ID>*
*<Q1:SW_INSTANCE_ID>18595755</Q1:SW_INSTANCE_ID>*
*<Q1:MC_INSTANCE_ID>194734</Q1:MC_INSTANCE_ID>*
*<Q1:OPCO>NUK</Q1:OPCO>*
*<Q1:RELATIONSHIP_FLAG>N</Q1:RELATIONSHIP_FLAG>*
*<Q1:RELATIONSHIP_TYPE>Connected To</Q1:RELATIONSHIP_TYPE>*
*<Q1:ObjectEventId/>*
*</Q1:XXRFG_PRCS_CNCT_TO_ASSETS_STG>*
*</PAYLOAD></XPCTAS_TYPE>*
It has some junk data in the begining. How can I remove this junk data?? Any help provided on this would be of great help.
Experts on oracle mesaging gateway and AQ, Please help.
Thanks & Regards,
SachinHello,
your setup of the message gateway seems to be ok.
Did you check the corresponding versions of the client libraries (*.jar) ? These are the libraries on
db server side (e.g. aqapi.jar, based on your CLASSPATH entries in file "mgw.ora") and for the IBM MQ jars.
Kind regards,
WoG
Maybe you are looking for
-
Graphic distortion when switching between external and built-in display (rMBP)
Recently (within the past two weeks or so) I've noticed a strange issue when switching between my external display (Thunderbolt) and my built-in display on my 15" rMBP. The following issue seems to be specific to Photoshop CS6. Typically, I'll have a
-
Hyperlinks in linked Word documents don't work
Hello All, I'm having a problem with hyperlinks and I'm hoping you can help me. I have a RoboHelp HTML 8 project built out of Word 2007 linked files. There's a dozen Word files right now, but I'm hoping to scale up the project eventually. Each file i
-
After the new programming interface loaded, my screen is now too large. Specifically, the picture is too wide. Any ideas? It was perfect and I didn't change anything.
-
PSE6 - HOw to collect photos together in one folder
I have managed to get photos scattered across several folders, some on my laptop and some on an external hard drive. I have managed to get them all into one catalogue, but what is the best way to physically move them all into one folder so it canbe b
-
Is Droid Maxx able to sync Contacts with Facebook
My old Droid used to sync the photos from FB with my contacts, but I have yet to find a way to make my new replacement phone (Droid Maxx) do that. Is it no longer posible or am I missing something?