Xml messaging using jms code please
hello friends
presently i want to know how to send xml messaging using jms ..please
give me answers in simple words. please give me code
XML messages are text, so use a TextMessage. The JMS API Spec even notes that XML was a primary reason for having a TextMessage (They foresaw that XML "likely become popular").
Similar Messages
-
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 -
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 -
Read Object Message using JMS Adapter
Hi,
My JMS queue receives an object message.I want to read that object message using JMS adapter.Currently the JMS Adapter payload type is given options to read only 'TextMessage','BytesMessage','MapMessage'.How to read ObjectMesage using this adapter?Please help me on this?Hi,
As far as i know, JMS Object Messages is not supported by XI JMS adapter.
you need to have the JMS provider to transform the message to bytes messages.
(Refer to SAP note 856346) -
Splitting xml message using XSLT
Hi,
I have XML message that I want to split up using XSLT. Following is the structure of the XML message.
<Meters>
<Meter>
<ID>1</ID>
<Type>A</Type>
<Reading ref="1A" />
</Meter>
<Meter>
<ID>2</ID>
<Type>A</Type>
<Reading ref="2A" />
</Meter>
<Meter>
<ID>3</ID>
<Type>B</Type>
<Reading ref="3B" />
</Meter>
<Reading>
<refLink>1A</refLink>
<quantity>Watts</quantity>
<value>221.00</value>
</Reading>
<Reading>
<refLink>2A</refLink>
<quantity>Wh d</quantity>
<value>0.00</value>
</Reading>
<Reading>
<refLink>3B</refLink>
<quantity>Wh r</quantity>
<value>3.00</value>
</Reading>
</Meters>
The split up should happen on the <Meter> tag. Currently, this message has three <Meter> elements. The output should result in 3 different XML messages each having its own <Meter> element. Also, please note that each <Meter> has <Reading> which is linked to the actual <Reading> data using "ref" attribute and "refLink". The value of "ref" attribute will be unique through out the XML message.
Expected output: 1.xml
<Meters>
<Meter>
<ID>1</ID>
<Type>A</Type>
<Reading ref="1A" />
</Meter>
<Reading>
<refLink>1A</refLink>
<quantity>Watts</quantity>
<value>221.00</value>
</Reading>
</Meters>
and similarly 2 more XMLs.
Please let me know if anyone has done this kind of work in XSLT.You are right I see that xsl:document is in 1.1 recommendation, but was referred by
XSLT books I have.
I found one site that's explaining this
http://www.vbxml.com/xsl/elmxsl_document.asp
http://www.w3.org/TR/xslt11/#multiple-output
I am almost trying now to reverting to using java.util.regex and doing the split
brutforce.. :))))
- Ravi -
Dequeue jms messages using JMS adapter
Hi,
I have created jms server, modules, queue from console-messaging-jms modules.
I am trying to create a soa composite to consume message from this queue.
In JMS adapter wizard - step 7 - i have selected the destination queue. In this step, what should be the jndi name?
do i need to update weblogic-ra.xml file?
Can someone please point me to the steps/doc to create jms adapter to consume message from Oracle Weblogic JMS? (basically configure deployment descriptor)
Thanks
GaneshBy passing username/password in the outbound connection pool, i was able to connect to the secured weblogic jms..
This was my config for eis/wls/Queue connection pool..
AcknowledgeMode java.lang.String AUTO_ACKNOWLEDGE
ConnectionFactoryLocation java.lang.String weblogic.jms.XAConnectionFactory
FactoryProperties java.lang.String
IsTopic java.lang.Boolean false
IsTransacted java.lang.Boolean false
Password java.lang.String weblogic123
Username java.lang.String weblogic
After making the change ( remember to hit enter after modifying password and username fields, else change wont persist) , i saved it with a new deployment plan and updated the deployment with the new plan. Then redeployed the composite containing the jms adapter and I am able to see a consumer created for the queue. -
How to delete a perticular node from xml file using java code
Hii All,
Now i am trying to delete a perticular node from xml file.Like...
XML file:
<Licence>
<SERVER>
<was id="1">1</was>
<was id="2">2</was>
</SERVER>
</LICENCE>
I am working in messaging service using JABBER framework with whiteboard facility.
Here Some commands i have created to add,modify,delete nodes from xml file.They Are
1.If u want to add a new node then.
create Licence.SERVER <ss id="3">ddd</ss> lic.xml
(here u want to add a new node called "ss" under Licence.SERVER.
And lic.xml is tyhe xml file name where it was saved.
2.If u want to delete a node(Suppose <was id="1">),then the command should be
delete Licence.SERVER.was:id='"1" lic.xml
A problem arises that here it find two was attributes.And it delete the last was attribute,not the requested node.
PLEASE HELP ME IN SOLVING THIS CODE..
------------------------------------Looks like you clicked on "Post" before you pasted in the code you were talking about.
-
Transform Bytes message to text message using JMS
please any one tell me how to transform Bytes message coming from Queue to JMS...and i want convert it into text message ...
please give me the source code or tell me the way to solve this problem...
i am new to java....
thanks
KiranYour question is not clear. Are you getting an object from the queue or are you getting a byte from the queue?
I am not sure about byte coming from a queue, If you are getting an object then you can do this
In your MDB onMessage() you can do the following
public void onMessage(Message myMessage)
ObjectMessage Obj = (ObjectMessage) myMessage;
Object Msg = Obj.getObject();
MyMessage lMessage = (MyMessage) Msg;
//do your processing here with the object
} -
Idoc xml message in JMS adapter
Hi All,
Question 1:
My scenario is MQ series(JMS adaptr) to SAP(IDOC adptr) . In my mapping both source and target structure is same IDOC structure.Where MQ series will send IDOC xml. In such case shall i need to do content conversion at JMS adapter level or not.whthr IDOC xml can be directly handle at Mapping level without doing any content conversion in adapter level.
Question 2(viceversa):
SAP(IDOC adptr) to MQ series(JMS adaptr) . In my mapping both source and target structure is same IDOC structure.Where MQ series expect me IDOC xml. How to handle content conversion at JMS recvr adapter level.
my assumption only in case of (xml to plain) and (plain to xml) require content conversion here my Input and output is IDOC xml.Saravanan,
As Expert Vishnu Mentioned,
>In such case shall i need to do content conversion
NO need to use
>How to handle content conversion at JMS recvr adapter level
http://help.sap.com/saphelp_nw04/helpdata/en/24/4cad3baabd4737bab64d0201bc0c6c/content.htm
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/xi/xi-adapters/how%20to%20use%20the%20content%20conversion%20module%20with%20xi%203.0%20j2ee%20jms%20adapter.pdf
Cheers
Agasthuri Doss -
Instance roll back while validating the XML message using Mediator
Hi all,
I am facing issue when calling a mediator process in validating the XML before invoking the target application
Below is the error for the instance.
com.collaxa.cube.engine.EngineException">
Global retry rollback fault thrown.
The current JTA transaction is aborting due to an user rollback fault being thrown. The upstream component should retry in a new JTA transaction upon catching this fault.
This exception was caused by a global retry fault being thrown from downstream component. The user had directed the BPEL engine to roll back the current JTA transaction and retry within new JTA transactions for the specified number of times and retry interval.
There is no action recommended.
-<stack>
<f>
com.collaxa.cube.ws.WSInvocationManager.invoke#334
</f>
<f>
com.collaxa.cube.engine.ext.common.InvokeHandler.__invoke#1070
</f>
<f>
com.collaxa.cube.engine.ext.common.InvokeHandler.handleNormalInvoke#584
</f>
<f>
com.collaxa.cube.engine.ext.common.InvokeHandler.handle#132
</f>
<f>
com.collaxa.cube.engine.ext.bpel.common.wmp.BPELInvokeWMP.__executeStatements#74
</f>
<f>
com.collaxa.cube.engine.ext.bpel.common.wmp.BaseBPELActivityWMP.perform#166
</f>
<f>
com.collaxa.cube.engine.CubeEngine.performActivity#2687
</f>
<f>
com.collaxa.cube.engine.CubeEngine._handleWorkItem#1190
</f>
<f>
com.collaxa.cube.engine.CubeEngine.handleWorkItem#1093
</f>
<f>
com.collaxa.cube.engine.dispatch.message.instance.PerformMessageHandler.handleLocal#76
</f>
<f>
com.collaxa.cube.engine.dispatch.DispatchHelper.handleLocalMessage#218
</f>
<f>
com.collaxa.cube.engine.dispatch.DispatchHelper.sendMemory#297
</f>
<f>
com.collaxa.cube.engine.CubeEngine.endRequest#4609
</f>
<f>
com.collaxa.cube.engine.CubeEngine.endRequest#4540
</f>
<f>
com.collaxa.cube.engine.CubeEngine._createAndInvoke#713
</f>
<f>
com.collaxa.cube.engine.CubeEngine.createAndInvoke#560
</f>
<f>
</f>
</stack>
</exception>
-<root class="oracle.fabric.common.FabricInvocationException">
java.lang.NullPointerException
-<stack>
<f>
oracle.tip.mediator.serviceEngine.MediatorServiceEngine.process#1006
</f>
<f>
oracle.tip.mediator.serviceEngine.MediatorServiceEngine.post#663
</f>
<f>
oracle.integration.platform.blocks.mesh.AsynchronousMessageHandler.doPost#142
</f>
<f>
oracle.integration.platform.blocks.mesh.MessageRouter.post#197
</f>
<f>
oracle.integration.platform.blocks.mesh.MeshImpl.post#215
</f>
<f>
sun.reflect.GeneratedMethodAccessor2091.invoke
</f>
<f>
sun.reflect.DelegatingMethodAccessorImpl.invoke#25
</f>
<f>
java.lang.reflect.Method.invoke#597
</f>
<f>
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection#307
</f>
<f>
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint#182
</f>
<f>
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed#149
</f>
<f>
oracle.integration.platform.metrics.PhaseEventAspect.invoke#59
</f>
<f>
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed#171
</f>
<f>
org.springframework.aop.framework.JdkDynamicAopProxy.invoke#204
</f>
<f>
$Proxy341.post
</f>
<f>
oracle.integration.platform.blocks.local.LocalInvocationProcessor.post#211
</f>
<f>
</f>
</stack>
{code}
I have some knowledge in transaction but this no where in my picture. In bpel process no where i mention transaction is* required* for the mediator component and my mediator is one way asyn process.
Also i defined catch all activity in my bpel and if some thing happen it suppose to move to catch all block but it didn't happen here.
I look forward from some one to help me in resolving in this.
Appreciate some one help here.
Regards,
Tarak.Thanks for the prompt help. Is there any other way instead of removing the DTD line ?. Because the xml is coming as a string and removing the dtd and then adding it will unneccesary hamper performance. Do you any other way in which even though I don't remove the line I get the output without removing the dtd line ?.
thanks and regards,
Sachin -
Asynchronous Messages (using JMS) improves performance even when the desire
I am being told that even when point A to point B communication,
originating at point A, is synchronous, send a message to B wait for B
to finish processing and send a tagged(to corelate the response to the
request) message back asynchronously via another Q will improve the
response time and scalability during peak volume vis-a-vis a
synchronous API call between A and B. A being a servlet B being an
application server hosted on a container. Keep in mind that this
application cannot live with the fact that there is a possibility that
the response may never come back (timeout). The expected response time
during average load is <2sec. Peak load 110 transactions per second.
Response time of 5 secs during peak load is unacceptable. Clustering is
certainly a consideration. Any opinion, pointers, etc. is welcome.
Have a wonderful weekend!!Hi,
I personally think that you should go for an asynchronous solution as that�s what JMS is all about. You can obviously use a Requestor and go for a RPC style solution but there are overheads:
1) Your messages cannot be concurrently processed
2) A temporary destination (to collect the response) is created per request
3) There is a delay between each message processing event
The number of app server instances that you would need is really application dependant and app server as well. But according to my experience, and assuming that your message process is simple, I would say that less than 2s delay is easily achievable.
By the way, have you considered using a light weight app server like an MDS container? For more info you can have a look at: http://www.arjuna.com/products/arjunams/tutorials/mds/index.html
Hope this helps
Arnaud
www.arjuna.com -
Updating an existing xml file using java code
hi friends,
I have simple problem, I have an existing xml file and I want to update some of the values in the file.
can any one send me the java code for that.
bye.
-harishorg.w3c.dom.Document d = parseXmlFile("D:/www/Detailcache/detail.xml", false);
public static Document parseXmlFile(String filename, boolean validating) {
try {
// Create a builder factory
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setValidating(validating);
// Create the builder and parse the file
Document doc = factory.newDocumentBuilder().parse(new File(filename));
return doc;
} catch (Exception e) {
System.out.println("ERROR-->");e.printStackTrace();
return null;
look at .. for more related examples
http://javaalmanac.com/egs/javax.xml.parsers/BasicDom.html?l=rel -
i have an ipad wifi celluar and cannot text. Is there something i need to do to make this work?
You can only use iMessage by turning on in settings, sign up with your email.
You can only text other Apple users that also turn on iMessage. You must use their email unless they have an iPhone.
You can't text to non apple devices. -
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 -
How to compare two huge xml files(50MB+) using Java Code
I want to compare two huge xml files using java code and need to find the difference of those xml files
is there any API for thatYou should find third party API
Maybe you are looking for
-
I have a Macbook Pro, I bought it in June or July or 2011, so I'm not sure which model that makes it. But anyway, just recently, I noticed that when I plug my iPhone 5 into it, it does not recognize or acknowledge that my phone is plugged in at all.
-
ITunes library file corrupt after updating?
Just the other day I updated to the latest iTunes software. This is the first time I've tried to use it and it keeps freezing (the swirly rainbow icon) until I eventually have to give up and force quit. My iTunes library is on an external hard drive
-
HT204389 I can no longer access SIRI on my 4s. It is optioned "on"
I can no longer access SIRI on my 4s. It is optioned "on"
-
How do I stop Mac App Store apps listing as "Accept" rather than the purchase price?
Hi there, I'm attempting to buy iPhoto '11 from the Mac App Store but it lists as "Accept" rather than the purchase price. When I click on Accept a message pops up saying "These apps cannot be accepted by your Apple ID: These apps were already assign
-
OpenAL sound effects not working .. Please Help
Hi I ported OpenAL to our platform and able to play the wav files. I wrote a sample openal application and try to produce some sound effects. Play back of audio is working but sound effects are not working. I am using jungle.wav which is mono channel