本文整理汇总了Java中javax.wsdl.BindingOperation.getBindingOutput方法的典型用法代码示例。如果您正苦于以下问题:Java BindingOperation.getBindingOutput方法的具体用法?Java BindingOperation.getBindingOutput怎么用?Java BindingOperation.getBindingOutput使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.wsdl.BindingOperation
的用法示例。
在下文中一共展示了BindingOperation.getBindingOutput方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setOutputEncodingStyle
import javax.wsdl.BindingOperation; //导入方法依赖的package包/类
private void setOutputEncodingStyle( SOAPEnvelope soapEnvelope, String operationName )
throws IOException, SOAPException
{
Port port = getWSDLPort();
if ( port != null ) {
BindingOperation bindingOperation = port.getBinding().getBindingOperation( operationName, null, null );
if ( bindingOperation == null ) {
return;
}
BindingOutput output = bindingOperation.getBindingOutput();
if ( output == null ) {
return;
}
for( ExtensibilityElement element : (List<ExtensibilityElement>) output.getExtensibilityElements() ) {
if ( element instanceof javax.wsdl.extensions.soap.SOAPBody ) {
List<String> list = ((javax.wsdl.extensions.soap.SOAPBody) element).getEncodingStyles();
if ( list != null && list.isEmpty() == false ) {
soapEnvelope.setEncodingStyle( list.get( 0 ) );
soapEnvelope.addNamespaceDeclaration( "enc", list.get( 0 ) );
}
}
}
}
}
示例2: getRPCResponseMethodName
import javax.wsdl.BindingOperation; //导入方法依赖的package包/类
/**
* Returns a qualified name for a RPC method that is a root element for a SOAPBody.
*
* @param portName a port name of the operation
* @param operationName an operation name
*
* @return QName wrapper that is qualified name of the method or null if no method to be defined (not "rpc" operation style)
*
* @throws UnknownOperationException
*/
@Override
public QName getRPCResponseMethodName(String portName, String operationName) throws UnknownOperationException {
if (portName == null) {
portName = findPort(operationName);
}
BindingOperation bindingOperation = getBindingOperation(portName, operationName);
String style = getOperationStyle(portName, operationName);
if ("rpc".equals(style)) {
BindingOutput bindingOutput = bindingOperation.getBindingOutput();
if (bindingOutput != null) {
String namespace = getNamespaceURI(bindingOutput);
if (namespace != null) {
return new QName(namespace, operationName);
}
}
return new QName(operationName);
}
return null;
}
示例3: getAttachmentFromBinding
import javax.wsdl.BindingOperation; //导入方法依赖的package包/类
/**
* This method will process a WSDL Binding and build AttachmentDescription objects if the
* WSDL dicatates attachments.
*/
public static void getAttachmentFromBinding(OperationDescriptionImpl opDesc, Binding binding) {
if (binding != null) {
Iterator bindingOpIter = binding.getBindingOperations().iterator();
while (bindingOpIter.hasNext()) {
BindingOperation bindingOp = (BindingOperation) bindingOpIter.next();
// found the BindingOperation that matches the current OperationDescription
if (bindingOp.getName().equals(opDesc.getName().getLocalPart())) {
if (bindingOp.getBindingInput() != null) {
if (log.isDebugEnabled()) {
log.debug("Processing binding opertion input");
}
processBindingForMIME(bindingOp.getBindingInput().getExtensibilityElements(),
opDesc, bindingOp.getOperation(), true);
}
if (bindingOp.getBindingOutput() != null) {
if (log.isDebugEnabled()) {
log.debug("Processing binding output");
}
processBindingForMIME(bindingOp.getBindingOutput().getExtensibilityElements(),
opDesc, bindingOp.getOperation(), false);
}
}
}
}
}
示例4: getSoapOutputUse
import javax.wsdl.BindingOperation; //导入方法依赖的package包/类
@Override
public String getSoapOutputUse(String portName, String operationName) throws UnknownOperationException {
if (portName == null) {
portName = findPort(operationName);
}
BindingOperation bindingOperation = getBindingOperation(portName, operationName);
BindingOutput bindingOutput = bindingOperation.getBindingOutput();
if (bindingOutput != null) {
return getUse(bindingOutput);
}
return null;
}
示例5: getBindingOutPut
import javax.wsdl.BindingOperation; //导入方法依赖的package包/类
private static BindingOutput getBindingOutPut(final BindingOperation bOp) {
BindingOutput bOutput = bOp.getBindingOutput();
if (bOutput == null) {
throw new NullPointerException("BindingOutput cannot be null for operation "
+ bOp.getName() + ".");
}
return bOutput;
}
示例6: getBindingOutputNamespace
import javax.wsdl.BindingOperation; //导入方法依赖的package包/类
/**
* This method will return the namespace for the BindingOutput that this operation
* specifies. It will first look for a namespace on the WSDL Binding object and then
* default to the web service's target namespace.
*/
public String getBindingOutputNamespace() {
String tns = null;
Binding binding =
this.getEndpointInterfaceDescriptionImpl()
.getEndpointDescriptionImpl()
.getWSDLBinding();
if (binding != null) {
if (log.isDebugEnabled()) {
log.debug("Found WSDL binding");
}
// this call does not support overloaded WSDL operations as it
// does not specify the name of the input and output messages
BindingOperation bindingOp =
binding.getBindingOperation(getOperationName(), null, null);
if (bindingOp != null && bindingOp.getBindingOutput() != null) {
if (log.isDebugEnabled()) {
log.debug("Found WSDL binding operation and output");
}
tns = getBindingNamespace(bindingOp.getBindingOutput());
if (tns != null && log.isDebugEnabled()) {
log.debug("For operation: " + bindingOp.getName()
+ " returning the following namespace for output message"
+ " from WSDL: " + tns);
}
}
}
if (tns == null) {
tns = getEndpointInterfaceDescription().getTargetNamespace();
if (log.isDebugEnabled()) {
log.debug("For binding output returning @WebService.targetNamespace: " + tns);
}
}
return tns;
}
示例7: getSOAPHeaders
import javax.wsdl.BindingOperation; //导入方法依赖的package包/类
/**
* Build a HashSet of SOAP header names for the specified operation and binding.
*
* @param binding WSDL Binding instance.
* @param operationName Name of the operation.
* @return HashSet of soap header names, empty set if no headers present.
*/
protected static HashSet<String> getSOAPHeaders(Binding binding, String operationName) {
List<ExtensibilityElement> headers = new ArrayList<ExtensibilityElement>();
BindingOperation bindingOperation = binding.getBindingOperation(operationName, null, null);
if (bindingOperation == null) {
throw new IllegalArgumentException("Can not find operation: " + operationName);
}
BindingInput bindingInput = bindingOperation.getBindingInput();
if (bindingInput != null) {
headers.addAll(WsdlUtils.findExtensibilityElements(bindingInput, SOAP_HEADER_ELEMENT_NAME));
}
BindingOutput bindingOutput = bindingOperation.getBindingOutput();
if (bindingOutput != null) {
headers.addAll(WsdlUtils.findExtensibilityElements(bindingOutput, SOAP_HEADER_ELEMENT_NAME));
}
HashSet<String> headerSet = new HashSet<String>(headers.size());
for (ExtensibilityElement element : headers) {
if (element instanceof SOAP12Header) {
headerSet.add(((SOAP12Header)element).getPart());
} else {
headerSet.add(((SOAPHeader)element).getPart());
}
}
return headerSet;
}
示例8: getSOAPHeaders
import javax.wsdl.BindingOperation; //导入方法依赖的package包/类
/**
* Build a HashSet of SOAP header names for the specified operation and binding.
*
* @param binding
* WSDL Binding instance.
* @param operationName
* Name of the operation.
* @return HashSet of soap header names, empty set if no headers present.
*/
protected static HashSet<String> getSOAPHeaders( Binding binding, String operationName ) {
List<ExtensibilityElement> headers = new ArrayList<ExtensibilityElement>();
BindingOperation bindingOperation = binding.getBindingOperation( operationName, null, null );
if ( bindingOperation == null ) {
throw new IllegalArgumentException( "Can not find operation: " + operationName );
}
BindingInput bindingInput = bindingOperation.getBindingInput();
if ( bindingInput != null ) {
headers.addAll( WsdlUtils.findExtensibilityElements( bindingInput, SOAP_HEADER_ELEMENT_NAME ) );
}
BindingOutput bindingOutput = bindingOperation.getBindingOutput();
if ( bindingOutput != null ) {
headers.addAll( WsdlUtils.findExtensibilityElements( bindingOutput, SOAP_HEADER_ELEMENT_NAME ) );
}
HashSet<String> headerSet = new HashSet<String>( headers.size() );
for ( ExtensibilityElement element : headers ) {
if ( element instanceof SOAP12Header ) {
headerSet.add( ( (SOAP12Header) element ).getPart() );
} else {
headerSet.add( ( (SOAPHeader) element ).getPart() );
}
}
return headerSet;
}
示例9: 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;
}