function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
reptonrepton 

oubound message listener - java version?

I notice in the v8 api developers guide under "Outbound Messaging" there is a code snippet for building a "listner" in .Net 2.0.
 
Does anyone know of a java version of this code, maybe with a little more detail? 
 
I consumed the wsdl for my outbound message using axis and the resulting java classes don't seem to resemble the .Net class names referenced in the example.
 
anyone?
SuperfellSuperfell
Whatever tool you use, the trick is to get it to build a server side skeleton or stub. The ins and outs of class names etc will vary depending on the tools policy for name mapping etc.
reptonrepton

Thanks for the reply.

The Axis docs indicate that you should specify the "--server-side --skeletonDeploy" options to WSDL2Java, which I have done and re-consumed the wsdl.  I get two new classes - a skeleton and an implementation template.

I guess my problem now, is there is just not enough information in the example that shows how to do anything with the data coming back from salesforce that I am attempting to capture in my listener.  The example just shows a response being generated.

I just cant make the leap from "nothing" to using the NotificationBindingSkeleton to get at the data.  More sample code would be nice.

thanks

 

 

SuperfellSuperfell
the impl template has a notifications method that takes a parameter. When you deploy the service, axis will call this method passing in the data it recieved everytime it gets a message. Write whatever code you want in this method to work with the data its passed.
reptonrepton

I have deployed by listener.

I have initiated the trigger and all I get is errors in the que...

org.apache.commons.httpclient.HttpRecoverableException: java.net.SocketTimeoutException: Read timed out

As near as I can tell, the notifications method of the  NotificationBindingImpl class is not being called.

my url is http://199.44.159.59:8080/axis/services/Notification

btw, is there anyway to delete the stuff in the que?

thanks

 

 

SuperfellSuperfell
Your endpoint is not reachable from the internet at large.
reptonrepton

how right you are...they had the port 8080 blocked.

It Works!

thanks so much for all of your help.

 

regards,

Repton

reptonrepton

This should probably be in a new topic but I thought I would include it here because it is related to newbie problems with outbound messaging.

After getting a sample outbound message working, I find there is an issue with the package naming created by axis that I will need to resolve.

If I create an oubound for say, an Opportunity and have axis generate the code from the sforce supplied wsdl, I get the following generated classes...

com.sforce.soap._2005._09.outbound.NotificationBindingImpl.java

com.sforce.soap._2005._09.outbound.NotificationBindingSkeleton.java

com.sforce.soap._2005._09.outbound.NotificationBindingStub.java

com.sforce.soap._2005._09.outbound.NotificationPort.java

com.sforce.soap._2005._09.outbound.NotificationService.java

com.sforce.soap._2005._09.outbound.NotificationServiceLocator.java

Now, if I do an oubound listener on say, Account, I get the exact same named classes (though they do have different content in some cases).

So,it looks to me that the solution will involve a manual code merge to have these two listeners deployed on the same JVM. 

Has anyone worked out the "recommended" way to go about handling this problem with possibly a dozen or more listeners?

thanks, Repton

SuperfellSuperfell
Tools like axis have support for namespace -> package mapping that can be passed to WSDL2Java, so that the generate the code into different packages.

Message Edited by SimonF on 01-17-2007 08:28 AM

reptonrepton

SimonF - you always have the answer! - just enough to get me to the next hurdle.

So, I see that axis' wsdl2java allows us, using the -N option, to generate our code in whatever packages we wish.  Bravo. Having done that, I find that there is still (at least) one obstacle to overcome - the service name.  The generated deploy.wsdd's all have the same service name, no matter what you set as your output package names.

Would you have to have a different service name for each and every outbound notification that you build? Would that be the way to go about it?

thanks for your continuing help, repton

 

Federico LarsenFederico Larsen
It would be awsome just like there are Partnet Samples and Enterprise Samples .zip so you can unzip an see working code, to have a OutboundSample.zip with a working code for a listener.

May be repton can upload a zip file somewhere until sf-guys do it.

Cheers.
DevAngelDevAngel
There is Outbound Messaging instructions here.

The reason why we don't package up a zip file is because you really need to create your own wsdl for  your outbound message and sometime people are tempted to just modify the sample, which would cause more problems and be harder to do than learning how to do it from scratch.

The teach a man to fish kind of thing.
reptonrepton

Bump

I am still puzzled by how to go about running multiple listeners.

Does anyone have a suggestion?

thanks,

Repton

 

p.s. Bravo for getting together a how-to doc on outbound messaging

oklsngoklsng
Sorry to bump the thread, but I am also having this problem. Could anyone please let me know if they have solved the problem?
SuperfellSuperfell
which problem?
oklsngoklsng
Thanks for the reply. I was asking about the multiple listeners in one project reply. I found a post where someone solved the problem by renaming the service in each WSDL for each sObject sent. However, my coworker said she tried something like that and it didn't work. I'm not sure if she implemented is correctly, so I'm gonna try it myself. If there are any other solutions you know of, please let me know.

Thanks again