org.apache.cxf.binding.Binding.getBindingInfo()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(10.8k)|赞(0)|评价(0)|浏览(94)

本文整理了Java中org.apache.cxf.binding.Binding.getBindingInfo()方法的一些代码示例,展示了Binding.getBindingInfo()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Binding.getBindingInfo()方法的具体详情如下:
包路径:org.apache.cxf.binding.Binding
类名称:Binding
方法名:getBindingInfo

Binding.getBindingInfo介绍

[英]Get the BindingInfo for this binding.
[中]获取此绑定的BindingInfo。

代码示例

代码示例来源:origin: org.apache.cxf/cxf-rt-frontend-jaxws

client.getEndpoint().getBinding().getBindingInfo(), hasOpName);
if (findDispatchOp && !payloadOPMap.isEmpty()) {
  QName payloadElementName = null;
            client.getEndpoint().getBinding().getBindingInfo(), hasOpName);
      BindingOperationInfo dbop = client.getEndpoint().getBinding().getBindingInfo()
        .getOperation(dispatchedOpName);
      if (dbop != null) {

代码示例来源:origin: org.apache.cxf/cxf-rt-frontend-jaxws

in.add(new MessageModeInInterceptor(clazz, getBinding().getBindingInfo().getName()));
  out.add(saajOut);
  out.add(new MessageModeOutInterceptor(saajOut,
                     getBinding().getBindingInfo().getName()));
} else if (isProvider) {
  out.add(new MessageModeOutInterceptor(clazz, getBinding().getBindingInfo().getName()));

代码示例来源:origin: org.apache.cxf/cxf-rt-frontend-jaxws

add(new MessageModeOutInterceptor(saajOut,
                   client.getEndpoint()
                     .getBinding().getBindingInfo().getName()));
client.getInInterceptors().add(new SAAJInInterceptor());
client.getInInterceptors()
  .add(new MessageModeInInterceptor(clazz,
                   client.getEndpoint()
                     .getBinding().getBindingInfo().getName()));

代码示例来源:origin: org.apache.cxf/cxf-rt-frontend-jaxws

hasOpName = true;
BindingOperationInfo bop = client.getEndpoint().getBinding()
              .getBindingInfo().getOperation(opName);
if (bop == null) {
  addInvokeOperation(opName, isOneWay);

代码示例来源:origin: org.apache.cxf/cxf-rt-frontend-jaxws

hasOpName = true;
BindingOperationInfo bop = client.getEndpoint().getBinding()
  .getBindingInfo().getOperation(opName);
if (bop == null) {
  addInvokeOperation(opName, false);

代码示例来源:origin: org.apache.camel/camel-cxf

private void resetPartTypes(Binding bop2) {
  // The HypbridSourceDatabinding, based on JAXB, will possibly set
  // JAXB types into the parts.  Since we need the Source objects,
  // we'll reset the types to either Source (for streaming), or null
  // (for non-streaming, defaults to DOMSource.
  for (BindingOperationInfo bop : bop2.getBindingInfo().getOperations()) {
    resetPartTypes(bop);
  }
}

代码示例来源:origin: org.apache.camel/camel-cxf

private void resetPartTypes(Binding bop2) {
  // The HypbridSourceDatabinding, based on JAXB, will possibly set
  // JAXB types into the parts.  Since we need the Source objects,
  // we'll reset the types to either Source (for streaming), or null
  // (for non-streaming, defaults to DOMSource.
  for (BindingOperationInfo bop : bop2.getBindingInfo().getOperations()) {
    resetPartTypes(bop);
  }
}

代码示例来源:origin: stackoverflow.com

Binding binding = client.getEndpoint().getBinding();
   BindingInfo bindingInfo = binding.getBindingInfo();
   Collection<BindingOperationInfo> operations = bindingInfo
       .getOperations();
   for (BindingOperationInfo boi : operations) {
     BindingMessageInfo inputMessageInfo = boi.getInput();
     List<MessagePartInfo> parts = inputMessageInfo
         .getMessageParts();
     System.out.println("method name: "
         + parts.get(0).getConcreteName().getLocalPart());
     for (Field param : parts.get(0).getTypeClass()
         .getDeclaredFields()) {
       System.out.println("param_name: " + param.getName()
           + " type:" + param.getType());
     }
   }

代码示例来源:origin: org.mule.modules/mule-module-cxf

protected BindingOperationInfo getBindingOperationFromEndpoint(Endpoint ep, final String operationName)
{
  QName q = new QName(ep.getService().getName().getNamespaceURI(), operationName);
  BindingOperationInfo bop = ep.getBinding().getBindingInfo().getOperation(q);
  return bop;
}

代码示例来源:origin: apache/cxf

public <T> T get(Class<T> key) {
  T t = key.cast(get(key.getName()));
  if (t == null) {
    if (key == Bus.class) {
      t = key.cast(bus);
    } else if (key == OperationInfo.class && bindingOp != null) {
      t = key.cast(bindingOp.getOperationInfo());
    } else if (key == BindingOperationInfo.class) {
      t = key.cast(bindingOp);
    } else if (key == Endpoint.class) {
      t = key.cast(endpoint);
    } else if (key == Service.class) {
      t = key.cast(service);
    } else if (key == Binding.class) {
      t = key.cast(binding);
    } else if (key == BindingInfo.class && binding != null) {
      t = key.cast(binding.getBindingInfo());
    } else if (key == InterfaceInfo.class && endpoint != null) {
      t = key.cast(endpoint.getEndpointInfo().getService().getInterface());
    } else if (key == ServiceInfo.class && endpoint != null) {
      t = key.cast(endpoint.getEndpointInfo().getService());
    }
  }
  return t;
}

代码示例来源:origin: org.apache.cxf/cxf-core

public <T> T get(Class<T> key) {
  T t = key.cast(get(key.getName()));
  if (t == null) {
    if (key == Bus.class) {
      t = key.cast(bus);
    } else if (key == OperationInfo.class && bindingOp != null) {
      t = key.cast(bindingOp.getOperationInfo());
    } else if (key == BindingOperationInfo.class) {
      t = key.cast(bindingOp);
    } else if (key == Endpoint.class) {
      t = key.cast(endpoint);
    } else if (key == Service.class) {
      t = key.cast(service);
    } else if (key == Binding.class) {
      t = key.cast(binding);
    } else if (key == BindingInfo.class && binding != null) {
      t = key.cast(binding.getBindingInfo());
    } else if (key == InterfaceInfo.class && endpoint != null) {
      t = key.cast(endpoint.getEndpointInfo().getService().getInterface());
    } else if (key == ServiceInfo.class && endpoint != null) {
      t = key.cast(endpoint.getEndpointInfo().getService());
    }
  }
  return t;
}

代码示例来源:origin: org.talend.esb/locator

/**
 * Extracts the bindingId from a Server.
 * @param server
 * @return
 */
private static String getBindingId(Server server) {
  Endpoint ep = server.getEndpoint();
  BindingInfo bi = ep.getBinding().getBindingInfo();
  return bi.getBindingId();
}

代码示例来源:origin: Talend/tesb-rt-se

/**
 * Extracts the bindingId from a Server.
 * @param server
 * @return
 */
private static String getBindingId(Server server) {
  Endpoint ep = server.getEndpoint();
  BindingInfo bi = ep.getBinding().getBindingInfo();
  return bi.getBindingId();
}

代码示例来源:origin: org.mule.services/mule-service-soap

private BindingOperationInfo getInvocationOperation() throws Exception {
 // Normally its not this hard to invoke the CXF Client, but we're
 // sending along some exchange properties, so we need to use a more advanced
 // method
 Endpoint ep = client.getEndpoint();
 // The operation is always named invoke because hits our ProxyService implementation.
 QName q = new QName(ep.getService().getName().getNamespaceURI(), "invoke");
 BindingOperationInfo bop = ep.getBinding().getBindingInfo().getOperation(q);
 if (bop.isUnwrappedCapable()) {
  bop = bop.getUnwrappedOperation();
 }
 return bop;
}

代码示例来源:origin: org.apache.camel/camel-cxf

protected void setupEndpoint(Endpoint ep) {
  resetPartTypes(ep.getBinding());
  Class<?> fmt = Source.class;
  if (ep.getBinding() instanceof SoapBinding) {
    ep.getInInterceptors().add(new SAAJInInterceptor());          
    SAAJOutInterceptor out = new SAAJOutInterceptor();
    ep.getOutInterceptors().add(out);
    ep.getOutInterceptors().add(new CxfMessageSoapHeaderOutInterceptor());
    ep.getOutInterceptors().add(new MessageModeOutInterceptor(out, ep.getBinding().getBindingInfo().getName()));
    fmt = SOAPMessage.class;
  } else {
    ep.getOutInterceptors().add(new MessageModeOutInterceptor(Source.class, ep.getBinding().getBindingInfo().getName()));
  }
  ep.getInInterceptors().add(new MessageModeInInterceptor(fmt, ep.getBinding().getBindingInfo().getName()));            
  ep.put(AbstractInDatabindingInterceptor.NO_VALIDATE_PARTS, Boolean.TRUE);
  // need to remove the wrapper class and holder interceptor
  removeInterceptors(ep.getInInterceptors(), REMOVING_IN_INTERCEPTORS);
  removeInterceptors(ep.getOutInterceptors(), REMOVING_OUT_INTERCEPTORS);
}

代码示例来源:origin: Talend/tesb-rt-se

private QName getEndpointName(Endpoint e) {
  ServiceInfo sInfo = e.getBinding().getBindingInfo().getService();
  return sInfo == null ? e.getEndpointInfo().getName() : sInfo.getInterface().getName();
}

代码示例来源:origin: org.talend.esb/sam-agent

private QName getEndpointName(Endpoint e) {
  ServiceInfo sInfo = e.getBinding().getBindingInfo().getService();
  return sInfo == null ? e.getEndpointInfo().getName() : sInfo.getInterface().getName();
}

代码示例来源:origin: apache/cxf

public void handleMessage(Message message) throws Fault {
  String action = (String)message.get(SoapBindingConstants.SOAP_ACTION);
  if (action == null) {
    AddressingProperties inProps = (AddressingProperties)message
      .getContextualProperty(JAXWSAConstants.ADDRESSING_PROPERTIES_INBOUND);
    if (inProps != null && inProps.getAction() != null) {
      action = inProps.getAction().getValue();
    }
  }
  if ("http://schemas.xmlsoap.org/ws/2004/09/transfer/Get".equals(action)
    || "http://schemas.xmlsoap.org/ws/2004/09/mex/GetMetadata/Request".equals(action)) {
    message.remove(AssertionInfoMap.class.getName());
    Exchange ex = message.getExchange();
    Endpoint endpoint = createEndpoint(message);
    ex.put(Endpoint.class, endpoint);
    ex.put(Service.class, endpoint.getService());
    ex.put(org.apache.cxf.binding.Binding.class, endpoint.getBinding());
    ex.put(BindingOperationInfo.class,
        endpoint.getBinding().getBindingInfo()
          .getOperation(new QName("http://mex.ws.cxf.apache.org/", "Get2004")));
    ex.remove(BindingOperationInfo.class);
    message.put(MAPAggregator.ACTION_VERIFIED, Boolean.TRUE);
    message.getInterceptorChain().add(endpoint.getInInterceptors());
    message.getInterceptorChain().add(endpoint.getBinding().getInInterceptors());
  }
}

代码示例来源:origin: org.apache.cxf/cxf-rt-ws-mex

public void handleMessage(Message message) throws Fault {
  String action = (String)message.get(SoapBindingConstants.SOAP_ACTION);
  if (action == null) {
    AddressingProperties inProps = (AddressingProperties)message
      .getContextualProperty(JAXWSAConstants.ADDRESSING_PROPERTIES_INBOUND);
    if (inProps != null && inProps.getAction() != null) {
      action = inProps.getAction().getValue();
    }
  }
  if ("http://schemas.xmlsoap.org/ws/2004/09/transfer/Get".equals(action)
    || "http://schemas.xmlsoap.org/ws/2004/09/mex/GetMetadata/Request".equals(action)) {
    message.remove(AssertionInfoMap.class.getName());
    Exchange ex = message.getExchange();
    Endpoint endpoint = createEndpoint(message);
    ex.put(Endpoint.class, endpoint);
    ex.put(Service.class, endpoint.getService());
    ex.put(org.apache.cxf.binding.Binding.class, endpoint.getBinding());
    ex.put(BindingOperationInfo.class,
        endpoint.getBinding().getBindingInfo()
          .getOperation(new QName("http://mex.ws.cxf.apache.org/", "Get2004")));
    ex.remove(BindingOperationInfo.class);
    message.put(MAPAggregator.ACTION_VERIFIED, Boolean.TRUE);
    message.getInterceptorChain().add(endpoint.getInInterceptors());
    message.getInterceptorChain().add(endpoint.getBinding().getInInterceptors());
  }
}

代码示例来源:origin: Talend/tesb-rt-se

public static void fillCallContext(CallContext callContext, SoapMessage message) {
  if (callContext.getOperationName() == null) {
    callContext.setOperationName((QName) message.get(Message.WSDL_OPERATION));
  }
  callContext.setPortTypeName((QName) message.get(Message.WSDL_INTERFACE));
  callContext.setServiceName((QName) message.get(Message.WSDL_SERVICE));
  final BindingInfo bi = message.getExchange().getBinding().getBindingInfo();
  callContext.setBindingId(bi == null
      ? "http://schemas.xmlsoap.org/wsdl/soap/" : bi.getBindingId());
  URL wsdlLocation = resolveCallbackWsdlLocation(callContext.getServiceName(), message);
  if (wsdlLocation != null) {
    callContext.setWsdlLocation(wsdlLocation);
  }
  String flowId = FlowIdHelper.getFlowId(message);
  if (flowId != null && !flowId.isEmpty()) {
    callContext.setFlowId(flowId);
  }
}

相关文章