本文整理汇总了Java中javax.wsdl.Binding.getPortType方法的典型用法代码示例。如果您正苦于以下问题:Java Binding.getPortType方法的具体用法?Java Binding.getPortType怎么用?Java Binding.getPortType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.wsdl.Binding
的用法示例。
在下文中一共展示了Binding.getPortType方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getOperation
import javax.wsdl.Binding; //导入方法依赖的package包/类
/**
* Find the specified operation in the WSDL definition.
*
* @param operationName Name of operation to find.
* @return A WsdlOperation instance, null if operation can not be found in WSDL.
*/
public WsdlOperation getOperation(String operationName) {
// is the operation in the cache?
if (_operationCache.containsKey(operationName)) {
return (WsdlOperation) _operationCache.get(operationName);
}
Binding b = _port.getBinding();
PortType pt = b.getPortType();
Operation op = pt.getOperation(operationName, null, null);
if (op != null) {
try {
WsdlOperation wop = new WsdlOperation(b, op, _wsdlTypes);
// cache the operation
_operationCache.put(operationName, wop);
return wop;
}
catch(Exception e) {
LogWriter.getInstance().logError("WSDL", "Could retrieve WSDL Operator for operation name: "+operationName, e);
}
}
return null;
}
示例2: getOperation
import javax.wsdl.Binding; //导入方法依赖的package包/类
/**
* Find the specified operation in the WSDL definition.
*
* @param operationName Name of operation to find.
* @return A WsdlOperation instance, null if operation can not be found in WSDL.
*/
public WsdlOperation getOperation(String operationName) throws KettleStepException {
// is the operation in the cache?
if (_operationCache.containsKey(operationName)) {
return (WsdlOperation) _operationCache.get(operationName);
}
Binding b = _port.getBinding();
PortType pt = b.getPortType();
Operation op = pt.getOperation(operationName, null, null);
if (op != null) {
try {
WsdlOperation wop = new WsdlOperation(b, op, _wsdlTypes);
// cache the operation
_operationCache.put(operationName, wop);
return wop;
}
catch (KettleException kse) {
LogChannel.GENERAL.logError("Could not retrieve WSDL Operator for operation name: "+operationName);
throw new KettleStepException("Could not retrieve WSDL Operator for operation name: "+operationName, kse);
}
}
return null;
}
示例3: getOperation
import javax.wsdl.Binding; //导入方法依赖的package包/类
/**
* Find the specified operation in the WSDL definition.
*
* @param operationName
* Name of operation to find.
* @return A WsdlOperation instance, null if operation can not be found in WSDL.
*/
public WsdlOperation getOperation( String operationName ) throws KettleStepException {
// is the operation in the cache?
if ( _operationCache.containsKey( operationName ) ) {
return _operationCache.get( operationName );
}
Binding b = _port.getBinding();
PortType pt = b.getPortType();
Operation op = pt.getOperation( operationName, null, null );
if ( op != null ) {
try {
WsdlOperation wop = new WsdlOperation( b, op, _wsdlTypes );
// cache the operation
_operationCache.put( operationName, wop );
return wop;
} catch ( KettleException kse ) {
LogChannel.GENERAL.logError( "Could not retrieve WSDL Operator for operation name: " + operationName );
throw new KettleStepException(
"Could not retrieve WSDL Operator for operation name: " + operationName, kse );
}
}
return null;
}
示例4: isOperationInBinding
import javax.wsdl.Binding; //导入方法依赖的package包/类
public static boolean isOperationInBinding(Definition definition, String portTypeName, String operationName)
throws CoreException {
Collection<?> services = definition.getServices().values();
for (Object s : services) {
Service service = (Service) s;
Collection<?> ports = service.getPorts().values();
for (Object p : ports) {
Port port = (Port) p;
Binding binding = port.getBinding();
if (binding == null) {
continue;
}
PortType portType = binding.getPortType();
if (portType == null || !portTypeName.equals(portType.getQName().getLocalPart())) {
continue;
}
List<?> bindingOperations = binding.getBindingOperations();
for (Object o : bindingOperations) {
BindingOperation bo = (BindingOperation) o;
if (operationName.equals(bo.getName())) {
return true;
}
}
}
}
return false;
}
示例5: convertPort
import javax.wsdl.Binding; //导入方法依赖的package包/类
private void convertPort( Port port )
throws IOException
{
String comment = "";
String name = port.getName();
String protocol = "soap";
String location = "socket://localhost:80/";
if ( port.getDocumentationElement() != null ) {
comment = port.getDocumentationElement().getNodeValue();
}
List< ExtensibilityElement > extElements = port.getExtensibilityElements();
for( ExtensibilityElement element : extElements ) {
if ( element instanceof SOAPAddress ) {
location = ((SOAPAddress)element).getLocationURI().toString();
StringBuilder builder = new StringBuilder();
builder.append( "soap {\n" )
.append( "\t.wsdl = \"" )
.append( definition.getDocumentBaseURI() )
.append( "\";\n" )
.append( "\t.wsdl.port = \"" )
.append( port.getName() )
.append( "\"\n}");
protocol = builder.toString();
} else if ( element instanceof HTTPAddress ) {
location = ((HTTPAddress)element).getLocationURI().toString();
protocol = "http";
}
}
try {
URI uri = new URI( location );
uri = new URI(
"socket",
uri.getUserInfo(),
uri.getHost(),
( uri.getPort() < 1 ) ? 80 : uri.getPort(),
uri.getPath(),
uri.getQuery(),
uri.getFragment()
);
location = uri.toString();
} catch( URISyntaxException e ) {
e.printStackTrace();
}
Binding binding = port.getBinding();
PortType portType = binding.getPortType();
convertPortType( portType, binding );
outputPorts.put( name, new OutputPort(
name, location, protocol, portType.getQName().getLocalPart(), comment
) );
}
示例6: walkTree
import javax.wsdl.Binding; //导入方法依赖的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();
}
}