本文整理汇总了Java中javax.wsdl.Input类的典型用法代码示例。如果您正苦于以下问题:Java Input类的具体用法?Java Input怎么用?Java Input使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Input类属于javax.wsdl包,在下文中一共展示了Input类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addWsdlPortTypeOperation
import javax.wsdl.Input; //导入依赖的package包/类
private static void addWsdlPortTypeOperation(Definition definition, QName portTypeQName, String operationName, String operationComment, QName inputQName, QName ouptutQName) {
Message inputMessage = definition.createMessage();
inputMessage.setQName(inputQName);
Input input = definition.createInput();
input.setMessage(inputMessage);
Message outpuMessage = definition.createMessage();
outpuMessage.setQName(ouptutQName);
Output output = definition.createOutput();
output.setMessage(outpuMessage);
Operation operation = definition.createOperation();
operation.setName(operationName);
operation.setInput(input);
operation.setOutput(output);
operation.setUndefined(false);
addWsdLDocumentation(definition, operation, operationComment);
PortType portType = definition.getPortType(portTypeQName);
portType.addOperation(operation);
}
示例2: addOWOperation2PT
import javax.wsdl.Input; //导入依赖的package包/类
private Operation addOWOperation2PT(Definition def, PortType pt, OneWayOperationDeclaration op) {
Operation wsdlOp = def.createOperation();
wsdlOp.setName(op.id());
wsdlOp.setStyle(OperationType.ONE_WAY);
wsdlOp.setUndefined(false);
Input in = def.createInput();
Message msg_req = addRequestMessage(localDef, op);
msg_req.setUndefined(false);
in.setMessage(msg_req);
wsdlOp.setInput(in);
wsdlOp.setUndefined(false);
pt.addOperation(wsdlOp);
return wsdlOp;
}
示例3: OperationInfo
import javax.wsdl.Input; //导入依赖的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));
}
}
}
示例4: getNameFromInputElement
import javax.wsdl.Input; //导入依赖的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;
}
示例5: createInput
import javax.wsdl.Input; //导入依赖的package包/类
public Input createInput() {
if (isDebugEnabled) {
log.debug(myClassName + ".createInput()");
}
getWrappedDefinitionForUse();
Input results = null;
if (wsdlDefinition != null) {
if (hasBeenSaved) {
hasBeenUpdatedSinceSaving = true;
}
results = wsdlDefinition.createInput();
}
doneUsingWrappedDefinition();
return results;
}
示例6: readInTheWSDLFile
import javax.wsdl.Input; //导入依赖的package包/类
/**
* Read the WSDL file
*
* @param uri
* @throws WSDLException
*/
public Definition readInTheWSDLFile(final String uri) throws WSDLException {
WSDLReader reader = WSDLFactory.newInstance().newWSDLReader();
reader.setFeature("javax.wsdl.importDocuments", true);
ExtensionRegistry extReg = WSDLFactory.newInstance().newPopulatedExtensionRegistry();
extReg.registerExtensionAttributeType(Input.class,
new QName(AddressingConstants.Final.WSAW_NAMESPACE, AddressingConstants.WSA_ACTION),
AttributeExtensible.STRING_TYPE);
extReg.registerExtensionAttributeType(Output.class,
new QName(AddressingConstants.Final.WSAW_NAMESPACE, AddressingConstants.WSA_ACTION),
AttributeExtensible.STRING_TYPE);
reader.setExtensionRegistry(extReg);
return reader.readWSDL(uri);
}
示例7: addRROperation2PT
import javax.wsdl.Input; //导入依赖的package包/类
private Operation addRROperation2PT(Definition def, PortType pt, RequestResponseOperationDeclaration op) {
Operation wsdlOp = def.createOperation();
wsdlOp.setName(op.id());
wsdlOp.setStyle(OperationType.REQUEST_RESPONSE);
wsdlOp.setUndefined(false);
// creating input
Input in = def.createInput();
Message msg_req = addRequestMessage(localDef, op);
in.setMessage(msg_req);
wsdlOp.setInput(in);
// creating output
Output out = def.createOutput();
Message msg_resp = addResponseMessage(localDef, op);
out.setMessage(msg_resp);
wsdlOp.setOutput(out);
// creating faults
for (Entry<String, TypeDefinition> curFault : op.faults().entrySet()) {
Fault fault = localDef.createFault();
fault.setName(curFault.getKey());
Message flt_msg = addFaultMessage(localDef, op, curFault.getValue(), curFault.getKey());
fault.setMessage(flt_msg);
wsdlOp.addFault(fault);
}
pt.addOperation(wsdlOp);
return wsdlOp;
}
示例8: getAllPaths
import javax.wsdl.Input; //导入依赖的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;
}
示例9: getWSAInputAction
import javax.wsdl.Input; //导入依赖的package包/类
/**
* Attempts to extract the WS-Addressing "Action" attribute value from the operation definition.
* When WS-Addressing is being used by a service provider, the "Action" is specified in the
* portType->operation instead of the SOAP binding->operation.
*
* @param partnerMessageContext BPELMessageContext
* @return the SOAPAction value if one is specified, otherwise empty string
*/
public static String getWSAInputAction(BPELMessageContext partnerMessageContext) {
BindingOperation bop = partnerMessageContext.getWsdlBindingForCurrentMessageFlow()
.getBindingOperation(partnerMessageContext.getOperationName(), null, null);
if (bop == null) {
return "";
}
Input input = bop.getOperation().getInput();
if (input != null) {
Object action = input.getExtensionAttribute(new QName(Namespaces.WS_ADDRESSING_NS,
"Action"));
if (action instanceof String) {
return ((String) action);
}
action = input.getExtensionAttribute(new QName(BPELConstants.WS_ADDRESSING_NS2,
"Action"));
if (action instanceof String) {
return ((String) action);
}
action = input.getExtensionAttribute(new QName(BPELConstants.WS_ADDRESSING_NS3,
"Action"));
if (action instanceof String) {
return ((String) action);
}
action = input.getExtensionAttribute(new QName(BPELConstants.WS_ADDRESSING_NS4,
"Action"));
if (action instanceof String) {
return ((String) action);
}
}
return "";
}
示例10: populateBindingInput
import javax.wsdl.Input; //导入依赖的package包/类
@Override
protected void populateBindingInput(Definition definition, BindingInput bindingInput, Input input)
throws WSDLException {
for (SOAPHeader header : makeHeaders(definition)) {
bindingInput.addExtensibilityElement(header);
}
super.populateBindingInput(definition, bindingInput, input);
}
示例11: verifySuccess
import javax.wsdl.Input; //导入依赖的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();
}
}
示例12: getActionFromInputElement
import javax.wsdl.Input; //导入依赖的package包/类
/**
* getActionFromInputElement
*
* @param def the wsdl:definitions which contains the wsdl:portType
* @param wsdl4jPortType the wsdl:portType which contains the wsdl:operation
* @param op the wsdl:operation which contains the input element
* @param input the input element to be examined to generate the wsa:Action
* @return either the wsaw:Action from the input element or an action generated using the DefaultActionPattern
*/
public static String getActionFromInputElement(Definition def, PortType wsdl4jPortType,
Operation op, Input input) {
String result = getWSAWActionExtensionAttribute(input);
if (result == null || result.equals("")) {
result = WSDL11DefaultActionPatternHelper
.generateActionFromInputElement(def, wsdl4jPortType, op, input);
}
log.trace(result);
return result;
}
示例13: generateActionFromInputElement
import javax.wsdl.Input; //导入依赖的package包/类
/**
* Generate the Action for an Input using the Default Action Pattern
* <p/>
* Pattern is defined as [target namespace][delimiter][port type name][delimiter][input name]
*
* @param def is required to obtain the targetNamespace
* @param wsdl4jPortType is required to obtain the portType name
* @param op is required to generate the input name if not explicitly specified
* @param input is required for its name if specified
* @return a wsa:Action value based on the Default Action Pattern and the provided objects
*/
public static String generateActionFromInputElement(Definition def, PortType wsdl4jPortType,
Operation op, Input input) {
// Get the targetNamespace of the wsdl:definitions
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 name of the input element (and generate one if none explicitly specified)
String inputName = getNameFromInputElement(op, input);
// 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(inputName);
// Resolve the action from the StringBuffer
String result = sb.toString();
if (log.isTraceEnabled()) {
log.trace("generateActionFromInputElement result: " + result);
}
return result;
}
示例14: createInput
import javax.wsdl.Input; //导入依赖的package包/类
public Input createInput() {
if (isDebugEnabled) {
log.debug(myClassName + ".createInput()");
}
if (wsdlDefinition != null) {
return wsdlDefinition.createInput();
}
return null;
}
示例15: testGenerateInputActionNoNames
import javax.wsdl.Input; //导入依赖的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);
}