本文整理汇总了Java中javax.wsdl.BindingOperation.getOperation方法的典型用法代码示例。如果您正苦于以下问题:Java BindingOperation.getOperation方法的具体用法?Java BindingOperation.getOperation怎么用?Java BindingOperation.getOperation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.wsdl.BindingOperation
的用法示例。
在下文中一共展示了BindingOperation.getOperation方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getOperations
import javax.wsdl.BindingOperation; //导入方法依赖的package包/类
/**
* The method is here only for compatibility with other modules and will be removed as soon as other modules are updated.
*
* @return a list of all SOAP operations found in the WSDL (including all imported definitions)
* @deprecated
*/
@Deprecated
List<Operation> getOperations() {
List<Operation> operations = new ArrayList<Operation>();
Collection<Binding> bindings = definition.getAllBindings().values();
for (Binding binding : bindings) {
List<ExtensibilityElement> bindingExElements = binding.getExtensibilityElements();
for (ExtensibilityElement bindingExElement : bindingExElements) {
if (bindingExElement instanceof SOAPBinding ||
bindingExElement instanceof SOAP12Binding) {
List<BindingOperation> bindingOperations = binding.getBindingOperations();
for (BindingOperation bindingOperation : bindingOperations) {
Operation operation = bindingOperation.getOperation();
if (operation != null) {
operations.add(operation);
}
}
}
}
}
return operations;
}
示例2: getBindingOperation
import javax.wsdl.BindingOperation; //导入方法依赖的package包/类
private BindingOperation getBindingOperation(String portName, String operationName) throws UnknownOperationException {
BindingOperation bindingOperation = null;
for(BindingOperation bOperation : getBindingOperations(portName)) {
Operation operation = bOperation.getOperation();
if (operationName.equals(operation.getName())) {
if (bindingOperation == null) {
bindingOperation = bOperation;
} else {
logger.log(Level.WARNING, "overloaded operation detected ({0})", operationName);
break;
}
}
}
if (bindingOperation == null) {
throw new UnknownOperationException("no '" + operationName + "' operation found in a '" + portName + "' port");
}
return bindingOperation;
}
示例3: findOperation
import javax.wsdl.BindingOperation; //导入方法依赖的package包/类
private Operation findOperation(PortType portType,
BindingOperation wsdl4jBindingOperation) {
Operation op = wsdl4jBindingOperation.getOperation();
String input = null;
if (op != null && op.getInput() != null) {
input = op.getInput().getName();
if (":none".equals(input)) {
input = null;
}
}
String output = null;
if (op != null && op.getOutput() != null) {
output = op.getOutput().getName();
if (":none".equals(output)) {
output = null;
}
}
Operation op2 = portType.getOperation(op.getName(), input, output);
return ((op2 == null) ? op : op2);
}
示例4: getOperationDocumentation
import javax.wsdl.BindingOperation; //导入方法依赖的package包/类
@Override
public String getOperationDocumentation(String portName, String operationName) throws UnknownOperationException {
if (portName == null) {
portName = findPort(operationName);
}
BindingOperation bindingOperation = getBindingOperation(portName, operationName);
Operation operation = bindingOperation.getOperation();
return getDocumentation(operation);
}
示例5: getOutputParts
import javax.wsdl.BindingOperation; //导入方法依赖的package包/类
private List<Part> getOutputParts(String portName, String operationName) throws UnknownOperationException {
List<Part> parts = new ArrayList<Part>();
BindingOperation bindingOperation = getBindingOperation(portName, operationName);
Operation operation = bindingOperation.getOperation();
Output output = operation.getOutput();
if (output != null) {
Message outputMessage = output.getMessage();
List<ExtensibilityElement> extensibilityElements = bindingOperation.getBindingOutput().getExtensibilityElements();
for (ExtensibilityElement extensibilityElement : extensibilityElements) {
if (extensibilityElement instanceof SOAPBody) {
SOAPBody soapBody = (SOAPBody) extensibilityElement;
Collection<String> partNames = soapBody.getParts();
if (partNames == null) {
partNames = outputMessage.getParts().keySet();
}
for (String partName : partNames) {
Part part = outputMessage.getPart(partName);
parts.add(part);
}
}
}
}
return parts;
}
示例6: findPort
import javax.wsdl.BindingOperation; //导入方法依赖的package包/类
private String findPort(String operationName) throws UnknownOperationException {
String port_name = null;
loop:
for (QName serviceName : getServices()) {
for (String portName : getPorts(serviceName)) {
for(BindingOperation bindingOperation : getBindingOperations(portName)) {
Operation operation = bindingOperation.getOperation();
if (operationName.equals(operation.getName())) {
if (port_name == null) {
port_name = portName;
break;
} else {
logger.log(Level.WARNING, "ambiguous operation name detected ({0})", operationName);
break loop;
}
}
}
}
}
if (port_name == null) {
throw new UnknownOperationException("no '" + operationName + "' operation found");
}
return port_name;
}
示例7: getAllPaths
import javax.wsdl.BindingOperation; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
private Collection<String> getAllPaths() throws URISyntaxException {
final Set<String> paths = new HashSet<String>();
final Set<QName> portTypes = new HashSet<QName>();
final Set<QName> alreadyCreated = new HashSet<QName>();
for (Binding binding : (Collection<Binding>) wsdlDefinition.getAllBindings().values()) {
final QName portType = binding.getPortType().getQName();
if (portTypes.add(portType)) {
for (BindingOperation operation : (Collection<BindingOperation>) binding.getBindingOperations()) {
Operation oper = operation.getOperation();
Input inDef = oper.getInput();
if (inDef != null) {
Message inMsg = inDef.getMessage();
addParamsToPath(portType, oper, inMsg, paths, alreadyCreated);
}
Output outDef = oper.getOutput();
if (outDef != null) {
Message outMsg = outDef.getMessage();
addParamsToPath(portType, oper, outMsg, paths, alreadyCreated);
}
for (Fault fault : (Collection<Fault>) oper.getFaults().values()) {
Message faultMsg = fault.getMessage();
addParamsToPath(portType, oper, faultMsg, paths, alreadyCreated);
}
}
}
}
return paths;
}
示例8: LightweightOperationInfoBuilder
import javax.wsdl.BindingOperation; //导入方法依赖的package包/类
public LightweightOperationInfoBuilder(BindingOperation bindingOperation, Method method) throws OpenEJBException {
if (bindingOperation == null) {
throw new OpenEJBException("No BindingOperation supplied for method " + method.getName());
}
Operation operation = bindingOperation.getOperation();
this.operationName = operation.getName();
this.inputMessage = operation.getInput().getMessage();
this.outputMessage = operation.getOutput() == null ? null : operation.getOutput().getMessage();
this.method = method;
}
示例9: checkWSRFPorts
import javax.wsdl.BindingOperation; //导入方法依赖的package包/类
private void checkWSRFPorts(Map<String, WSRF_Version> wsrfPorts) {
Collection<Service> services = definition.getAllServices().values();
for (Service service : services) {
Collection<Port> ports = service.getPorts().values();
loop:
for (Port port : ports) {
String portName = port.getName();
Binding binding = port.getBinding();
List<BindingOperation> bindingOperations = binding.getBindingOperations();
for(BindingOperation bindingOperation : bindingOperations) {
Operation operation = bindingOperation.getOperation();
String operationName = operation.getName();
for (WSRF_RPOperation resourcePropertyOperation : WSRF_RPOperation.values()) {
if (operationName.equals(resourcePropertyOperation.name())) {
try {
List<Part> parts = getInputParts(portName, operationName);
if (parts.size() > 0) {
Part part = parts.get(0);
QName qname = part.getElementName();
if (qname == null) {
qname = part.getTypeName();
}
if (qname != null) {
String namespace = qname.getNamespaceURI();
if (namespace != null && namespace.length() > 0) {
for (WSRF_Version wsrfVersion : WSRF_Version.values()) {
if (wsrfVersion.WSRF_RP.equals(namespace)) {
if (!WSRF_Version.Standard.equals(wsrfVersion)) {
logger.log(Level.WARNING, "draft WSRF version found for the WSRF operation: {0} ({1})", new Object[]{operationName, wsrfVersion.name()});
}
else {
String soapAction = getSOAPActionURI(bindingOperation);
if (soapAction == null) {
logger.log(Level.WARNING, "no soap action for the WSRF operation: {0}( {1})", new Object[]{operationName, resourcePropertyOperation.SOAP_ACTION});
} else if (!resourcePropertyOperation.SOAP_ACTION.equals(soapAction)) {
logger.log(Level.WARNING, "wrong soap action for the WSRF operation: {0}( {1})", new Object[]{operationName, resourcePropertyOperation.SOAP_ACTION});
}
}
wsrfPorts.put(portName, wsrfVersion);
break;
}
}
}
}
}
} catch (UnknownOperationException ex) {}
break loop;
}
}
}
}
}
}
示例10: toDumpData
import javax.wsdl.BindingOperation; //导入方法依赖的package包/类
private DumpData toDumpData(BindingOperation bo) {
Map<QName,Message> messages = wsdl.getMessages();
DumpTable table = new DumpTable("#99cc99","#ccffcc","#000000");
DumpTable attributes = new DumpTable("#99cc99","#ccffcc","#000000");
String returns = "void";
attributes.appendRow(3,new SimpleDumpData("name"),new SimpleDumpData("type"));
Operation op = bo.getOperation();
// attributes
Input in = op.getInput();
Message msg = in.getMessage();
//msg=WSUtil.getMessageByLocalName(messages,bo.getBindingInput().getName());
//print.e(msg.getQName());
List<Part> parts = msg.getOrderedParts(null);
Iterator<Part> it = parts.iterator();
Part p;
QName en;
QName type;
while(it.hasNext()){
p=it.next();
en=p.getElementName();
if(en!=null) {
type=en;
Types types = wsdl.getTypes();
}
else
type= p.getTypeName();
attributes.appendRow(0,
new SimpleDumpData(en+":"+p.getName()),
new SimpleDumpData(toLuceeType(type)));
}
// return
msg = bo.getOperation().getOutput().getMessage();
msg=wsdl.getMessage(msg.getQName());
parts = msg.getOrderedParts(null);
it = parts.iterator();
while(it.hasNext()){
p=it.next();
returns=toLuceeType(p.getTypeName());
}
table.appendRow(1,new SimpleDumpData("arguments"),attributes);
table.appendRow(1,new SimpleDumpData("return type"),new SimpleDumpData(returns));
// if(doc.length()>0)table.appendRow(1,new SimpleDumpData("hint"),new SimpleDumpData(doc));
return table;
}
示例11: populateComponent
import javax.wsdl.BindingOperation; //导入方法依赖的package包/类
private static ServiceInfo populateComponent(Service service) {
ServiceInfo serviceInfo = new ServiceInfo();
serviceInfo.setServiceName(service.getQName());
Collection<Port> ports = service.getPorts().values();
for (Port port : ports) {
String soapLocation = null;
SOAPAddress soapAddress = findExtensibilityElement(port.getExtensibilityElements(), SOAPAddress.class);
if (null != soapAddress) {
soapLocation = soapAddress.getLocationURI();
} else {
SOAP12Address soap12Address = findExtensibilityElement(port.getExtensibilityElements(), SOAP12Address.class);
if (null != soap12Address) {
soapLocation = soap12Address.getLocationURI();
}
}
Binding binding = port.getBinding();
for (BindingOperation operation : (Collection<BindingOperation>) binding.getBindingOperations()) {
SOAPOperation soapOperation = findExtensibilityElement(operation.getExtensibilityElements(), SOAPOperation.class);
if (null != soapOperation && OPERATION_TYPE_RPC.equalsIgnoreCase(soapOperation.getStyle())) {
// TESB-6151 disable display of unsupported RPC type.
serviceInfo.setHasRpcOperation(true);
continue;
}
OperationInfo operationInfo = new OperationInfo(operation.getOperation());
operationInfo.setPortName(port.getName());
operationInfo.setNamespaceURI(binding.getPortType().getQName().getNamespaceURI());
if (soapOperation != null) {
operationInfo.setSoapActionURI(soapOperation.getSoapActionURI());
} else {
SOAP12Operation soap12Operation = findExtensibilityElement(operation.getExtensibilityElements(),
SOAP12Operation.class);
if (soap12Operation != null) {
operationInfo.setSoapActionURI(soap12Operation.getSoapActionURI());
}
}
operationInfo.setTargetURL(soapLocation);
serviceInfo.addOperation(operationInfo);
}
}
return serviceInfo;
}
示例12: buildOperation
import javax.wsdl.BindingOperation; //导入方法依赖的package包/类
private OperationInfo buildOperation(OperationInfo operationInfo,
BindingOperation bindingOper) {
System.out.println("从一个BindingOperation对象(<wsdl:operation>)构建OperationInfo对象");
Operation oper = bindingOper.getOperation();
operationInfo.setTargetMethodName(oper.getName());
Vector operElems = findExtensibilityElement(bindingOper
.getExtensibilityElements(), "operation");
ExtensibilityElement operElem = (ExtensibilityElement) operElems
.elementAt(0);
if (operElem != null && operElem instanceof SOAPOperation) {
SOAPOperation soapOperation = (SOAPOperation) operElem;
operationInfo.setSoapActionURI(soapOperation.getSoapActionURI());
}
BindingInput bindingInput = bindingOper.getBindingInput();
BindingOutput bindingOutput = bindingOper.getBindingOutput();
Vector bodyElems = findExtensibilityElement(bindingInput
.getExtensibilityElements(), "body");
ExtensibilityElement bodyElem = (ExtensibilityElement) bodyElems
.elementAt(0);
if (bodyElem != null && bodyElem instanceof SOAPBody) {
SOAPBody soapBody = (SOAPBody) bodyElem;
List styles = soapBody.getEncodingStyles();
String encodingStyle = null;
if (styles != null) {
encodingStyle = styles.get(0).toString();
}
if (encodingStyle == null) {
encodingStyle = DEFAULT_SOAP_ENCODING_STYLE;
}
operationInfo.setEncodingStyle(encodingStyle.toString());
operationInfo.setTargetObjectURI(soapBody.getNamespaceURI());
}
Input inDef = oper.getInput();
System.out.println("开始转移到了<wsdl:portTyp>结点下的<wsdl:input>");
if (inDef != null) {
Message inMsg = inDef.getMessage();
if (inMsg != null) {
operationInfo.setInputMessageName(inMsg.getQName().getLocalPart());
//输入消息的参数构建
getParameterFromMessage(operationInfo, inMsg, 1);
System.out.println("***操作:"+operationInfo.getTargetMethodName()+"的所有输入参数已经构建完毕***");
System.out.println("");
operationInfo.setInmessage(inMsg);
}
}
Output outDef = oper.getOutput();
if (outDef != null) {
Message outMsg = outDef.getMessage();
if (outMsg != null) {
operationInfo.setOutputMessageName(outMsg.getQName()
.getLocalPart());
//输出消息的参数构建
getParameterFromMessage(operationInfo, outMsg, 2);
System.out.println("***操作:"+operationInfo.getTargetMethodName()+"的所有输出参数已经构建完毕***");
System.out.println("");
operationInfo.setOutmessage(outMsg);
}
}
return operationInfo;
}
示例13: HeavyweightOperationInfoBuilder
import javax.wsdl.BindingOperation; //导入方法依赖的package包/类
public HeavyweightOperationInfoBuilder(BindingOperation bindingOperation, ServiceEndpointMethodMapping methodMapping, JavaWsdlMapping mapping, XmlSchemaInfo schemaInfo) throws OpenEJBException {
Operation operation = bindingOperation.getOperation();
this.operationName = operation.getName();
this.operationStyle = JaxRpcOperationInfo.OperationStyle.valueOf(operation.getStyle().toString());
this.outputMessage = operation.getOutput() == null ? null : operation.getOutput().getMessage();
this.inputMessage = operation.getInput().getMessage();
// faults
for (Object o : operation.getFaults().values()) {
faults.add((Fault) o);
}
this.mapping = mapping;
this.methodMapping = methodMapping;
this.schemaInfo = schemaInfo;
// index types - used to process build exception class constructor args
for (JavaXmlTypeMapping javaXmlTypeMapping : mapping.getJavaXmlTypeMapping()) {
String javaClassName = javaXmlTypeMapping.getJavaType();
if (javaXmlTypeMapping.getAnonymousTypeQname() != null) {
String anonymousTypeQName = javaXmlTypeMapping.getAnonymousTypeQname();
anonymousTypes.put(anonymousTypeQName, javaClassName);
} else if (javaXmlTypeMapping.getRootTypeQname() != null) {
QName qname = javaXmlTypeMapping.getRootTypeQname();
publicTypes.put(qname, javaClassName);
}
}
// BindingStyle
if (methodMapping.getWrappedElement() != null) {
bindingStyle = BindingStyle.DOCUMENT_LITERAL_WRAPPED;
} else {
BindingInput bindingInput = bindingOperation.getBindingInput();
SOAPOperation soapOperation = JaxRpcServiceInfoBuilder.getExtensibilityElement(SOAPOperation.class, bindingOperation.getExtensibilityElements());
String styleString = soapOperation.getStyle();
if (styleString == null) {
SOAPBinding soapBinding = JaxRpcServiceInfoBuilder.getExtensibilityElement(SOAPBinding.class, bindingInput.getExtensibilityElements());
styleString = soapBinding.getStyle();
}
SOAPBody soapBody = JaxRpcServiceInfoBuilder.getExtensibilityElement(SOAPBody.class, bindingInput.getExtensibilityElements());
String useString = soapBody.getUse();
bindingStyle = BindingStyle.getBindingStyle(styleString, useString);
}
}