0
votes

i was assigned to do simple POC using wso2 esb (4.8.1), i had zero prior experience with wso2esb or any other of such kind, and iam in the process of learning.

My goal is to receive TCP packet with binary data from remote third-party, convert to SOAP, do some stuff, convert back to binary and send response. Lurking on the internet, i have come across definitions like: Builder, MessageFormatter, TransportSender and TransportListener.

afaik
Builder is for converting incoming data to SOAP
MessageFormatter - converting outgoing data from SOAP to expected type
TransportSender - sending SOAP converted to expected type, through the wire
TransportListener - receiving request from the wire, and converting it to SOAP

1) does the TransportSender and Listener do the conversion SOAP<->binary themselves or they use Builder / MessageFormatter somehow, what is the flow between these four?

2) should the transport be completely decoupled from builder/formatter?

3 not important) to register Builder and Formatter in axis2.xml, i need to specify contetType, does this mean they are only applicable to HTTP request ? Even if its true, which is bad for me, because i expecting raw binary data, how would i register two separate formatters/builders for same content type ?


UPDATE 1: quote from here:

transport sender sends the SOAP message depending on its configuration. The transport receiver waits for the SOAP messages

is that always true? i mean, sender and listener are only for SOAP messages ?

1

1 Answers

2
votes

Axis2 is a web service engine and it has great support for plugging together various transports by using SOAP as a canonical form sitting in between various transports.

There isn't exaclty a flow between the four types (Senders/Listeners, Builders/Formatters). TransportListeners serializes incoming messages from the wire into a SOAP format (using a builder). TransportSenders read the SOAP message and deserailzes this into the outgoing wire format and places this on the wire (using a formatter). The key here is that we can have messages come into axis2 from one transport and send it out on a completely different transport.

What binds this all together is the message context object that gets passed around across the various axis2 phases.

You should have a look at the Axis2 Architecture guide and a couple of more things to look at are the Builder and Formatter interfaces that might clarify their use.