Code sample to dequeue messages
I am looking for a code sample to dequeue messages from CRM OD? How do I retrieve the xml file after it is generated. Do I need to use a web service to retrieve that?
Preference would be to get the code snippet in java, but not necessary.
Thanks.
Hi,
I'm assuming you are referring to integration event messages? If so, then yes, you do need to use WS in order to retrieve them from CRMOD. Please refer to the CRM On Demand online help for Integration Events. It will provide details on downloading the WSDL file for Integration Events and the schema files which are required to process the events once they are retrieved. The WS User Guide contains details regarding the use of the GetEvents and DeleteEvents methods to retrieve and delete events from the queue.
Sorry, I don't currently have a code sample that I can provide.
Thanks,
Sean
Similar Messages
-
Exception while dequeuing message
Hi,
I am getting an error sayin
"Exception while dequeuing message : Dequeue error in AQ object, ORA-25215: user_
data type and queue type do not match"
What will be the problem?Please help me with solution.
Thanks in advanceThis is the link i am following for enqueuing the message into a queue table, its happening successfully.
http://www.oratechinfo.co.uk/aq.html
I can see the message i enqueued in the queue table with the following query at the scheduled time.
select user_data from queue_table;
Below is the C++ code to dequeue the msg.In DequeueObject() function on this particular line "msgid = oaq.Dequeue();"
the control moves to console which not proceeding further.I am wondering what went wrong.
//This is a simple program showing how to call oo4o api from a mulithreaded application.
//Note that every thread has its own OStartup() and OShutdown() routines.
// PROJECT SETTINGS : Under C/C++ option, make sure the project options is /MT for release
// or /MTd for debug(NOT /ML or /MLd).
#include "windows.h"
#include "stdio.h"
#include <iostream>
#include <process.h>
#include <oracl.h>
using namespace std;
OSession osess ;
int DequeueRaw();
int DequeueObject();
int main(int argc, char **argv)
int retVal = 0;
OStartup(OSTARTUP_MULTITHREADED);
// create session object for each thread. This gives maximum
// concurrency to the thread execution. This is also useful when OO4O
// error reported on session object for one thread cannot be seen by
// another thread.
try
osess.Open();
if ( ! osess.IsOpen() )
cout << "Session not opened: Error: " << osess.GetErrorText() << endl;
osess.Close();
OShutdown();
return -1;
// retVal = DequeueRaw();
retVal = DequeueObject();
catch(OException oerr)
cout << "Exception while dequeuing message : " << oerr.GetErrorText() << endl;
retVal = -1;
return retVal;
// This function dequeues a message of default type(string of characters)
// from the raw_msg_queue.
// Gets the message priority after dequeuing
// Checks if any message with correlation like 'AQ' is available on the queue.
int DequeueRaw()
ODatabase odb;
OAQ oaq;
OAQMsg oaqmsg;
OValue msg;
const char *msgid = 0;
odb.Open(osess, "MICROSOFT", "OMNIPOS", "OMNIPOS");
if ( ! odb.IsOpen() )
cout << "Database not opened: " << odb.GetErrorText() << endl;
odb.Close();
return(-1);
// Open the 'raw_msg_queue'
oaq.Open(odb,"example_queue");
if( !oaq.IsOpen())
cout << "AQ not opened: " << oaq.GetErrorText() << endl;
return(-1);
// Get an instance of the default message(of RAW type)
oaqmsg.Open(oaq);
if( !oaqmsg.IsOpen() )
cout << "AQMsg not opened: " << oaqmsg.GetErrorText() << endl;
return(-1);
// Dequeue a message
//msgid = oaq.Dequeue();
//if (msgid )
// // Retrieve the message attributes
// oaqmsg.GetValue(&msg);
// const char *msgval = msg;
// cout << "Message '" << msgval <<
// "' dequeued at priority : " << oaqmsg.GetPriority() << endl;
// Dequeue message with correlation like "AQ"
oaq.SetCorrelate("%AQ%");
oaq.SetDequeueMode(3);
msgid = oaq.Dequeue();
if (msgid )
// Retrieve the message attributes
char msgval[101];
long len = oaqmsg.GetValue(msgval,100);
msgval[len] = '\0';
cout << "Message '" << msgval <<
"' dequeued at priority : " << oaqmsg.GetPriority() << endl;
// Close all of the objects
oaqmsg.Close();
oaq.Close();
odb.Close();
return 0;
// This function dequeues a message of user-defined type MESSAGE_TYPE
// from the msg_queue.
// Gets the message priority after dequeuing
// Checks if any message with correlation like 'SCOTT' is available on the queue.
int DequeueObject()
ODatabase odb;
OAQ oaq;
OAQMsg oaqmsg;
const char *msgid = 0;
OValue msg;
char subject[255];
char text[255];
odb.Open(osess, "MICROSOFT", "OMNIPOS", "OMNIPOS");
if ( ! odb.IsOpen() )
cout << "Database not opened: " << odb.GetErrorText() << endl;
odb.Close();
return(-1);
// Open the 'msg_queue'
oaq.Open(odb,"example_queue");
if( !oaq.IsOpen())
cout << "AQ not opened: " << oaq.GetErrorText() << endl;
return(-1);
// Get an instance of the udt MESSAGE_TYPE (check out schema for details)
oaqmsg.Open(oaq,1,"MESSAGE_TYPE");
if( !oaqmsg.IsOpen() )
cout << "AQMsg not opened: " << oaqmsg.GetErrorText() << endl;
return(-1);
// Dequeue message with correlation like "SCOTT"
oaq.SetCorrelate("%OMNIPOS%");
oaq.SetDequeueMode(3);
msgid = oaq.Dequeue();
if (msgid )
// Retrieve the message attributes
// Get the subject,text attributes of the message
OObject msgval;
oaqmsg.GetValue(&msgval);
msgval.GetAttrValue("subject", subject,255);
msgval.GetAttrValue("text", text,255);
cout << "Message '" << (subject ? subject :"") << "' & Body : '" << text <<
"' dequeued at priority : " << oaqmsg.GetPriority() << endl;
msgval.Close();
msgid = 0;
oaq.SetNavigation(1);
oaq.SetCorrelate("");
// Dequeue a message
msgid = oaq.Dequeue();
if (msgid )
// Retrieve the message attributes
OObject msgval;
oaqmsg.GetValue(&msg);
msgval = msg;
// Get the subject,text attributes of the message
msgval.GetAttrValue("subject", subject,255);
msgval.GetAttrValue("text", text,255);
cout << "Message '" << (subject ? subject :"") << "' & Body : '" << text <<
"' dequeued at priority : " << oaqmsg.GetPriority() << endl;
msgval.Close();
// Close all of the objects
msgid = NULL;
msg.Clear();
oaqmsg.Close();
oaq.Close();
odb.Close();
return 0;
} -
Code Samples for SDK programming in Java
I need a complete set of Code Samples for SDK programming in Java, like the one that is available in VB and .Net.
For Example, if you look at the following directory of machine where SDK is installed,
C:\ProgramFiles\SAP\SAP Business One SDK\Samples\COM DI\VB.NET
we have following Sample programs in C Sharp, VB6, VB.Net
01.BasicOperations
02.MetaDataOperations
03.UsingSBObob
04.SerialAndBatch
05.OrderAndInvoice
06.ObjectsSchemas
07.Permissions
08.LoadFromXML
09.BudgetEditor
10.Messages Service
11.Basic Company Settings
12. Report Layout Service
13.SaveXML
14.ItemCycleCount
15.ApprovalStagesAndTemplateServices
16.Alert Management Service
Iam looking for Samples like what is available above so that we can understand JCO better.Hi Sridharan,
The only JCO samples I know of are posted in the [thread|;.
Regards,
Vítor Vieira -
Error from sample JAAS client: Message stream modified (41)
I am trying to follow the tutorial for JAAS Authentication located here:
http://java.sun.com/j2se/1.4.2/docs/guide/security/jgss/tutorials/AcnOnly.html
I am trying to run the sample client JaasAcn.java but am getting a strange error when I try to log on to my Active Directory.
I am using Java version: jre1.6.0_03
I can login to Active Directory fine with the credentials I am providing, just not with this client, so I know the credentials are valid.
Here is the error I get that I don't understand. Any suggestions would be very helpful, if you provide help for this
The Error message is: [Krb5LoginModule] authentication failed
Message stream modified (41)
Here is the full output:
C:\Progra~1\Java\jre1.6.0_03\bin\java -Dsun.security.krb5.debug=true -Djava.security.krb5.realm=PRSDev.local -Djava.security.krb5.kdc=192.168.40.72 -Djava.security.auth.login.config=jaas.conf JaasAcn
Debug is true storeKey false useTicketCache false useKeyTab false doNotPrompt f
alse ticketCache is null isInitiator true KeyTab is null refreshKrb5Config is fa
lse principal is null tryFirstPass is false useFirstPass is false storePass is f
alse clearPass is false
Kerberos username [ILea]: sra
Kerberos password for sra:
[Krb5LoginModule] user entered username: sra
Using builtin default etypes for default_tkt_enctypes
default etypes for default_tkt_enctypes: 3 1 23 16 17.
Acquire TGT using AS Exchange
Using builtin default etypes for default_tkt_enctypes
default etypes for default_tkt_enctypes: 3 1 23 16 17.
KrbAsReq calling createMessage
KrbAsReq in createMessage
KrbKdcReq send: kdc=192.168.40.72 UDP:88, timeout=30000, number of retries =3, #bytes=144
KDCCommunication: kdc=192.168.40.72 UDP:88, timeout=30000,Attempt =1, #bytes=144
KrbKdcReq send: #bytes read=202
KrbKdcReq send: #bytes read=202
KDCRep: init() encoding tag is 126 req type is 11
KRBError:sTime is Mon Dec 31 11:56:40 PST 2007 1199131000000
suSec is 884978
error code is 25
error Message is Additional pre-authentication required
realm is PRSDev.local
sname is krbtgt/PRSDev.local
eData provided.
msgType is 30
Pre-Authentication Data:PA-DATA type = 11
PA-ETYPE-INFO etype = 23
Pre-Authentication Data:PA-DATA type = 2
PA-ENC-TIMESTAMP
Pre-Authentication Data:PA-DATA type = 15
AcquireTGT: PREAUTH FAILED/REQUIRED, re-send AS-REQ
Using builtin default etypes for default_tkt_enctypes
default etypes for default_tkt_enctypes: 3 1 23 16 17.
Pre-Authentication: Set preferred etype = 23
KrbAsReq salt is PRSDev.localsraPre-Authenticaton: find key for etype = 23
AS-REQ: Add PA_ENC_TIMESTAMP now
EType: sun.security.krb5.internal.crypto.ArcFourHmacEType
KrbAsReq calling createMessage
KrbAsReq in createMessage
KrbKdcReq send: kdc=192.168.40.72 UDP:88, timeout=30000, number of retries =3, #bytes=210
KDCCommunication: kdc=192.168.40.72 UDP:88, timeout=30000,Attempt =1, #bytes=210
KrbKdcReq send: #bytes read=1182
KrbKdcReq send: #bytes read=1182
EType: sun.security.krb5.internal.crypto.ArcFourHmacEType[Krb5LoginModule] authentication failed
Message stream modified (41)
Authentication failed:
Message stream modified (41)FYI I have fixed this problem (and moved on to the next error)
I disabled the preauthentication requirement on the Active Directory account according to this article:
http://technet2.microsoft.com/windowsserver/en/library/a0bd7520-ef2d-4de4-b487-e105a9de9e4f1033.mspx?mfr=true -
Laura, I need some code samples you mentioned...
Laura,
I posted a message a few days ago regarding calling Stored Procedures in my JDev 3.1 (JDK 1.2.2) BC4J application. I need to be able to call them two different ways. The first involves passing some parameters to the SP and recieving back the ResultSet. In the other instance I simply need to make a call to them to perform some tasks on the DB side. Nothing will be returned from these SP's. You discussed implementing the SQL as a VO and gave me some code showing me how I might do this. You also mentioned that it is possible to create a method on the AppMod and call this from the JSP client. I need to know which method should work best for me and to get the code samples for the second option.
Thanks.
RobHi,
Here is the code I used for the custom method on my VO (same could be used from the app module rather than a specific VO). The stored procedure I am calling here performs some calculations and returns an integer value:
public int getTotalHits(String mon, String year) {
CallableStatement stmt = null;
int total;
String totalhits = "{? = call walkthru.total_hits(?,?)}";
stmt = getDBTransaction().createCallableStatement(totalhits, 1);
try
// Bind the Statement Parameters and Execute this Statement
stmt.registerOutParameter(1,Types.INTEGER);
stmt.setString(2,mon);
stmt.setString(3,year);
stmt.execute();
total = stmt.getInt(1);
catch (Exception ex)
throw new oracle.jbo.JboException(ex);
finally
try
stmt.close();
catch (Exception nex)
return total;
After adding the custom method to your appmoduleImpl.java file and rebuilt your BC4J project, do the following:
1. Select the Application Module object and choose Edit from the context menu.
2. Click on the Client Methods page. You should see the method you added in the Available list.
3. Select the method and shuttle it to the Selected list.
4. Click Finish. You should see a new file generated under the application module object node in the Navigator named appmodule.java that contains the client stubs for your method.
5. Save and rebuild your BC4J project.
I wrote a custom web bean to use from my JSP page to call the method on my VO:
public class GetTotals extends oracle.jdeveloper.html.DataWebBeanImpl {
public void render() {
int totalhits;
try
Row[] rows;
// Retrieve all records by default, the qView variable is defined in the base class
qView.setRangeSize(-1);
qView.first();
rows = qView.getAllRowsInRange();
// instantiate a view object for our exported method
// and call the stored procedure to get the total
ViewObject vo = qView.getViewObject();
wtQueryView theView = (wtQueryView) vo;
totalhits = theView.getTotalHits(session.getValue("m").toString(),session.getValue("y").toString());
out.println(totalhits);
} catch(Exception ex)
throw new RuntimeException(ex.getMessage());
I just call the render method on this custom web bean from the JSP. I am not passing parameters to the render method of the bean, but instead access the parameters I need from the session:
session.getValue("m").toString()
I set these session parameters from the JSP that is called when the user submits their query criteria form. For example:
// get the view parameter from the form String month = request.getParameter("month");
String year = request.getParameter("year");
// store the information for reference later session.putValue("m", month); session.putValue("y", year);
Hope this helps. -
Not able to download code samples
I am trying to download code samples from
Code samples=>WebAS and non of the links work.
I click on an object and accept the disclaimer/terms and the download link appears. When i click on the link i am getting the following message.
<i><b>403
The requested operation is forbidden for this resource.</b></i>
Regards
RajaHello Raja,
Check to see if your internet access blocks ftp connections. This looks like a response that one gets when attempting to access an ftp site through a proxy server that will not allow ftp protocol. Many companies do this as a security measure.
Regards,
David -
Does listen get unblocked if there is uncommitted dequeued message
Here is the scenario.
I have 2 threads.
1 comes in; Does listen on a multi consumer queue. Gets a message and starts
processing.
At this point 2 comes in; Does the listen; At this point there are no new messages
on the queue. But thread 1 has not committed the dequeue. Will the listen wait
for the duration specified ? or will it return right away?
If it did return right away, then I cannot really do a listen until the thread 1 has committed.
What is expected behavior?
Thanks
VijayThe answer to your question is I don't know because I would never enqueue or dequeue messages with default parameters. Not only is it a bad practice in that behavior can potentially change after upgrading or applying patches but doing so makes maintenance infinitely more difficult, as you are now discovering, because no one necessarily remembers for each version what the default behavior is.
When you want a specific behavior you code that specific behavior.
Read the docs on the following:
dbms_aq.dequeue_options_t
dbms_aq.enqueue_options_t
dbms_aq.message_properties_t
Then define the properties you want.
You can find some information about them here:
http://www.psoug.org/reference/dbms_aq.html
The docs are at http://tahiti.oracle.com. Search for them by name. -
Revision: 16206
Revision: 16206
Author: [email protected]
Date: 2010-05-18 17:42:03 -0700 (Tue, 18 May 2010)
Log Message:
Fix bug in inclusion of ASDoc code sample, caused by ASDoc comment.
Modified Paths:
osmf/trunk/docs/examples/org/osmf/logging/ExampleLogger.as
osmf/trunk/docs/examples/org/osmf/logging/ExampleLoggerFactory.as
osmf/trunk/docs/examples/org/osmf/logging/LoggerExample.asTks for posting the resolution, it solve my problem too.
keywords:
ECLIPSE SSL ERROR "could not generate secret" TOMCAT 8
java.security.NoSuchAlgorithmException: Algorithm DiffieHellman not available
SOLUTION, In my case: REBUILD JDK over TOMCAT 8 configuration -
Is there a RH standard for formatting code samples?
In the RH default style sheet, I do not see a pre HTML tag or other tag that will display code samples in a monospaced font.
I created custom styles for a single line code sample and another style for multiline samples.
We want our code samples to be shaded. If I shade multiple lines, each line being separated with a paragraph, there is a small amount of
white space between each line. We do not like this either.
I then created a custom table style with a single shaded cell. I add my multiline sample code, then I apply the custom paragraph style to get
the font and spacing between lines that I want.
Is there a different best practice for this, so that the code sample would be rendered correctly if viewed from other devices that read the HTML and
may look for the pre HTML tag?
I am using RoboHelp 9 and I provide the output as Eclipse help. Our help files are integrated into Eclipse help in the Eclipse IDE.
Thank you.
CynthiaHi Cynthia
As much as it pains me to say it, this is one case where using a Form element might be your best bet. I say this because often code samples are used or presented with the intent of copying and pasting into something like Windows Notepad. And if you used the TextArea form element, you can place the code there and make it pretty easy for folks to copy it for use elsewhere.
I stand to be corrected on this because I am not a "power CSS" person. (meaning I am aware there are complete two and three day classes one might attend on all the nuances of CSS) But RoboHelp won't really do anything to help you a great deal in formatting things. But it might be possible, somehow, to configure CSS to accomplish your goal of making the code look as you want.
Cheers... Rick -
HT204406 what can I do with an error code -50 network reset message?
what can I do with an error code -50 network reset message?
Hi ddelacruz,
Thanks for using Apple Support Communities. This article has some information on error (-50):
iTunes Store: "Error (-50)" when downloading purchased content
http://support.apple.com/kb/ts1583
Cheers,
- Ari -
HTTP request failed. Error code: "500". Error message
Hi ,
When we are trying to test webservices (exposed webservice in PI) scenarios in PI box we are getting error related Adapter framework service
HTTP request failed. Error code: "500". Error message: "Internal Server Error [http://xxxx:xxxx/AdapterFramework/rtc]"
in the RWB it is showing that
com.sap.engine.interfaces.messaging.api.exception.MessagingException: com.sap.engine.interfaces.messaging.api.exception.MessagingException: XIAdapterFramework:GENERAL:com.sap.engine.interfaces.messaging.api.exception.MessageExpiredException: Message 01d76ce0-972e-11e0-c652-b25394b91e0c(INBOUND) expired
Can any body help .
Edited by: subhaniABAP on Jun 15, 2011 11:30 AMHi,
If you want to resolve this error when dealing with the messages, please try the cache refresh with the link:
http://host:j2eeport/CPACache/refresh?mode=full
And also go thorugh:
- In Integration Repository/Directory go to menu Environment ->
Clear SLD Data Cache
- In R/3 go to transaction SXI_CACHE -> menu XI Runtime Cache -> Start
Complete Cache Refresh
MESSAGE EXPIRED:
Increase the value of the timeout parameter 'xiadapter.inbound.timeout.default' under Services -> 'XPI Adapter:XI'
to a higher value say '600000'.
Regards,
Caio Cagnani -
Dequeuing messages not working
I am trying to dequeue messages through the use of a java durable subscriber. That is the only subscriber. I successfully get the message and then call the method _session.commit();. Neither throw any errors and I am confused as to why the queue shows the message as processed yet it is still in the queue. Is there an orcale process that needs to be running to remove these dequeued messages? Propagation between databases is not a valid solution. So, some of the examples do not hold for my current setup.
my setup:
oracle 9i
create table, schema, objects, trigger to push jms messages into queue
java client to dequeue messages.
One strange thing I notice, at least to me, is that in order for the trigger to place messages into the queue, i need to either start the java durable subscriber up so it creates a subscriber or run the following: EXECUTE create_subs ( "name", "queue_name", null, null );. Now do I now have two subscribers once I start the java client up after running the PL/SQL command?
per my requirements I need to be able to queue things through a trigger, thus I need to be able to queue messages without having a java durable subscriber running.
Is there a way to determine who is subscribed? For some reason I am not seeing the information i need in any document or on any list.
Any help would be greatly appreciated.
Thanks,
JamescreateDurableSubscriber creates a new subscriber or gets an handle to an existing subscriber.
When you enqueue a message - you must either have created the subscriber or explicitly specified the recipient during the publish. From what you are seeing it seems that you are trying to enqueue a message without creating the subscriber.
If you want to do this then you must explicilty specify the recipient in the publish call. You'll need to use OJMS extensions in AQjmsSession to do this. The recipients can be specified as an array of AQjmsAgent s -
Hello SAP community. Does anyone have a step-by-step code sample for creating either a jsp or web dynpro application in Netweaver to use a java proxy to connect to XI that will calls a RFC or BAPI in SAP R3?
Hi
See the Code sample and pdf help it the SDN samples and tutorials
https://www.sdn.sap.com/irj/sdn/downloaditem?rid=/library/uuid/f0b0e990-0201-0010-cc96-d7ecd2e51715
https://www.sdn.sap.com/irj/sdn/developerareas/webdynpro?rid=/library/uuid/49f2ea90-0201-0010-ce8e-de18b94aee2d
Kind Regards
Mukesh -
Code for showing a messagi in web dynpro for java
Hi All,
What is the Code for showing a messagi in web dynpro for java.
Thanks and Regards,
SaurabhHello Saurabh,
SuccessMessage - WdComponentAPI.getMessageManager().reportSuccess("Success");
ErrorMessage - WdComponentAPI.getMessageManager().reportException("Error",false);
WarningMessage - WdComponentAPI.getMessageManager().reportWarning("Warning");
Regards
Nizamudeen SM -
Recently can't play music samples on Amazon France (and Germany, though they've now gone over to Flash, which seems to have fixed it after (re)installing Flash Player) via their usual 'Listen to all' button. Can only play samples individually. Message says roughly RealPlayer not installed on my navigator (see box below), but I've changed nothing and have always had RealPlayer on my PC at least. The 'Aid' page is useless in that it does not provide any links to sites from which one could download whatever it is Amazon Fr thinks one now needs.
== URL of affected sites ==
http://www.amazon.fr (e.g. http://www.amazon.fr/Je-Souviens-Tout-Juliette-Greco/dp/B001PU6T04/ref=sr_1_1?ie=UTF8&s=music&qid=1277978559&sr=1-1)Hello Neil.
It has been reported by other uses that RealPlayer is having some compatibility problems with Firefox. I believe this is mostly notorious with RealPlayer Plugin Record Plugin, but it may be the same thing here. Please contact RealPlayer developers for support.
Maybe you are looking for
-
Dell UltraSharp 2007 Vs 20" ACD
I consider myself a loyal Apple customer but have been burnt a little with my last purchases (Aperture 1.0 - I'm still waiting for my rebate) and a dodgy Powerbook that tech support can't seem to sort out so i'm thinking of straying from the fold for
-
Display both PO and Street in address node
Hi Gurus, I want to display an adderss with both Street and PObox. For that I am using an address node.If I give "POBOX has priority", only POBOX is displayed.If I give "STREET has priority", only street is displayed in the options available for ad
-
Why no geotagging in Photoshop Elements 10?
I just upgraded from old version (5 or 6) of Photoshop Elements to Photoshop Elements 10. There is no longer an option for placing pictures on map. This seems to be a huge move backwards as it was available many years ago on older versions. I only
-
On my macbook pro, the mail display keeps switching from date received to subject in the view options. Is there a way to keep it locked on date received?
-
New toolbar keeps disappearing after updating to 3.6.24
I have had to redo a new toolbar twice already after doing an update for Mozilla. I am running Windows 7 Home premium on a desktop: Microsoft Windows Version 6.1 (Build 7601: Service Pack 1)