本文整理汇总了Java中javax.wsdl.Operation.getInput方法的典型用法代码示例。如果您正苦于以下问题:Java Operation.getInput方法的具体用法?Java Operation.getInput怎么用?Java Operation.getInput使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.wsdl.Operation
的用法示例。
在下文中一共展示了Operation.getInput方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getOperationByElement
import javax.wsdl.Operation; //导入方法依赖的package包/类
/**
* Get the SOAP {@link Operation} instance for the specified message element.
*
* @param port The WSDL port.
* @param elementName The SOAP Body element QName.
* @param documentStyle true if it is 'document', false if 'rpc'.
* @return The Operation instance, or null if the operation was not found on the port.
*/
public static Operation getOperationByElement(Port port, QName elementName, Boolean documentStyle) {
List<Operation> operations = port.getBinding().getPortType().getOperations();
for (Operation operation : operations) {
if (!documentStyle && (elementName.getLocalPart().equals(operation.getName()))) {
return operation;
} else {
if ((operation.getInput() != null)
&& (operation.getInput().getMessage() != null)
&& (operation.getInput().getMessage().getParts() != null)
&& !operation.getInput().getMessage().getParts().isEmpty()) {
// Note: WS-I Profile allows only one child under SOAPBody.
Part part = (Part)operation.getInput().getMessage().getParts().values().iterator().next();
if ((part.getElementName() != null) && elementName.equals(part.getElementName())
|| (part.getTypeName() != null) && elementName.equals(part.getTypeName())) {
return operation;
} else if (elementName.getLocalPart().equals(operation.getName())) {
return operation;
}
// }
}
}
}
return null;
}
示例2: 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));
}
}
}
示例3: findOperation
import javax.wsdl.Operation; //导入方法依赖的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: getAllPaths
import javax.wsdl.Operation; //导入方法依赖的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;
}
示例5: verifySuccess
import javax.wsdl.Operation; //导入方法依赖的package包/类
/**
* Ensure that the catalog is used to locate imported resources.
*/
private void verifySuccess(String wsdlLocation, String catalogFile) {
URL url = getURLFromLocation(wsdlLocation);
try{
OASISCatalogManager catalogManager = new OASISCatalogManager();
catalogManager.setCatalogFiles(getURLFromLocation(catalogFile).toString());
WSDL4JWrapper w4j = new WSDL4JWrapper(url, catalogManager, false, 0);
Definition wsdlDef = w4j.getDefinition();
assertNotNull(wsdlDef);
QName portTypeName = new QName("http://www.example.com/test/calculator",
"CalculatorService",
"");
PortType portType = wsdlDef.getPortType(portTypeName);
assertNotNull(portType);
Operation clearOp = portType.getOperation("clear", null, null);
assertNotNull(clearOp);
Input clearOpInput = clearOp.getInput();
assertNotNull(clearOpInput);
Message msg = clearOpInput.getMessage();
assertNotNull(msg);
Part expectedPart = msg.getPart("part1");
assertNotNull(expectedPart);
}catch(Exception e){
e.printStackTrace();
fail();
}
}
示例6: testGenerateInputActionNoNames
import javax.wsdl.Operation; //导入方法依赖的package包/类
public void testGenerateInputActionNoNames() {
String expectedAction =
"http://ws.apache.org/axis2/actiontest/withoutWSAWActionNoName/echoRequest";
PortType pt = definition.getPortType(
new QName("http://ws.apache.org/axis2/actiontest/", "withoutWSAWActionNoName"));
List operations = pt.getOperations();
Operation op = (Operation) operations.get(0);
Input in = op.getInput();
String actualAction = WSDL11ActionHelper.getActionFromInputElement(definition, pt, op, in);
assertEquals(expectedAction, actualAction);
}
示例7: testGenerateInputAction
import javax.wsdl.Operation; //导入方法依赖的package包/类
public void testGenerateInputAction() {
String expectedAction =
"http://ws.apache.org/axis2/actiontest/withoutWSAWAction/NamedInput";
PortType pt = definition.getPortType(
new QName("http://ws.apache.org/axis2/actiontest/", "withoutWSAWAction"));
List operations = pt.getOperations();
Operation op = (Operation) operations.get(0);
Input in = op.getInput();
String actualAction = WSDL11ActionHelper.getActionFromInputElement(definition, pt, op, in);
assertEquals(expectedAction, actualAction);
}
示例8: testGetWSAWInputAction
import javax.wsdl.Operation; //导入方法依赖的package包/类
public void testGetWSAWInputAction() {
String expectedAction = "http://example.org/action/echoIn";
PortType pt = definition
.getPortType(new QName("http://ws.apache.org/axis2/actiontest/", "withWSAWAction"));
List operations = pt.getOperations();
Operation op = (Operation) operations.get(0);
Input in = op.getInput();
String actualAction = WSDL11ActionHelper.getActionFromInputElement(definition, pt, op, in);
assertEquals(expectedAction, actualAction);
}
示例9: toDumpData
import javax.wsdl.Operation; //导入方法依赖的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;
}
示例10: buildOperation
import javax.wsdl.Operation; //导入方法依赖的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;
}
示例11: walkTree
import javax.wsdl.Operation; //导入方法依赖的package包/类
public void walkTree() {
begin();
try {
visit(definition);
for (Iterator iterator = definition.getImports().entrySet().iterator(); iterator.hasNext(); ) {
Map.Entry entry = (Map.Entry) iterator.next();
String namespaceURI = (String) entry.getKey();
List importsForNamespace = (List) entry.getValue();
for (Iterator iterator1 = importsForNamespace.iterator(); iterator1.hasNext(); ) {
Import anImport = (Import) iterator1.next();
visit(anImport);
}
}
visit(definition.getTypes());
Collection messages = definition.getMessages().values();
for (Iterator iterator = messages.iterator(); iterator.hasNext(); ) {
Message message = (Message) iterator.next();
visit(message);
Collection parts = message.getParts().values();
for (Iterator iterator2 = parts.iterator(); iterator2.hasNext(); ) {
Part part = (Part) iterator2.next();
visit(part);
}
}
Collection services = definition.getServices().values();
for (Iterator iterator = services.iterator(); iterator.hasNext(); ) {
Service service = (Service) iterator.next();
visit(service);
Collection ports = service.getPorts().values();
for (Iterator iterator1 = ports.iterator(); iterator1.hasNext(); ) {
Port port = (Port) iterator1.next();
visit(port);
Binding binding = port.getBinding();
visit(binding);
List bindingOperations = binding.getBindingOperations();
for (int i = 0; i < bindingOperations.size(); i++) {
BindingOperation bindingOperation = (BindingOperation) bindingOperations.get(i);
visit(bindingOperation);
visit(bindingOperation.getBindingInput());
visit(bindingOperation.getBindingOutput());
Collection bindingFaults = bindingOperation.getBindingFaults().values();
for (Iterator iterator2 = bindingFaults.iterator(); iterator2.hasNext(); ) {
BindingFault bindingFault = (BindingFault) iterator2.next();
visit(bindingFault);
}
}
PortType portType = binding.getPortType();
visit(portType);
List operations = portType.getOperations();
for (int i = 0; i < operations.size(); i++) {
Operation operation = (Operation) operations.get(i);
visit(operation);
{
Input input = operation.getInput();
visit(input);
}
{
Output output = operation.getOutput();
visit(output);
}
Collection faults = operation.getFaults().values();
for (Iterator iterator2 = faults.iterator(); iterator2.hasNext(); ) {
Fault fault = (Fault) iterator2.next();
visit(fault);
}
}
}
}
} catch (Exception e) {
logger.error(e.getMessage(), e);
} finally {
end();
}
}