本文整理汇总了Java中javax.wsdl.Operation.getName方法的典型用法代码示例。如果您正苦于以下问题:Java Operation.getName方法的具体用法?Java Operation.getName怎么用?Java Operation.getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.wsdl.Operation
的用法示例。
在下文中一共展示了Operation.getName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: OperationInfo
import javax.wsdl.Operation; //导入方法依赖的package包/类
public OperationInfo(Operation operation) {
targetMethodName = operation.getName();
Input inDef = operation.getInput();
if (inDef != null) {
Message inMsg = inDef.getMessage();
if (inMsg != null) {
input = getParameterFromMessage(inMsg);
}
}
Output outDef = operation.getOutput();
if (outDef != null) {
Message outMsg = outDef.getMessage();
if (outMsg != null) {
output = getParameterFromMessage(outMsg);
}
}
for (Fault fault : (Collection<Fault>) operation.getFaults().values()) {
Message faultMsg = fault.getMessage();
if (faultMsg != null) {
faults.add(getParameterFromMessage(faultMsg));
}
}
}
示例2: getNameFromInputElement
import javax.wsdl.Operation; //导入方法依赖的package包/类
/**
* Get the name of the specified Input element using the rules defined in WSDL 1.1
* Section 2.4.5 http://www.w3.org/TR/wsdl#_names
*/
private static String getNameFromInputElement(Operation op, Input input) {
// Get the name from the input element if specified.
String result = input.getName();
// If not we'll have to generate it.
if (result == null) {
// If Request-Response or Solicit-Response do something special per
// WSDL 1.1 Section 2.4.5
OperationType operationType = op.getStyle();
if (null != operationType) {
if (operationType.equals(OperationType.REQUEST_RESPONSE)) {
result = op.getName() + REQUEST;
} else if (operationType.equals(OperationType.SOLICIT_RESPONSE)) {
result = op.getName() + RESPONSE;
}
}
// If the OperationType was not available for some reason, assume on-way or notification
if (result == null) {
result = op.getName();
}
}
return result;
}
示例3: getNameFromOutputElement
import javax.wsdl.Operation; //导入方法依赖的package包/类
/**
* Get the name of the specified Output element using the rules defined in WSDL 1.1
* Section 2.4.5 http://www.w3.org/TR/wsdl#_names
*/
private static String getNameFromOutputElement(Operation op, Output output) {
// Get the name from the output element if specified.
String result = output.getName();
// If not we'll have to generate it.
if (result == null) {
// If Request-Response or Solicit-Response do something special per
// WSDL 1.1 Section 2.4.5
OperationType operationType = op.getStyle();
if (null != operationType) {
if (operationType.equals(OperationType.REQUEST_RESPONSE)) {
return op.getName() + RESPONSE;
} else if (operationType.equals(OperationType.SOLICIT_RESPONSE)) {
return op.getName() + SOLICIT;
}
}
// If the OperationType was not available for some reason, assume on-way or notification
if (result == null) {
result = op.getName();
}
}
return result;
}
示例4: populateModelFromWsdl
import javax.wsdl.Operation; //导入方法依赖的package包/类
@SuppressWarnings({ "unchecked" })
private static void populateModelFromWsdl(IProxyRepositoryFactory factory, Definition definition, ServiceItem serviceItem,
RepositoryNode serviceRepositoryNode) throws CoreException {
serviceRepositoryNode.getChildren().clear();
((ServiceConnection) serviceItem.getConnection()).getServicePort().clear();
for (PortType portType : (Collection<PortType>) definition.getAllPortTypes().values()) {
ServicePort port = ServicesFactory.eINSTANCE.createServicePort();
port.setId(factory.getNextId());
port.setName(portType.getQName().getLocalPart());
for (Operation operation : (Collection<Operation>) portType.getOperations()) {
String operationName = operation.getName();
ServiceOperation serviceOperation = ServicesFactory.eINSTANCE.createServiceOperation();
serviceOperation.setId(factory.getNextId());
RepositoryNode operationNode = new RepositoryNode(new RepositoryViewObject(serviceItem.getProperty()),
serviceRepositoryNode, ENodeType.REPOSITORY_ELEMENT);
operationNode.setProperties(EProperties.LABEL, serviceItem.getProperty().getLabel());
operationNode.setProperties(EProperties.CONTENT_TYPE, ERepositoryObjectType.SERVICESOPERATION);
serviceOperation.setName(operationName);
if (operation.getDocumentationElement() != null) {
serviceOperation.setDocumentation(operation.getDocumentationElement().getTextContent());
}
serviceOperation.setLabel(operationName);
serviceOperation.setInBinding(WSDLUtils.isOperationInBinding(definition, port.getName(), operationName));
port.getServiceOperation().add(serviceOperation);
}
((ServiceConnection) serviceItem.getConnection()).getServicePort().add(port);
}
}
示例5: toString
import javax.wsdl.Operation; //导入方法依赖的package包/类
private static String toString(List wsdlOperationList) {
String result = "";
Iterator wsdlOpIter = wsdlOperationList.iterator();
while (wsdlOpIter.hasNext()) {
Object obj = wsdlOpIter.next();
if (obj instanceof Operation) {
Operation operation = (Operation)obj;
result += operation.getName() + " ";
}
}
return result;
}
示例6: WsdlOperation
import javax.wsdl.Operation; //导入方法依赖的package包/类
/**
* Create a new wsdl operation instance for the specified binding and operation.
*
* @param binding Binding for the operation.
* @param op The operation.
* @param wsdlTypes WSDL type information.
*/
protected WsdlOperation(Binding binding, Operation op, WsdlTypes wsdlTypes) {
_operationQName = new QName(wsdlTypes.getTargetNamespace(), op.getName());
_oneway = true;
String soapBindingStyle = WsdlUtils.getSOAPBindingStyle(binding);
if ("rpc".equals(soapBindingStyle)) {
_bindingStyle = SOAPBindingStyle.RPC;
}
else {
_bindingStyle = SOAPBindingStyle.DOCUMENT;
}
String soapBindingUse = WsdlUtils.getSOAPBindingUse(binding, op.getName());
if ("encoded".equals(soapBindingUse)) {
_bindingUse = SOAPBindingUse.ENCODED;
}
else {
_bindingUse = SOAPBindingUse.LITERAL;
}
_soapAction = WsdlUtils.getSOAPAction(binding.getBindingOperation(op.getName(), null, null));
_params = new WsdlOpParameterList(op, binding, wsdlTypes);
loadParameters(op);
_faults = new WsdlOpFaultList(wsdlTypes);
loadFaults(op);
_returnType = _params.getReturnType();
_parameterStyle = _params.getParameterStyle();
}
示例7: WsdlOperation
import javax.wsdl.Operation; //导入方法依赖的package包/类
/**
* Create a new wsdl operation instance for the specified binding and operation.
*
* @param binding Binding for the operation.
* @param op The operation.
* @param wsdlTypes WSDL type information.
*/
protected WsdlOperation(Binding binding, Operation op, WsdlTypes wsdlTypes) throws KettleException {
_operationQName = new QName(wsdlTypes.getTargetNamespace(), op.getName());
_oneway = true;
String soapBindingStyle = WsdlUtils.getSOAPBindingStyle(binding);
if ("rpc".equals(soapBindingStyle)) {
_bindingStyle = SOAPBindingStyle.RPC;
}
else {
_bindingStyle = SOAPBindingStyle.DOCUMENT;
}
String soapBindingUse = WsdlUtils.getSOAPBindingUse(binding, op.getName());
if ("encoded".equals(soapBindingUse)) {
_bindingUse = SOAPBindingUse.ENCODED;
}
else {
_bindingUse = SOAPBindingUse.LITERAL;
}
_soapAction = WsdlUtils.getSOAPAction(binding.getBindingOperation(op.getName(), null, null));
_params = new WsdlOpParameterList(op, binding, wsdlTypes);
loadParameters(op);
_faults = new WsdlOpFaultList(wsdlTypes);
loadFaults(op);
_returnType = _params.getReturnType();
_parameterStyle = _params.getParameterStyle();
}
示例8: LightweightOperationInfoBuilder
import javax.wsdl.Operation; //导入方法依赖的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: WsdlOperation
import javax.wsdl.Operation; //导入方法依赖的package包/类
/**
* Create a new wsdl operation instance for the specified binding and operation.
*
* @param binding
* Binding for the operation.
* @param op
* The operation.
* @param wsdlTypes
* WSDL type information.
*/
protected WsdlOperation( Binding binding, Operation op, WsdlTypes wsdlTypes ) throws KettleException {
_operationQName = new QName( wsdlTypes.getTargetNamespace(), op.getName() );
_oneway = true;
String soapBindingStyle = WsdlUtils.getSOAPBindingStyle( binding );
if ( "rpc".equals( soapBindingStyle ) ) {
_bindingStyle = SOAPBindingStyle.RPC;
} else {
_bindingStyle = SOAPBindingStyle.DOCUMENT;
}
String soapBindingUse = WsdlUtils.getSOAPBindingUse( binding, op.getName() );
if ( "encoded".equals( soapBindingUse ) ) {
_bindingUse = SOAPBindingUse.ENCODED;
} else {
_bindingUse = SOAPBindingUse.LITERAL;
}
_soapAction = WsdlUtils.getSOAPAction( binding.getBindingOperation( op.getName(), null, null ) );
_params = new WsdlOpParameterList( op, binding, wsdlTypes );
loadParameters( op );
_faults = new WsdlOpFaultList( wsdlTypes );
loadFaults( op );
_returnType = _params.getReturnType();
_parameterStyle = _params.getParameterStyle();
}
示例10: processOperation
import javax.wsdl.Operation; //导入方法依赖的package包/类
protected WSOperation processOperation(Operation wsOperation, WSService service) {
WSOperation operation = new WSOperation(this.namespace + wsOperation.getName(), wsOperation.getName(), service);
return operation;
}
示例11: processOperation
import javax.wsdl.Operation; //导入方法依赖的package包/类
private WSOperation processOperation(Operation wsOperation, WSService service) {
WSOperation operation = new WSOperation(this.namespace + wsOperation.getName(), wsOperation.getName(), service);
return operation;
}
示例12: checkWSRFPorts
import javax.wsdl.Operation; //导入方法依赖的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;
}
}
}
}
}
}
示例13: assertComposedMessageOK
import javax.wsdl.Operation; //导入方法依赖的package包/类
private void assertComposedMessageOK(Message soapMessage, Operation operation) throws SOAPException {
Node inputMessage = soapMessage.getContent(Node.class);
String actualNS = inputMessage.getNamespaceURI();
String actualLN = inputMessage.getLocalName();
@SuppressWarnings("unchecked")
List<Part> parts = operation.getInput().getMessage().getOrderedParts(null);
if (parts.isEmpty()) {
throw SOAPMessages.MESSAGES.invalidInputSOAPPayloadForServiceOperation(operation.getName(), _service.getName().toString(), actualLN);
}
QName expectedPayloadType = null;
if (_documentStyle) {
if (parts.get(0).getElementName() != null) {
expectedPayloadType = parts.get(0).getElementName();
} else if (parts.get(0).getTypeName() != null) {
expectedPayloadType = parts.get(0).getTypeName();
}
} else {
// RPC
expectedPayloadType = new QName(_targetNamespace, operation.getName());
}
String expectedNS = null;
String expectedLN = null;
if (expectedPayloadType != null) {
expectedNS = expectedPayloadType.getNamespaceURI();
expectedLN = expectedPayloadType.getLocalPart();
}
if (!_documentStyle) {
expectedLN = operation.getName();
}
if (expectedNS != null && !expectedNS.equals(actualNS)) {
throw SOAPMessages.MESSAGES.invalidInputSOAPPayloadNamespaceForServiceOperation(operation.getName(), _service.getName().toString(), expectedNS, actualNS);
} else if (expectedLN != null && !expectedLN.equals(actualLN)) {
throw SOAPMessages.MESSAGES.invalidInputSOAPPayloadLocalNamePartForServiceOperation(operation.getName(), _service.getName().toString(), expectedLN, actualLN);
}
}
示例14: findOperations
import javax.wsdl.Operation; //导入方法依赖的package包/类
private StubInfo.Operation[] findOperations(Parser wsdlParser, Port port) {
SymbolTable symbolTable = wsdlParser.getSymbolTable();
BindingEntry bEntry = symbolTable.getBindingEntry(port.getBinding().getQName());
Set opSet = bEntry.getParameters().keySet();
Iterator itr = opSet.iterator();
StubInfo.Operation[] siOps = new StubInfo.Operation[opSet.size()];
for (int i = 0; itr.hasNext(); i++) {
// Get the operation and add the parameters
Operation op = (Operation) itr.next();
Vector parms = bEntry.getParameters(op).list;
// Populate the parms
StubInfo.Parameter[] siParms = new StubInfo.Parameter[parms.size()];
StubInfo.Operation siOp = new StubInfo.Operation(op.getName(), siParms);
siOps[i] = siOp;
Iterator tmpItr = parms.iterator();
for (int j = 0; tmpItr.hasNext(); j++) {
Parameter p = (Parameter) tmpItr.next();
siParms[j] = new StubInfo.Parameter(p.getName(), p.isNillable(), p.isOmittable());
}
// If there is only 1 parameter and it's a complex object,
// gather parameter information for its properties.
if (parms.size() == 1) {
Vector elems = ((Parameter) parms.get(0)).getType().getContainedElements();
if (elems != null && !elems.isEmpty()) {
StubInfo.Parameter[] siSubParms = new StubInfo.Parameter[elems.size()];
tmpItr = elems.iterator();
for (int j = 0; tmpItr.hasNext(); j++) {
ElementDecl e = (ElementDecl) tmpItr.next();
siSubParms[j] = new StubInfo.Parameter(e.getName(), e.getNillable(), e.getMinOccursIs0());
}
siOp.setSubParameters(siSubParms);
}
}
}
// Return the operations
return siOps;
}
示例15: generateActionFromFaultElement
import javax.wsdl.Operation; //导入方法依赖的package包/类
/**
* Generate the Action for a Fault using the Default Action Pattern
* <p/>
* Pattern is defined as [target namespace][delimiter][port type name][delimiter][operation name][delimiter]Fault[delimiter][fault name]
*
* @param def is required to obtain the targetNamespace
* @param wsdl4jPortType is required to obtain the portType name
* @param op is required to obtain the operation name
* @param fault is required to obtain the fault name
* @return a wsa:Action value based on the Default Action Pattern and the provided objects
*/
public static String generateActionFromFaultElement(Definition def, PortType wsdl4jPortType,
Operation op, Fault fault) {
// Get the targetNamespace of the wsdl:definition
String targetNamespace = def.getTargetNamespace();
// Determine the delimiter. Per the spec: 'is ":" when the [target namespace] is a URN, otherwise "/".
// Note that for IRI schemes other than URNs which aren't path-based (i.e. those that outlaw the "/"
// character), the default action value may not conform to the rules of the IRI scheme. Authors
// are advised to specify explicit values in the WSDL in this case.'
String delimiter = SLASH;
if (targetNamespace.toLowerCase().startsWith(URN)) {
delimiter = COLON;
}
// Get the portType name (as a string to be included in the action)
String portTypeName = wsdl4jPortType.getQName().getLocalPart();
// Get the operation name (as a string to be included in the action)
String operationName = op.getName();
// Get the name of the fault element (name is mandatory on fault elements)
String faultName = fault.getName();
// Append the bits together
StringBuffer sb = new StringBuffer();
sb.append(targetNamespace);
// Deal with the problem that the targetNamespace may or may not have a trailing delimiter
if (!targetNamespace.endsWith(delimiter)) {
sb.append(delimiter);
}
sb.append(portTypeName);
sb.append(delimiter);
sb.append(operationName);
sb.append(delimiter);
sb.append(FAULT);
sb.append(delimiter);
sb.append(faultName);
// Resolve the action from the StringBuffer
String result = sb.toString();
if (log.isTraceEnabled()) {
log.trace("generateActionFromFaultElement result: " + result);
}
return result;
}