| 1 package org.objectweb.celtix.bus.ws.rm; 2 3 import java.lang.reflect.Method ; 4 5 import org.objectweb.celtix.bindings.AbstractBindingBase; 6 import org.objectweb.celtix.bindings.DataBindingCallback; 7 import org.objectweb.celtix.bindings.Request; 8 import org.objectweb.celtix.bus.jaxws.JAXBDataBindingCallback; 9 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, 24 Transport t, 25 AddressingProperties inMAPs, 26 CreateSequenceResponseType csr) { 27 28 super(b, t, b.createObjectContext()); 29 30 EndpointReferenceType to = inMAPs.getReplyTo(); 31 if (to != null) { 32 ContextUtils.storeTo(to, getObjectMessageContext()); 33 EndpointReferenceType replyTo = 34 EndpointReferenceUtils.getEndpointReference(Names.WSA_ANONYMOUS_ADDRESS); 35 ContextUtils.storeReplyTo(replyTo, 36 getObjectMessageContext()); 37 } 38 39 ContextUtils.storeUsingAddressing(true, getObjectMessageContext()); 40 41 getObjectMessageContext().setRequestorRole(true); 42 43 AddressingProperties maps = new AddressingPropertiesImpl(); 44 AttributedURIType actionURI = ContextUtils.WSA_OBJECT_FACTORY.createAttributedURIType(); 45 actionURI.setValue(RMUtils.getRMConstants().getCreateSequenceResponseAction()); 46 maps.setAction(actionURI); 47 maps.setRelatesTo(ContextUtils.getRelatesTo(inMAPs.getMessageID().getValue())); 48 ContextUtils.storeMAPs(maps, getObjectMessageContext(), true, true, true, true); 49 50 setMessageParameters(csr); 51 52 setOneway(true); 53 } 54 55 public static Method getMethod() { 56 Method method = null; 57 try { 58 method = OutOfBandProtocolMessages.class.getMethod( 59 METHOD_NAME, 60 new Class [] {CreateSequenceResponseType.class}); 61 } catch (NoSuchMethodException ex) { 62 ex.printStackTrace(); 63 } 64 return method; 65 } 66 67 public static String getOperationName() { 68 return OPERATION_NAME; 69 } 70 71 public static DataBindingCallback createDataBindingCallback() { 72 Method method = getMethod(); 73 return new JAXBDataBindingCallback(method, DataBindingCallback.Mode.PARTS, null); 74 } 75 76 private void setMessageParameters(CreateSequenceResponseType csr) { 77 getObjectMessageContext().setMessageObjects(new Object [] {csr}); 78 } 79 } 80 | Popular Tags |