I am trying to set up salesforce outbound messaging listener in java. This is the link I followed to set up, and it works fine - https://developer.salesforce.com/page/Creating_an_Outbound_Messaging_Notification_Service_with_Eclipse_3.2

The article was unfortunately never updated after 2012, and I want to set this up as a maven project for obvious reasons -this is where I run into difficulties.

I am looking for the right maven plugin to basically reproduce whatever was in the link.The idea is that, I need to have an endpoint listener, such that it can receive a soap message from salesforce. With me right now, I have a wsdl file (that I get from salesforce), and this is my starting point. The endpoint is also included in the wsdl. From a lot of research, I decided to use the apache cxf maven plugin to generate the classes from wsdl. I also have a public endpoint available to receive the message.

However I am stuck and unsure as to how to to proceed from here. Once I get the classes, how do I configure the endpoint listener? From the generated classes, there is one interface NotificationPort , which has the method that is called when a message hits the endpoint. I know that I need to have a class that implements the interface. How do I run and test the service from now?

This is my pom.xml




wsdl relevant parts

    <!-- Binding 
 You need to write a service that implements this binding to receive the notifications -->
    <binding name="NotificationBinding" type="tns:NotificationPort">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="notifications">
    <soap:operation soapAction=""/>
        <soap:body use="literal"/>
        <soap:body use="literal"/>
   <!-- Service Endpoint -->
  <service name="NotificationService">
  <documentation>Notification Service Implementation</documentation>
  <port binding="tns:NotificationBinding" name="Notification">

Questions: 1. I wrote a custom class that implements the interface NotificationsPort. How do I run and test this web service? What can I use as run time environment to run it? Would tomcat work?

Is there anyway I can use Spring to get this set up? -as I would highly prefer to use that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.