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
dave6dave6 

outbound messages - how to handle multiple messages

I'm implementing support for Salesforce's Outbout Messaging and it seems all the docs and examples assume the simple case where there is only one output message.  Or more exactly one output message type (one WSDL) which can carry any number of messages.

 

However I need to support multiple outgoing messages that have different WSDL's and I'm wondering what's the best way to approach this.   There does not seems to be any 'easy' way to handle this.

 

Well one 'easy' way would be to create a separate server endpoint for each outgoing message but that does not seem like the right way to do this as it does not scale.  E.g. having a separate war app for each message seems ineffecient both in processing but also in code support for N apps.

 

So ideally it seems one war should be able to handle any number of outgoing messages but I'm having lots of trouble getting that to work in practice, here are some of the issues I am running into.  (Btw, my build is Java, CXF & Maven)

 

1. Some of my outgoing messages both use the Lead object but with differing fields populated.  That means the WSDL is different.  So in my build the wsdl2java creates code in the same package that overwrites the previous one.  So how to handle that?

2. Then in my server app I need to do work with the data and call back into Salesforce with the calculated answers and I use the enterprise WSDL to do that.  But that wsdl2java build step has already generated java classes for all those types which conflict with the ones in 31.

3. So then I thought I would customize the package names used in #1 so that they each go into their own namespace so they would not conflict with eachother and with #2 but that's not possible because the shared type com.sforce.soap._2005._09.outbound.LeadNotification has to be bound to one of the Lead types.  

 

So it's a chicken and egg issue, I want to separate the packages but can't because although I want to have one server app and dispatch the messages, I can't because either all has to be in separate packages including the server or I get duplicate/overwight issues if I don't separate them.

 

Also I assume I can't modify the original WSDL as that is what Salesforce is expecting to exist in my server.

 

What am I missing here?  How can I accept muliple Salesforce messages of different types in my single Java web service app?  I have a hard time believeing I am supposed to create N war apps for N message types.

SoleesSolees

Try not using outbound messages, but code the messages.  This way you can control that all of them use the same endpoint.

 

Otherwise you must export every single WSDL of every single outbound message.

Kamesh ArumugamKamesh Arumugam
Code the message means ?