Java Code Examples for org.apache.cxf.service.model.OperationInfo#createMessage()
The following examples show how to use
org.apache.cxf.service.model.OperationInfo#createMessage() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: STSUtils.java From steady with Apache License 2.0 | 6 votes |
private static OperationInfo addCancelOperation(InterfaceInfo ii, String namespace, String servNamespace) { OperationInfo oi = ii.addOperation(new QName(servNamespace, "CancelSecurityToken")); MessageInfo mii = oi.createMessage(new QName(servNamespace, "CancelSecurityTokenMsg"), MessageInfo.Type.INPUT); oi.setInput("CancelSecurityTokenMsg", mii); MessagePartInfo mpi = mii.addMessagePart("request"); mpi.setElementQName(new QName(namespace, "CancelSecurityToken")); MessageInfo mio = oi.createMessage(new QName(servNamespace, "CancelSecurityTokenResponseMsg"), MessageInfo.Type.OUTPUT); oi.setOutput("CancelSecurityTokenResponseMsg", mio); mpi = mio.addMessagePart("response"); mpi.setElementQName(new QName(namespace, "CancelSecurityTokenResponse")); return oi; }
Example 2
Source File: STSUtils.java From steady with Apache License 2.0 | 6 votes |
private static OperationInfo addIssueOperation(InterfaceInfo ii, String namespace, String servNamespace) { OperationInfo oi = ii.addOperation(new QName(servNamespace, "RequestSecurityToken")); MessageInfo mii = oi.createMessage(new QName(servNamespace, "RequestSecurityTokenMsg"), MessageInfo.Type.INPUT); oi.setInput("RequestSecurityTokenMsg", mii); MessagePartInfo mpi = mii.addMessagePart("request"); mpi.setElementQName(new QName(namespace, "RequestSecurityToken")); MessageInfo mio = oi.createMessage(new QName(servNamespace, "RequestSecurityTokenResponseMsg"), MessageInfo.Type.OUTPUT); oi.setOutput("RequestSecurityTokenResponseMsg", mio); mpi = mio.addMessagePart("response"); if (WST_NS_05_02.equals(namespace)) { mpi.setElementQName(new QName(namespace, "RequestSecurityTokenResponse")); } else { mpi.setElementQName(new QName(namespace, "RequestSecurityTokenResponseCollection")); } return oi; }
Example 3
Source File: STSUtils.java From steady with Apache License 2.0 | 6 votes |
private static OperationInfo addCancelOperation(InterfaceInfo ii, String namespace, String servNamespace) { OperationInfo oi = ii.addOperation(new QName(servNamespace, "CancelSecurityToken")); MessageInfo mii = oi.createMessage(new QName(servNamespace, "CancelSecurityTokenMsg"), MessageInfo.Type.INPUT); oi.setInput("CancelSecurityTokenMsg", mii); MessagePartInfo mpi = mii.addMessagePart("request"); mpi.setElementQName(new QName(namespace, "CancelSecurityToken")); MessageInfo mio = oi.createMessage(new QName(servNamespace, "CancelSecurityTokenResponseMsg"), MessageInfo.Type.OUTPUT); oi.setOutput("CancelSecurityTokenResponseMsg", mio); mpi = mio.addMessagePart("response"); mpi.setElementQName(new QName(namespace, "CancelSecurityTokenResponse")); return oi; }
Example 4
Source File: STSUtils.java From steady with Apache License 2.0 | 6 votes |
private static OperationInfo addIssueOperation(InterfaceInfo ii, String namespace, String servNamespace) { OperationInfo oi = ii.addOperation(new QName(servNamespace, "RequestSecurityToken")); MessageInfo mii = oi.createMessage(new QName(servNamespace, "RequestSecurityTokenMsg"), MessageInfo.Type.INPUT); oi.setInput("RequestSecurityTokenMsg", mii); MessagePartInfo mpi = mii.addMessagePart("request"); mpi.setElementQName(new QName(namespace, "RequestSecurityToken")); MessageInfo mio = oi.createMessage(new QName(servNamespace, "RequestSecurityTokenResponseMsg"), MessageInfo.Type.OUTPUT); oi.setOutput("RequestSecurityTokenResponseMsg", mio); mpi = mio.addMessagePart("response"); if (WST_NS_05_02.equals(namespace)) { mpi.setElementQName(new QName(namespace, "RequestSecurityTokenResponse")); } else { mpi.setElementQName(new QName(namespace, "RequestSecurityTokenResponseCollection")); } return oi; }
Example 5
Source File: STSUtils.java From steady with Apache License 2.0 | 6 votes |
private static OperationInfo addCancelOperation(InterfaceInfo ii, String namespace, String servNamespace) { OperationInfo oi = ii.addOperation(new QName(servNamespace, "CancelSecurityToken")); MessageInfo mii = oi.createMessage(new QName(servNamespace, "CancelSecurityTokenMsg"), MessageInfo.Type.INPUT); oi.setInput("CancelSecurityTokenMsg", mii); MessagePartInfo mpi = mii.addMessagePart("request"); mpi.setElementQName(new QName(namespace, "CancelSecurityToken")); MessageInfo mio = oi.createMessage(new QName(servNamespace, "CancelSecurityTokenResponseMsg"), MessageInfo.Type.OUTPUT); oi.setOutput("CancelSecurityTokenResponseMsg", mio); mpi = mio.addMessagePart("response"); mpi.setElementQName(new QName(namespace, "CancelSecurityTokenResponse")); return oi; }
Example 6
Source File: STSUtils.java From steady with Apache License 2.0 | 6 votes |
private static OperationInfo addIssueOperation(InterfaceInfo ii, String namespace, String servNamespace) { OperationInfo oi = ii.addOperation(new QName(servNamespace, "RequestSecurityToken")); MessageInfo mii = oi.createMessage(new QName(servNamespace, "RequestSecurityTokenMsg"), MessageInfo.Type.INPUT); oi.setInput("RequestSecurityTokenMsg", mii); MessagePartInfo mpi = mii.addMessagePart("request"); mpi.setElementQName(new QName(namespace, "RequestSecurityToken")); MessageInfo mio = oi.createMessage(new QName(servNamespace, "RequestSecurityTokenResponseMsg"), MessageInfo.Type.OUTPUT); oi.setOutput("RequestSecurityTokenResponseMsg", mio); mpi = mio.addMessagePart("response"); if (WST_NS_05_02.equals(namespace)) { mpi.setElementQName(new QName(namespace, "RequestSecurityTokenResponse")); } else { mpi.setElementQName(new QName(namespace, "RequestSecurityTokenResponseCollection")); } return oi; }
Example 7
Source File: STSUtils.java From steady with Apache License 2.0 | 6 votes |
private static OperationInfo addCancelOperation(InterfaceInfo ii, String namespace, String servNamespace) { OperationInfo oi = ii.addOperation(new QName(servNamespace, "CancelSecurityToken")); MessageInfo mii = oi.createMessage(new QName(servNamespace, "CancelSecurityTokenMsg"), MessageInfo.Type.INPUT); oi.setInput("CancelSecurityTokenMsg", mii); MessagePartInfo mpi = mii.addMessagePart("request"); mpi.setElementQName(new QName(namespace, "CancelSecurityToken")); MessageInfo mio = oi.createMessage(new QName(servNamespace, "CancelSecurityTokenResponseMsg"), MessageInfo.Type.OUTPUT); oi.setOutput("CancelSecurityTokenResponseMsg", mio); mpi = mio.addMessagePart("response"); mpi.setElementQName(new QName(namespace, "CancelSecurityTokenResponse")); return oi; }
Example 8
Source File: STSUtils.java From steady with Apache License 2.0 | 6 votes |
private static OperationInfo addIssueOperation(InterfaceInfo ii, String namespace, String servNamespace) { OperationInfo oi = ii.addOperation(new QName(servNamespace, "RequestSecurityToken")); MessageInfo mii = oi.createMessage(new QName(servNamespace, "RequestSecurityTokenMsg"), MessageInfo.Type.INPUT); oi.setInput("RequestSecurityTokenMsg", mii); MessagePartInfo mpi = mii.addMessagePart("request"); mpi.setElementQName(new QName(namespace, "RequestSecurityToken")); MessageInfo mio = oi.createMessage(new QName(servNamespace, "RequestSecurityTokenResponseMsg"), MessageInfo.Type.OUTPUT); oi.setOutput("RequestSecurityTokenResponseMsg", mio); mpi = mio.addMessagePart("response"); if (WST_NS_05_02.equals(namespace)) { mpi.setElementQName(new QName(namespace, "RequestSecurityTokenResponse")); } else { mpi.setElementQName(new QName(namespace, "RequestSecurityTokenResponseCollection")); } return oi; }
Example 9
Source File: RMEndpoint.java From cxf with Apache License 2.0 | 6 votes |
void buildCloseSequenceOperationInfo(InterfaceInfo ii, ProtocolVariation protocol) { OperationInfo operationInfo = null; MessageInfo messageInfo = null; RMConstants consts = protocol.getConstants(); operationInfo = ii.addOperation(consts.getCloseSequenceOperationName()); messageInfo = operationInfo.createMessage(consts.getCloseSequenceOperationName(), MessageInfo.Type.INPUT); operationInfo.setInput(messageInfo.getName().getLocalPart(), messageInfo); if (RM11Constants.NAMESPACE_URI.equals(protocol.getWSRMNamespace())) { MessagePartInfo partInfo = messageInfo.addMessagePart(CLOSE_PART_NAME); partInfo.setElementQName(consts.getCloseSequenceOperationName()); partInfo.setElement(true); partInfo.setTypeClass(CloseSequenceType.class); messageInfo = operationInfo.createMessage( RM11Constants.INSTANCE.getCloseSequenceResponseOperationName(), MessageInfo.Type.OUTPUT); operationInfo.setOutput(messageInfo.getName().getLocalPart(), messageInfo); partInfo = messageInfo.addMessagePart(CLOSE_RESPONSE_PART_NAME); partInfo.setElementQName(RM11Constants.INSTANCE.getCloseSequenceResponseOperationName()); partInfo.setElement(true); partInfo.setTypeClass(CloseSequenceResponseType.class); partInfo.setIndex(0); } }
Example 10
Source File: JAXRSServiceImpl.java From cxf with Apache License 2.0 | 6 votes |
private void createMessagePartInfo(OperationInfo oi, Class<?> type, QName qname, Method m, boolean input) { if (type == void.class || Source.class.isAssignableFrom(type)) { return; } if (InjectionUtils.isPrimitive(type) || Response.class == type) { return; } QName mName = new QName(qname.getNamespaceURI(), (input ? "in" : "out") + m.getName()); MessageInfo ms = oi.createMessage(mName, input ? MessageInfo.Type.INPUT : MessageInfo.Type.OUTPUT); if (input) { oi.setInput("in", ms); } else { oi.setOutput("out", ms); } QName mpQName = JAXRSUtils.getClassQName(type); MessagePartInfo mpi = ms.addMessagePart(mpQName); mpi.setConcreteName(mpQName); mpi.setTypeQName(mpQName); mpi.setTypeClass(type); }
Example 11
Source File: STSUtils.java From cxf with Apache License 2.0 | 6 votes |
private static OperationInfo addIssueOperation(InterfaceInfo ii, String namespace, String servNamespace) { OperationInfo oi = ii.addOperation(new QName(servNamespace, "RequestSecurityToken")); MessageInfo mii = oi.createMessage(new QName(servNamespace, "RequestSecurityTokenMsg"), MessageInfo.Type.INPUT); oi.setInput("RequestSecurityTokenMsg", mii); MessagePartInfo mpi = mii.addMessagePart("request"); mpi.setElementQName(new QName(namespace, "RequestSecurityToken")); MessageInfo mio = oi.createMessage(new QName(servNamespace, "RequestSecurityTokenResponseMsg"), MessageInfo.Type.OUTPUT); oi.setOutput("RequestSecurityTokenResponseMsg", mio); mpi = mio.addMessagePart("response"); if (WST_NS_05_02.equals(namespace)) { mpi.setElementQName(new QName(namespace, "RequestSecurityTokenResponse")); } else { mpi.setElementQName(new QName(namespace, "RequestSecurityTokenResponseCollection")); } return oi; }
Example 12
Source File: STSUtils.java From cxf with Apache License 2.0 | 6 votes |
private static OperationInfo addCancelOperation(InterfaceInfo ii, String namespace, String servNamespace) { OperationInfo oi = ii.addOperation(new QName(servNamespace, "CancelSecurityToken")); MessageInfo mii = oi.createMessage(new QName(servNamespace, "CancelSecurityTokenMsg"), MessageInfo.Type.INPUT); oi.setInput("CancelSecurityTokenMsg", mii); MessagePartInfo mpi = mii.addMessagePart("request"); mpi.setElementQName(new QName(namespace, "RequestSecurityToken")); MessageInfo mio = oi.createMessage(new QName(servNamespace, "CancelSecurityTokenResponseMsg"), MessageInfo.Type.OUTPUT); oi.setOutput("CancelSecurityTokenResponseMsg", mio); mpi = mio.addMessagePart("response"); if (WST_NS_05_02.equals(namespace)) { mpi.setElementQName(new QName(namespace, "RequestSecurityTokenResponse")); } else { mpi.setElementQName(new QName(namespace, "RequestSecurityTokenResponseCollection")); } return oi; }
Example 13
Source File: STSUtils.java From cxf with Apache License 2.0 | 6 votes |
private static OperationInfo addRenewOperation(InterfaceInfo ii, String namespace, String servNamespace) { OperationInfo oi = ii.addOperation(new QName(servNamespace, "RenewSecurityToken")); MessageInfo mii = oi.createMessage(new QName(servNamespace, "RenewSecurityTokenMsg"), MessageInfo.Type.INPUT); oi.setInput("RenewSecurityTokenMsg", mii); MessagePartInfo mpi = mii.addMessagePart("request"); mpi.setElementQName(new QName(namespace, "RequestSecurityToken")); MessageInfo mio = oi.createMessage(new QName(servNamespace, "RenewSecurityTokenResponseMsg"), MessageInfo.Type.OUTPUT); oi.setOutput("RenewSecurityTokenResponseMsg", mio); mpi = mio.addMessagePart("response"); if (WST_NS_05_02.equals(namespace)) { mpi.setElementQName(new QName(namespace, "RequestSecurityTokenResponse")); } else { mpi.setElementQName(new QName(namespace, "RequestSecurityTokenResponseCollection")); } return oi; }
Example 14
Source File: RMEndpoint.java From cxf with Apache License 2.0 | 5 votes |
void buildAckRequestedOperationInfo(InterfaceInfo ii, ProtocolVariation protocol) { OperationInfo operationInfo = null; MessageInfo messageInfo = null; RMConstants consts = protocol.getConstants(); operationInfo = ii.addOperation(consts.getAckRequestedOperationName()); messageInfo = operationInfo.createMessage(consts.getAckRequestedOperationName(), MessageInfo.Type.INPUT); operationInfo.setInput(messageInfo.getName().getLocalPart(), messageInfo); }
Example 15
Source File: RMEndpoint.java From cxf with Apache License 2.0 | 5 votes |
void buildSequenceAckOperationInfo(InterfaceInfo ii, ProtocolVariation protocol) { OperationInfo operationInfo = null; MessageInfo messageInfo = null; RMConstants consts = protocol.getConstants(); operationInfo = ii.addOperation(consts.getSequenceAckOperationName()); messageInfo = operationInfo.createMessage(consts.getSequenceAckOperationName(), MessageInfo.Type.INPUT); operationInfo.setInput(messageInfo.getName().getLocalPart(), messageInfo); }
Example 16
Source File: RMEndpoint.java From cxf with Apache License 2.0 | 5 votes |
void buildTerminateSequenceOperationInfo(InterfaceInfo ii, ProtocolVariation protocol) { OperationInfo operationInfo = null; MessagePartInfo partInfo = null; MessageInfo messageInfo = null; RMConstants consts = protocol.getConstants(); operationInfo = ii.addOperation(consts.getTerminateSequenceOperationName()); messageInfo = operationInfo.createMessage(consts.getTerminateSequenceOperationName(), MessageInfo.Type.INPUT); operationInfo.setInput(messageInfo.getName().getLocalPart(), messageInfo); partInfo = messageInfo.addMessagePart(TERMINATE_PART_NAME); partInfo.setElementQName(consts.getTerminateSequenceOperationName()); partInfo.setElement(true); partInfo.setTypeClass(protocol.getCodec().getTerminateSequenceType()); if (RM11Constants.NAMESPACE_URI.equals(protocol.getWSRMNamespace())) { messageInfo = operationInfo.createMessage( RM11Constants.INSTANCE.getTerminateSequenceResponseOperationName(), MessageInfo.Type.OUTPUT); operationInfo.setOutput(messageInfo.getName().getLocalPart(), messageInfo); partInfo = messageInfo.addMessagePart(TERMINATE_RESPONSE_PART_NAME); partInfo.setElementQName(RM11Constants.INSTANCE.getTerminateSequenceResponseOperationName()); partInfo.setElement(true); partInfo.setTypeClass(protocol.getCodec().getTerminateSequenceResponseType()); partInfo.setIndex(0); } // for the TerminateSequence operation to an anonymous endpoint operationInfo = ii.addOperation(consts.getTerminateSequenceAnonymousOperationName()); messageInfo = operationInfo.createMessage(consts.getTerminateSequenceAnonymousOperationName(), MessageInfo.Type.OUTPUT); operationInfo.setOutput(messageInfo.getName().getLocalPart(), messageInfo); partInfo = messageInfo.addMessagePart(TERMINATE_PART_NAME); partInfo.setElementQName(consts.getTerminateSequenceOperationName()); partInfo.setElement(true); partInfo.setTypeClass(protocol.getCodec().getTerminateSequenceType()); }
Example 17
Source File: DispatchImpl.java From cxf with Apache License 2.0 | 5 votes |
private void addInvokeOperation(boolean oneWay) { String name = oneWay ? INVOKE_ONEWAY_NAME : INVOKE_NAME; ServiceInfo info = client.getEndpoint().getEndpointInfo().getService(); OperationInfo opInfo = info.getInterface() .addOperation(oneWay ? INVOKE_ONEWAY_QNAME : INVOKE_QNAME); MessageInfo mInfo = opInfo.createMessage(new QName(DISPATCH_NS, name + "Request"), Type.INPUT); opInfo.setInput(name + "Request", mInfo); MessagePartInfo mpi = mInfo.addMessagePart("parameters"); if (context == null) { mpi.setTypeClass(cl); } mpi.setElement(true); if (!oneWay) { mInfo = opInfo.createMessage(new QName(DISPATCH_NS, name + "Response"), Type.OUTPUT); opInfo.setOutput(name + "Response", mInfo); mpi = mInfo.addMessagePart("parameters"); mpi.setElement(true); if (context == null) { mpi.setTypeClass(cl); } } for (BindingInfo bind : client.getEndpoint().getEndpointInfo().getService().getBindings()) { BindingOperationInfo bo = new BindingOperationInfo(bind, opInfo); bind.addOperation(bo); } }
Example 18
Source File: MethodMapperTest.java From cxf with Apache License 2.0 | 5 votes |
@Test public void testMapOneWayOperation() throws Exception { OperationInfo operation = getOperation(); MessageInfo inputMessage = operation.createMessage(new QName("urn:test:ns", "testInputMessage"), MessageInfo.Type.INPUT); operation.setInput("input", inputMessage); JavaMethod method = new MethodMapper().map(operation); assertNotNull(method); assertTrue(method.isOneWay()); }
Example 19
Source File: RMEndpoint.java From cxf with Apache License 2.0 | 4 votes |
void buildCreateSequenceOperationInfo(InterfaceInfo ii, ProtocolVariation protocol) { OperationInfo operationInfo = null; MessagePartInfo partInfo = null; MessageInfo messageInfo = null; RMConstants consts = protocol.getConstants(); operationInfo = ii.addOperation(consts.getCreateSequenceOperationName()); messageInfo = operationInfo.createMessage(consts.getCreateSequenceOperationName(), MessageInfo.Type.INPUT); operationInfo.setInput(messageInfo.getName().getLocalPart(), messageInfo); partInfo = messageInfo.addMessagePart(CREATE_PART_NAME); partInfo.setElementQName(consts.getCreateSequenceOperationName()); partInfo.setElement(true); partInfo.setTypeClass(protocol.getCodec().getCreateSequenceType()); messageInfo = operationInfo.createMessage(consts.getCreateSequenceResponseOperationName(), MessageInfo.Type.OUTPUT); operationInfo.setOutput(messageInfo.getName().getLocalPart(), messageInfo); partInfo = messageInfo.addMessagePart(CREATE_RESPONSE_PART_NAME); partInfo.setElementQName(consts.getCreateSequenceResponseOperationName()); partInfo.setElement(true); partInfo.setTypeClass(protocol.getCodec().getCreateSequenceResponseType()); partInfo.setIndex(0); operationInfo = ii.addOperation(consts.getCreateSequenceOnewayOperationName()); messageInfo = operationInfo.createMessage(consts.getCreateSequenceOnewayOperationName(), MessageInfo.Type.INPUT); operationInfo.setInput(messageInfo.getName().getLocalPart(), messageInfo); partInfo = messageInfo.addMessagePart(CREATE_PART_NAME); partInfo.setElementQName(consts.getCreateSequenceOnewayOperationName()); partInfo.setElement(true); partInfo.setTypeClass(protocol.getCodec().getCreateSequenceType()); operationInfo = ii.addOperation(consts.getCreateSequenceResponseOnewayOperationName()); messageInfo = operationInfo.createMessage(consts.getCreateSequenceResponseOnewayOperationName(), MessageInfo.Type.INPUT); operationInfo.setInput(messageInfo.getName().getLocalPart(), messageInfo); partInfo = messageInfo.addMessagePart(CREATE_RESPONSE_PART_NAME); partInfo.setElementQName(consts.getCreateSequenceResponseOnewayOperationName()); partInfo.setElement(true); partInfo.setTypeClass(protocol.getCodec().getCreateSequenceResponseType()); }