use of org.apache.cxf.service.model.MessageInfo in project cxf by apache.
the class WrapperClassGenerator method generate.
public Set<Class<?>> generate() {
for (OperationInfo opInfo : interfaceInfo.getOperations()) {
if (opInfo.isUnwrappedCapable()) {
Method method = (Method) opInfo.getProperty(ReflectionServiceFactoryBean.METHOD);
if (method == null) {
continue;
}
MessagePartInfo inf = opInfo.getInput().getFirstMessagePart();
if (inf.getTypeClass() == null) {
MessageInfo messageInfo = opInfo.getUnwrappedOperation().getInput();
createWrapperClass(inf, messageInfo, opInfo, method, true);
}
MessageInfo messageInfo = opInfo.getUnwrappedOperation().getOutput();
if (messageInfo != null) {
inf = opInfo.getOutput().getFirstMessagePart();
if (inf.getTypeClass() == null) {
createWrapperClass(inf, messageInfo, opInfo, method, false);
}
}
}
}
return wrapperBeans;
}
use of org.apache.cxf.service.model.MessageInfo in project cxf by apache.
the class JaxWsServiceConfigurationTest method testGetInPartName.
@Test
public void testGetInPartName() throws Exception {
QName opName = new QName("http://cxf.com/", "sayHello");
Method sayHelloMethod = Hello.class.getMethod("sayHello", new Class[] { String.class, String.class });
ServiceInfo si = getMockedServiceModel("/wsdl/default_partname_test.wsdl");
JaxWsServiceFactoryBean bean = new JaxWsServiceFactoryBean();
bean.setServiceClass(Hello.class);
JaxWsServiceConfiguration jwsc = (JaxWsServiceConfiguration) bean.getServiceConfigurations().get(0);
jwsc.setServiceFactory(bean);
OperationInfo op = si.getInterface().getOperation(opName);
op.setInput("input", new MessageInfo(op, MessageInfo.Type.INPUT, new QName("http://cxf.com/", "input")));
op.setOutput("output", new MessageInfo(op, MessageInfo.Type.OUTPUT, new QName("http://cxf.com/", "output")));
QName partName = jwsc.getInPartName(op, sayHelloMethod, 0);
assertEquals("get wrong in partName for first param", new QName("http://cxf.com/", "arg0"), partName);
op.getInput().addMessagePart(new QName("arg0"));
partName = jwsc.getInPartName(op, sayHelloMethod, 1);
assertEquals("get wrong in partName for first param", new QName("http://cxf.com/", "arg1"), partName);
}
use of org.apache.cxf.service.model.MessageInfo in project cxf by apache.
the class RMEndpoint method addAction.
private void addAction(BindingOperationInfo boi, String action, String outputAction) {
SoapOperationInfo soi = new SoapOperationInfo();
soi.setAction(action);
boi.addExtensor(soi);
MessageInfo info = boi.getOperationInfo().getInput();
if (info != null) {
info.addExtensionAttribute(JAXWSAConstants.WSAW_ACTION_QNAME, action);
}
info = boi.getOperationInfo().getOutput();
if (info != null) {
info.addExtensionAttribute(JAXWSAConstants.WSAW_ACTION_QNAME, outputAction);
}
}
use of org.apache.cxf.service.model.MessageInfo in project cxf by apache.
the class RMEndpoint method buildCloseSequenceOperationInfo.
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);
}
}
use of org.apache.cxf.service.model.MessageInfo in project cxf by apache.
the class RMEndpoint method buildCreateSequenceOperationInfo.
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());
}
Aggregations