01: package org.objectweb.celtix.bus.ws.rm;
02:
03: import java.lang.reflect.Method;
04:
05: import org.objectweb.celtix.bindings.AbstractBindingBase;
06: import org.objectweb.celtix.bindings.DataBindingCallback;
07: import org.objectweb.celtix.bindings.Request;
08: import org.objectweb.celtix.bus.jaxws.JAXBDataBindingCallback;
09: import org.objectweb.celtix.bus.ws.addressing.AddressingPropertiesImpl;
10: import org.objectweb.celtix.bus.ws.addressing.ContextUtils;
11: import org.objectweb.celtix.transports.Transport;
12: import org.objectweb.celtix.ws.addressing.AddressingProperties;
13: import org.objectweb.celtix.ws.addressing.AttributedURIType;
14: import org.objectweb.celtix.ws.addressing.EndpointReferenceType;
15: import org.objectweb.celtix.ws.rm.CreateSequenceResponseType;
16: import org.objectweb.celtix.wsdl.EndpointReferenceUtils;
17:
18: public class CreateSequenceResponse extends Request {
19:
20: private static final String METHOD_NAME = "createSequenceResponse";
21: private static final String OPERATION_NAME = "CreateSequenceResponse";
22:
23: public CreateSequenceResponse(AbstractBindingBase b, Transport t,
24: AddressingProperties inMAPs, CreateSequenceResponseType csr) {
25:
26: super (b, t, b.createObjectContext());
27:
28: EndpointReferenceType to = inMAPs.getReplyTo();
29: if (to != null) {
30: ContextUtils.storeTo(to, getObjectMessageContext());
31: EndpointReferenceType replyTo = EndpointReferenceUtils
32: .getEndpointReference(Names.WSA_ANONYMOUS_ADDRESS);
33: ContextUtils.storeReplyTo(replyTo,
34: getObjectMessageContext());
35: }
36:
37: ContextUtils.storeUsingAddressing(true,
38: getObjectMessageContext());
39:
40: getObjectMessageContext().setRequestorRole(true);
41:
42: AddressingProperties maps = new AddressingPropertiesImpl();
43: AttributedURIType actionURI = ContextUtils.WSA_OBJECT_FACTORY
44: .createAttributedURIType();
45: actionURI.setValue(RMUtils.getRMConstants()
46: .getCreateSequenceResponseAction());
47: maps.setAction(actionURI);
48: maps.setRelatesTo(ContextUtils.getRelatesTo(inMAPs
49: .getMessageID().getValue()));
50: ContextUtils.storeMAPs(maps, getObjectMessageContext(), true,
51: true, true, true);
52:
53: setMessageParameters(csr);
54:
55: setOneway(true);
56: }
57:
58: public static Method getMethod() {
59: Method method = null;
60: try {
61: method = OutOfBandProtocolMessages.class.getMethod(
62: METHOD_NAME,
63: new Class[] { CreateSequenceResponseType.class });
64: } catch (NoSuchMethodException ex) {
65: ex.printStackTrace();
66: }
67: return method;
68: }
69:
70: public static String getOperationName() {
71: return OPERATION_NAME;
72: }
73:
74: public static DataBindingCallback createDataBindingCallback() {
75: Method method = getMethod();
76: return new JAXBDataBindingCallback(method,
77: DataBindingCallback.Mode.PARTS, null);
78: }
79:
80: private void setMessageParameters(CreateSequenceResponseType csr) {
81: getObjectMessageContext().setMessageObjects(
82: new Object[] { csr });
83: }
84: }
|