org.apache.cxf.service.model.OperationInfo Java Examples

The following examples show how to use org.apache.cxf.service.model.OperationInfo. 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: JaxWsServiceConfigurationTest.java    From cxf with Apache License 2.0 6 votes vote down vote up
@Test
public void testGetOutPartName() throws Exception {
    QName opName = new QName("http://cxf.com/", "sayHi");
    Method sayHiMethod = Hello.class.getMethod("sayHi", new Class[]{});
    ServiceInfo si = getMockedServiceModel("/wsdl/default_partname_test.wsdl");
    JaxWsServiceConfiguration jwsc = new JaxWsServiceConfiguration();
    JaxWsServiceFactoryBean bean = new JaxWsServiceFactoryBean();
    bean.setServiceClass(Hello.class);
    jwsc.setServiceFactory(bean);

    // clear the output
    OperationInfo op = si.getInterface().getOperation(opName);
    op.setOutput("output", new MessageInfo(op,
                                           MessageInfo.Type.OUTPUT,
                                           new QName("http://cxf.com/", "output")));

    QName partName = jwsc.getOutPartName(op, sayHiMethod, -1);
    assertEquals("get wrong return partName", new QName("http://cxf.com/", "return"), partName);
}
 
Example #2
Source File: STSUtils.java    From steady with Apache License 2.0 6 votes vote down vote up
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 #3
Source File: STSUtils.java    From steady with Apache License 2.0 6 votes vote down vote up
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: CxfWSDLImporter.java    From activiti6-boot2 with Apache License 2.0 6 votes vote down vote up
protected WSService importService(ServiceInfo service) {
  String name = service.getName().getLocalPart();
  String location = "";
  
  for (EndpointInfo endpoint : service.getEndpoints()) {
    location = endpoint.getAddress();
  }
  
  WSService wsService = new WSService(this.namespace + name, location, this.wsdlLocation);
  for (OperationInfo operation : service.getInterface().getOperations()) {
    WSOperation wsOperation = this.importOperation(operation, wsService);
    wsService.addOperation(wsOperation);

    this.wsOperations.put(this.namespace + operation.getName().getLocalPart(), wsOperation);
  }
  return wsService;
}
 
Example #5
Source File: STSUtils.java    From cxf with Apache License 2.0 6 votes vote down vote up
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 #6
Source File: STSUtils.java    From steady with Apache License 2.0 6 votes vote down vote up
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 vote down vote up
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: AegisDatabinding.java    From cxf with Apache License 2.0 6 votes vote down vote up
private void initializeOperation(Service s, TypeMapping serviceTM, OperationInfo opInfo,
                                 Set<AegisType> deps) {
    try {
        initializeMessage(s, serviceTM, opInfo.getInput(), IN_PARAM, deps);

        if (opInfo.hasOutput()) {
            initializeMessage(s, serviceTM, opInfo.getOutput(), OUT_PARAM, deps);
        }

        for (FaultInfo info : opInfo.getFaults()) {
            initializeMessage(s, serviceTM, info, FAULT_PARAM, deps);
        }

    } catch (DatabindingException e) {
        e.prepend("Error initializing parameters for operation " + opInfo.getName());
        throw e;
    }
}
 
Example #9
Source File: ReflectionServiceFactoryBean.java    From cxf with Apache License 2.0 6 votes vote down vote up
private void setParameterOrder(Method method, Class<?>[] paramClasses, OperationInfo op) {
    if (isRPC(method) || !isWrapped(method)) {
        List<String> paramOrdering = new LinkedList<>();
        boolean hasOut = false;
        for (int j = 0; j < paramClasses.length; j++) {
            if (Exchange.class.equals(paramClasses[j])) {
                continue;
            }
            if (isInParam(method, j)) {
                paramOrdering.add(getInPartName(op, method, j).getLocalPart());
                if (isOutParam(method, j)) {
                    hasOut = true;
                }
            } else if (isOutParam(method, j)) {
                hasOut = true;
                paramOrdering.add(getOutPartName(op, method, j).getLocalPart());
            }
        }
        if (!paramOrdering.isEmpty() && hasOut) {
            op.setParameterOrdering(paramOrdering);
        }
    }
}
 
Example #10
Source File: WebFaultInInterceptor.java    From cxf with Apache License 2.0 6 votes vote down vote up
private MessagePartInfo getFaultMessagePart(QName qname, OperationInfo op) {
    if (op.isUnwrapped() && (op instanceof UnwrappedOperationInfo)) {
        op = ((UnwrappedOperationInfo)op).getWrappedOperation();
    }

    for (FaultInfo faultInfo : op.getFaults()) {
        for (MessagePartInfo mpi : faultInfo.getMessageParts()) {
            String ns = null;
            if (mpi.isElement()) {
                ns = mpi.getElementQName().getNamespaceURI();
            } else {
                ns = mpi.getTypeQName().getNamespaceURI();
            }
            if (qname.getLocalPart().equals(mpi.getConcreteName().getLocalPart())
                    && qname.getNamespaceURI().equals(ns)) {
                return mpi;
            }
        }

    }
    return null;
}
 
Example #11
Source File: OperationInfoAuthorizingInterceptor.java    From cxf with Apache License 2.0 6 votes vote down vote up
@Override
public void handleMessage(Message message) {
    OperationInfo opinfo = getTargetOperationInfo(message);
    SecurityContext sc = message.get(SecurityContext.class);
    if (sc != null && sc.getUserPrincipal() != null) {
        if (opinfo.getName() != null
            && authorize(sc, opinfo.getName().getLocalPart())) {
            return;
        }
    } else if (!isMethodProtected(opinfo.getName().getLocalPart()) && isAllowAnonymousUsers()) {
        return;
    }

    throw new AccessDeniedException("Unauthorized");

}
 
Example #12
Source File: MessageUtilsTest.java    From cxf with Apache License 2.0 6 votes vote down vote up
@Test
public void getTargetMethodFromBindingOperationInfo() throws Exception {
    Method method = MessageUtilsTest.class.getMethod("getTargetMethodFromBindingOperationInfo");
    Message message = new MessageImpl();
    Exchange exchange = new ExchangeImpl();
    message.setExchange(exchange);
    OperationInfo oi = new OperationInfo();
    oi.setName(QName.valueOf("getTargetMethod_fromBindingOperationInfo"));
    BindingOperationInfo boi = new BindingOperationInfo(null, oi);
    ServiceImpl serviceImpl = new ServiceImpl();
    MethodDispatcher md = new SimpleMethodDispatcher();
    md.bind(oi, method);

    serviceImpl.put(MethodDispatcher.class.getName(), md);
    exchange.put(Service.class, serviceImpl);
    exchange.put(BindingOperationInfo.class, boi);

    Optional<Method> optMethod = MessageUtils.getTargetMethod(message);
    assertTrue(optMethod.isPresent());
    assertEquals(method, optMethod.get());
}
 
Example #13
Source File: STSUtils.java    From steady with Apache License 2.0 6 votes vote down vote up
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 #14
Source File: XMLMessageInInterceptorTest.java    From cxf with Apache License 2.0 6 votes vote down vote up
@Test
public void testHandleMessageOnBareMultiParam() throws Exception {
    String ns = "http://apache.org/hello_world_xml_http/bare";
    prepareMessage("/message-bare-multi-param.xml");
    common("/wsdl/hello_world_xml_bare.wsdl", new QName(ns, "XMLPort"),
                    MyComplexStructType.class);

    OperationInfo op = serviceInfo.getInterface().getOperation(new QName(ns, "testMultiParamPart"));
    op.getInput().getMessagePartByIndex(0).setTypeClass(String.class);
    op.getInput().getMessagePartByIndex(1).setTypeClass(MyComplexStructType.class);

    in.handleMessage(xmlMessage);
    docLitIn.handleMessage(xmlMessage);
    List<?> list = xmlMessage.getContent(List.class);
    assertNotNull(list);
    assertEquals("expect 2 param", 2, list.size());
    assertTrue("method input in2 is MyComplexStructType", list.get(1) instanceof MyComplexStructType);
    assertTrue("method input in1 is String tli", ((String) list.get(0)).indexOf("tli") >= 0);
}
 
Example #15
Source File: ProxyTest.java    From cxf with Apache License 2.0 6 votes vote down vote up
@Test
public void testTerminate() throws NoSuchMethodException, RMException {
    Method m = Proxy.class.getDeclaredMethod("invoke",
        new Class[] {OperationInfo.class, ProtocolVariation.class, Object[].class, Map.class});
    Proxy proxy = EasyMock.createMockBuilder(Proxy.class)
        .addMockedMethod(m).createMock(control);
    proxy.setReliableEndpoint(rme);
    Endpoint endpoint = control.createMock(Endpoint.class);
    EasyMock.expect(rme.getEndpoint(ProtocolVariation.RM10WSA200408)).andReturn(endpoint).anyTimes();
    EndpointInfo epi = control.createMock(EndpointInfo.class);
    EasyMock.expect(endpoint.getEndpointInfo()).andReturn(epi).anyTimes();
    ServiceInfo si = control.createMock(ServiceInfo.class);
    EasyMock.expect(epi.getService()).andReturn(si).anyTimes();
    InterfaceInfo ii = control.createMock(InterfaceInfo.class);
    EasyMock.expect(si.getInterface()).andReturn(ii).anyTimes();
    OperationInfo oi = control.createMock(OperationInfo.class);
    EasyMock.expect(ii.getOperation(RM10Constants.TERMINATE_SEQUENCE_QNAME)).andReturn(oi).anyTimes();
    SourceSequence ss = control.createMock(SourceSequence.class);
    Identifier id = control.createMock(Identifier.class);
    EasyMock.expect(ss.getIdentifier()).andReturn(id).anyTimes();
    EasyMock.expect(ss.getProtocol()).andReturn(ProtocolVariation.RM10WSA200408).anyTimes();
    expectInvoke(proxy, oi, null);
    control.replay();
    proxy.terminate(ss);
}
 
Example #16
Source File: JaxWsServiceConfiguration.java    From cxf with Apache License 2.0 6 votes vote down vote up
@Override
public QName getRequestWrapperName(OperationInfo op, Method method) {
    Method m = getDeclaredMethod(method);
    RequestWrapper rw = m.getAnnotation(RequestWrapper.class);
    String nm = null;
    String lp = null;
    if (rw != null) {
        nm = rw.targetNamespace();
        lp = rw.localName();
    }
    WebMethod meth = m.getAnnotation(WebMethod.class);
    if (meth != null && StringUtils.isEmpty(lp)) {
        lp = meth.operationName();
    }
    if (StringUtils.isEmpty(nm)) {
        nm = op.getName().getNamespaceURI();
    }
    if (!StringUtils.isEmpty(nm) && !StringUtils.isEmpty(lp)) {
        return new QName(nm, lp);
    }
    return null;
}
 
Example #17
Source File: JaxWsServiceConfiguration.java    From cxf with Apache License 2.0 6 votes vote down vote up
@Override
public QName getFaultName(InterfaceInfo service, OperationInfo o, Class<?> exClass, Class<?> beanClass) {
    WebFault fault = exClass.getAnnotation(WebFault.class);
    if (fault != null) {
        String name = fault.name();
        if (name.length() == 0) {
            name = exClass.getSimpleName();
        }
        String ns = fault.targetNamespace();
        if (ns.length() == 0) {
            ns = service.getName().getNamespaceURI();
        }

        return new QName(ns, name);
    }
    return null;
}
 
Example #18
Source File: AbstractInDatabindingInterceptor.java    From cxf with Apache License 2.0 5 votes vote down vote up
protected MessageInfo getMessageInfo(Message message, BindingOperationInfo operation, boolean requestor) {
    MessageInfo msgInfo;
    OperationInfo intfOp = operation.getOperationInfo();
    if (requestor) {
        msgInfo = intfOp.getOutput();
        message.put(MessageInfo.class, intfOp.getOutput());
    } else {
        msgInfo = intfOp.getInput();
        message.put(MessageInfo.class, intfOp.getInput());
    }
    return msgInfo;
}
 
Example #19
Source File: Proxy.java    From cxf with Apache License 2.0 5 votes vote down vote up
void acknowledge(DestinationSequence ds) throws RMException {
    final ProtocolVariation protocol = ds.getProtocol();
    String address = ds.getAcksTo().getAddress().getValue();
    if (RMUtils.getAddressingConstants().getAnonymousURI().equals(address)) {
        LOG.log(Level.WARNING, "STANDALONE_ANON_ACKS_NOT_SUPPORTED");
        return;
    }
    RMConstants constants = protocol.getConstants();
    OperationInfo oi = reliableEndpoint.getEndpoint(protocol).getEndpointInfo()
        .getService().getInterface().getOperation(constants.getSequenceAckOperationName());
    invoke(oi, protocol, new Object[] {ds}, this.sequenceContext);
}
 
Example #20
Source File: JaxWsProxyFactoryBean.java    From cxf with Apache License 2.0 5 votes vote down vote up
private boolean needWrapperClassInterceptor(ServiceInfo serviceInfo) {
    if (serviceInfo == null) {
        return false;
    }

    for (OperationInfo opInfo : serviceInfo.getInterface().getOperations()) {
        if (opInfo.isUnwrappedCapable()
            && opInfo.getProperty(ReflectionServiceFactoryBean.WRAPPERGEN_NEEDED) != null) {
            return true;

        }
    }
    return false;
}
 
Example #21
Source File: CorbaStreamFaultInInterceptor.java    From cxf with Apache License 2.0 5 votes vote down vote up
protected FaultInfo getFaultInfo(OperationInfo opInfo, QName faultName) {
    Iterator<FaultInfo> faults = opInfo.getFaults().iterator();
    while (faults.hasNext()) {
        FaultInfo fault = faults.next();
        MessagePartInfo partInfo = fault.getMessageParts().get(0);
        if (partInfo.isElement()
            && partInfo.getElementQName().getLocalPart().equals(faultName.getLocalPart())) {
            return fault;
        } else if (partInfo.getTypeQName().getLocalPart().equals(faultName.getLocalPart())) {
            return fault;
        }
    }
    return null;
}
 
Example #22
Source File: ReflectionServiceFactoryBean.java    From cxf with Apache License 2.0 5 votes vote down vote up
protected QName getFaultName(InterfaceInfo service, OperationInfo o,
                             Class<?> exClass, Class<?> beanClass) {
    for (AbstractServiceConfiguration c : serviceConfigurations) {
        QName q = c.getFaultName(service, o, exClass, beanClass);
        if (q != null) {
            return q;
        }
    }
    throw new IllegalStateException("ServiceConfiguration must provide a value!");
}
 
Example #23
Source File: JaxWsServiceConfiguration.java    From cxf with Apache License 2.0 5 votes vote down vote up
private QName getPartName(OperationInfo op, Method method,
                          int paramNumber, MessageInfo mi, String prefix, boolean isIn) {
    int partIndex = getPartIndex(method, paramNumber, isIn);
    method = getDeclaredMethod(method);
    WebParam param = getWebParam(method, paramNumber);
    String tns = mi.getName().getNamespaceURI();
    String local = null;
    if (param != null) {
        if (Boolean.TRUE.equals(isRPC(method))
            || isDocumentBare(method)
            || param.header()) {
            local = param.partName();
        }
        if (local == null || local.length() == 0) {
            local = param.name();
        }
    }

    if (local == null || local.length() == 0) {
        if (Boolean.TRUE.equals(isRPC(method)) || !Boolean.FALSE.equals(isWrapped(method))) {
            local = getDefaultLocalName(op, method, paramNumber, partIndex, prefix);
        } else {
            local = getOperationName(op.getInterface(), method).getLocalPart();
        }
    }

    return new QName(tns, local);
}
 
Example #24
Source File: ReflectionServiceFactoryBean.java    From cxf with Apache License 2.0 5 votes vote down vote up
public boolean hasWrappedMethods(InterfaceInfo interfaceInfo) {
    for (OperationInfo opInfo : interfaceInfo.getOperations()) {
        if (opInfo.isUnwrappedCapable()) {
            return true;
        }
    }
    return false;
}
 
Example #25
Source File: FormattedServiceListWriter.java    From cxf with Apache License 2.0 5 votes vote down vote up
private void writerSoapEndpoint(PrintWriter writer,
                                String basePath,
                                AbstractDestination sd) {
    String absoluteURL = getAbsoluteAddress(basePath, sd);
    if (absoluteURL == null) {
        return;
    }

    writer.write("<tr><td>");
    writer.write("<span class=\"porttypename\">"
                 + sd.getEndpointInfo().getInterface().getName().getLocalPart() + "</span>");
    writer.write("<ul>");
    for (OperationInfo oi : sd.getEndpointInfo().getInterface().getOperations()) {
        if (!Boolean.TRUE.equals(oi.getProperty("operation.is.synthetic"))) {
            writer.write("<li>" + oi.getName().getLocalPart() + "</li>");
        }
    }
    writer.write("</ul>");
    writer.write("</td><td>");

    absoluteURL = StringEscapeUtils.escapeHtml4(absoluteURL);
    writer.write("<span class=\"field\">Endpoint address:</span> " + "<span class=\"value\">"
                 + absoluteURL + "</span>");
    writer.write("<br/><span class=\"field\">WSDL :</span> " + "<a href=\"" + absoluteURL
                 + "?wsdl\">" + sd.getEndpointInfo().getService().getName() + "</a>");
    writer.write("<br/><span class=\"field\">Target namespace:</span> "
                 + "<span class=\"value\">"
                 + sd.getEndpointInfo().getService().getTargetNamespace() + "</span>");
    addAtomLinkIfNeeded(absoluteURL, atomMap, writer);
    writer.write("</td></tr>");
}
 
Example #26
Source File: CorbaStreamInInterceptor.java    From cxf with Apache License 2.0 5 votes vote down vote up
protected NVList prepareArguments(CorbaMessage corbaMsg,
                                  InterfaceInfo info,
                                  OperationType opType,
                                  QName opQName,
                                  CorbaTypeMap typeMap,
                                  CorbaDestination destination,
                                  ServiceInfo service) {
    BindingInfo bInfo = destination.getBindingInfo();
    EndpointInfo eptInfo = destination.getEndPointInfo();
    BindingOperationInfo bOpInfo = bInfo.getOperation(opQName);
    OperationInfo opInfo = bOpInfo.getOperationInfo();
    Exchange exg = corbaMsg.getExchange();
    exg.put(BindingInfo.class, bInfo);
    exg.put(InterfaceInfo.class, info);
    exg.put(EndpointInfo.class, eptInfo);
    exg.put(EndpointReferenceType.class, destination.getAddress());
    exg.put(ServiceInfo.class, service);
    exg.put(BindingOperationInfo.class, bOpInfo);
    exg.put(OperationInfo.class, opInfo);
    exg.put(MessageInfo.class, opInfo.getInput());
    exg.put(String.class, opQName.getLocalPart());
    exg.setInMessage(corbaMsg);

    corbaMsg.put(MessageInfo.class, opInfo.getInput());

    List<ParamType> paramTypes = opType.getParam();
    CorbaStreamable[] arguments = new CorbaStreamable[paramTypes.size()];
    return prepareDIIArgsList(corbaMsg, bOpInfo,
                              arguments, paramTypes,
                              typeMap,
                              exg.get(ORB.class), service);
}
 
Example #27
Source File: CorbaStreamFaultOutInterceptor.java    From cxf with Apache License 2.0 5 votes vote down vote up
protected MessagePartInfo getFaultMessagePartInfo(OperationInfo opInfo, QName faultName) {
    Iterator<FaultInfo> faults = opInfo.getFaults().iterator();
    while (faults.hasNext()) {
        FaultInfo fault = faults.next();
        MessagePartInfo partInfo = fault.getMessageParts().get(0);
        if (partInfo.isElement()
            && partInfo.getElementQName().getLocalPart().equals(faultName.getLocalPart())) {
            return partInfo;
        } else if (partInfo.getTypeQName().getLocalPart().equals(faultName.getLocalPart())) {
            return partInfo;
        }
    }
    return null;
}
 
Example #28
Source File: OperationInfoAuthorizingInterceptor.java    From cxf with Apache License 2.0 5 votes vote down vote up
protected OperationInfo getTargetOperationInfo(Message message) {
    BindingOperationInfo bop = message.getExchange().getBindingOperationInfo();
    if (bop != null) {
        return bop.getOperationInfo();
    }
    throw new AccessDeniedException("OperationInfo is not available : Unauthorized");
}
 
Example #29
Source File: JAXBDataBase.java    From cxf with Apache License 2.0 5 votes vote down vote up
private Annotation[] getReturnMethodAnnotations(MessagePartInfo mpi) {
    AbstractMessageContainer mi = mpi.getMessageInfo();
    if (mi == null || !isOutputMessage(mi)) {
        return null;
    }
    OperationInfo oi = mi.getOperation();
    return oi != null ? (Annotation[])oi.getProperty("method.return.annotations") : null;
}
 
Example #30
Source File: MethodMapperTest.java    From cxf with Apache License 2.0 5 votes vote down vote up
@Test
public void testMapWrappedOperation() throws Exception {
    OperationInfo operation = getOperation();
    operation.setUnwrappedOperation(operation);

    JavaMethod method = new MethodMapper().map(operation);
    assertNotNull(method);

    assertTrue(method.isWrapperStyle());
}