At this point, you have learned enough to be able to construct the service. For simplicity, it will be assumed that the business logic is encapsulated within the following "pseudo-object:"
public void reserveSeat (...);
public void querySeat (...);
public void upgradeSeat (...);
Develop business logic using Plain Old Java Objects, Enterprise Java Beans or Spring. The JBoss Enterprise SOA Platform provides out-of-the-box support for many different approaches.
The service action's processing becomes this:
public Message process (Message message) throws Exception
String opcode = message.getBody().get(“org.example.flight.opcode”);
else if (opcode.equals(“query”))
else if (opcode.equals(“upgrade”))
throw new InvalidOpcode();
As with WS-Addressing, you could use the message header's action field rather than embed the opcode within the message body. The drawback is that it will not work if multiple actions are chained together and if each of these needs a different opcode.