Himai Minh wrote:
option 1. how can the @WebServiceProvider tell the intended operation from the Source request object in the above example?
You either fish out the SOAPAction header from the Source or better, you don't use Source as the generic parameter, you use SOAPMessage as I show in an example below.
Himai Minh wrote:
option 2. when Service.Mode.MESSAGE is used, the Source request can be type cast to a DOMSource object. This DOMSource object is a SOAPMessage. From the SOAPMessage, we can see if it is an Add or the AddInteger or the subtract or multiply and etc.
I wouldn't cast Source to a DOMSource blindly. I'd check with instanceof operator and if not a DOMSource, transform to one if needed.
Himai Minh wrote:
option 3. when Service.Mode.PAYLOAD is used, the Source request is unmarshalled and type cast to JAXBElement. How can I tell if it is a JAXBElement<Add>, JAXBElement<Subtract>...
If you must use JAXB, you can use a JAXBElement<Operation> with the Operation class having a 'name' for the operation. Else, you can just parse the DOM tree and find out the name of the operation.
Abhijit
-------
SCJP 5, SCBCD 5, OCWCD 5, OCEWSD 6, CSM