Java源码示例:javax.wsdl.Operation

示例1
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;
}
 
示例2
private static void addParamsToPath(final QName portType, Operation oper, Message msg, final Set<String> paths,
        final Set<QName> alreadyCreated) throws URISyntaxException {
    if (msg != null) {
        List<QName> messageParts = getMessageParts(msg);
        if (messageParts.isEmpty()) {
            return;
        }
        for(QName messagePart : messageParts) {
            if (alreadyCreated.add(messagePart)) {
                String folderPath = FolderNameUtil.getImportedXmlSchemaPath(messagePart.getNamespaceURI(),
                        portType.getLocalPart(), oper.getName());
                paths.add(folderPath);
            }
        }
    }
}
 
示例3
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
/**
 * Gets the target namespace given the soap binding operation
 *
 * @param bindingOperation soap operation
 * @return target name space
 */
private String getTargetNamespace(BindingOperation bindingOperation) {

    Operation operation = bindingOperation.getOperation();
    if (operation != null) {
        Input input = operation.getInput();

        if (input != null) {
            Message message = input.getMessage();
            if (message != null) {
                Map partMap = message.getParts();

                for (Object obj : partMap.entrySet()) {
                    Map.Entry entry = (Map.Entry) obj;
                    Part part = (Part) entry.getValue();
                    if (part != null) {
                        if (part.getElementName() != null) {
                            return part.getElementName().getNamespaceURI();
                        }
                    }
                }
            }
        }
    }
    return targetNamespace;
}
 
示例5
private Operation generateOperation(String name, Message inputMsg, Message outputMsg) {
    Input input = definition.createInput();
    input.setName(inputMsg.getQName().getLocalPart());
    input.setMessage(inputMsg);

    Output output = definition.createOutput();
    output.setName(outputMsg.getQName().getLocalPart());
    output.setMessage(outputMsg);

    Operation result = definition.createOperation();
    result.setName(name);
    result.setInput(input);
    result.setOutput(output);
    result.setUndefined(false);

    portType.addOperation(result);

    return result;
}
 
示例6
/** Generates a corba:operation in the corba:binding container within a wsdl:binding.
 *
 * Only one (or none) corba parameter and only one (or none) corba return parameter are supported.
 *
 * @param op is the wsdl operation to bind.
 * @param param is the corba parameter, none if null.
 * @param arg is the corba return parameter, none if null.
 * @return the generated corba:operation.
 */
private OperationType generateCorbaOperation(Operation op, ParamType param, ArgType arg) {
    OperationType operation = null;
    try {
        operation = (OperationType)extReg.createExtension(BindingOperation.class,
                                                          CorbaConstants.NE_CORBA_OPERATION);
    } catch (WSDLException ex) {
        throw new RuntimeException(ex);
    }
    operation.setName(op.getName());

    if (param != null) {
        operation.getParam().add(param);
    }

    if (arg != null) {
        operation.setReturn(arg);
    }

    return operation;
}
 
示例7
private BindingOperation generateCorbaBindingOperation(Binding wsdlBinding,
                                                       Operation op,
                                                       OperationType corbaOp) {
    BindingInput bindingInput = definition.createBindingInput();
    bindingInput.setName(op.getInput().getName());

    BindingOutput bindingOutput = definition.createBindingOutput();
    bindingOutput.setName(op.getOutput().getName());

    BindingOperation bindingOperation = definition.createBindingOperation();
    bindingOperation.addExtensibilityElement((ExtensibilityElement)corbaOp);
    bindingOperation.setOperation(op);
    bindingOperation.setName(op.getName());

    bindingOperation.setBindingInput(bindingInput);
    bindingOperation.setBindingOutput(bindingOutput);

    binding.addBindingOperation(bindingOperation);

    return bindingOperation;
}
 
示例8
private BindingOperation generateBindingOperation(Binding wsdlBinding, Operation op,
                                                  String corbaOpName) {
    BindingOperation bindingOperation = definition.createBindingOperation();
    //OperationType operationType = null;
    try {
        corbaOperation = (OperationType)extReg.createExtension(BindingOperation.class,
                                                               CorbaConstants.NE_CORBA_OPERATION);
    } catch (WSDLException ex) {
        throw new RuntimeException(ex);
    }
    corbaOperation.setName(corbaOpName);
    bindingOperation.addExtensibilityElement((ExtensibilityElement)corbaOperation);
    bindingOperation.setOperation(op);
    bindingOperation.setName(op.getName());
    binding.addBindingOperation(bindingOperation);
    return bindingOperation;
}
 
示例9
public void processParameters(WSDLToCorbaBinding wsdlToCorbaBinding, Operation operation, Definition def,
                              SchemaCollection xmlSchemaList, List<ParamType> params,
                              List<ArgType> returns, boolean simpleOrdering) throws Exception {

    definition = def;
    List<ParamType> inputs = new ArrayList<>();
    List<ParamType> outputs = new ArrayList<>();
    List<ArgType> returnOutputs = new ArrayList<>();
    boolean isWrapped = isWrappedOperation(operation, xmlSchemaList);

    if (isWrapped) {
        processWrappedInputParams(wsdlToCorbaBinding, operation, xmlSchemaList, inputs);
    } else {
        processInputParams(wsdlToCorbaBinding, operation, xmlSchemaList, inputs);
    }
    if (isWrapped) {
        processWrappedOutputParams(wsdlToCorbaBinding, operation, xmlSchemaList, inputs, outputs);
    } else {
        processOutputParams(wsdlToCorbaBinding, operation, xmlSchemaList, inputs, outputs);
    }
    processReturnParams(outputs, returnOutputs);
    orderParameters(inputs, outputs, true);
    returns.addAll(returnOutputs);
    params.addAll(inputs);

}
 
示例10
@SuppressWarnings("unchecked")
private void addBindingOperation() throws ToolException {
    List<Operation> ops = portType.getOperations();
    for (Operation op : ops) {
        BindingOperation bindingOperation = wsdlDefinition.createBindingOperation();
        bindingOperation.setName(op.getName());
        if (op.getInput() != null) {
            bindingOperation.setBindingInput(getBindingInput(op.getInput(), op.getName()));
        }
        if (op.getOutput() != null) {
            bindingOperation.setBindingOutput(getBindingOutput(op.getOutput(), op.getName()));
        }
        if (op.getFaults() != null && op.getFaults().size() > 0) {
            addXMLFaults(op, bindingOperation);
        }
        bindingOperation.setOperation(op);
        binding.addBindingOperation(bindingOperation);
    }
}
 
示例11
@Override
protected void initializeWSDLOperation(InterfaceInfo intf, OperationInfo o, Method method) {
    method = ((JaxWsServiceConfiguration)jaxWsConfiguration).getDeclaredMethod(method);
    o.setProperty(Method.class.getName(), method);
    o.setProperty(METHOD, method);
    initializeWrapping(o, method);

    // rpc out-message-part-info class mapping
    Operation op = (Operation)o.getProperty(WSDLServiceBuilder.WSDL_OPERATION);

    initializeClassInfo(o, method, op == null ? null
        : CastUtils.cast(op.getParameterOrdering(), String.class));

    bindOperation(o, method);

    sendEvent(Event.INTERFACE_OPERATION_BOUND, o, method);
}
 
示例12
protected void buildBindingOperation(Definition def, Binding binding,
                                   Collection<BindingOperationInfo> bindingOperationInfos) {
    BindingOperation bindingOperation = null;
    for (BindingOperationInfo bindingOperationInfo : bindingOperationInfos) {
        bindingOperation = def.createBindingOperation();
        addDocumentation(bindingOperation, bindingOperationInfo.getDocumentation());
        bindingOperation.setName(bindingOperationInfo.getName().getLocalPart());
        for (Operation operation
                : CastUtils.cast(binding.getPortType().getOperations(), Operation.class)) {
            if (operation.getName().equals(bindingOperation.getName())) {
                bindingOperation.setOperation(operation);
                break;
            }
        }
        buildBindingInput(def, bindingOperation, bindingOperationInfo.getInput());
        buildBindingOutput(def, bindingOperation, bindingOperationInfo.getOutput());
        buildBindingFault(def, bindingOperation, bindingOperationInfo.getFaults());
        addExtensibilityAttributes(def, bindingOperation, bindingOperationInfo.getExtensionAttributes());
        addExtensibilityElements(def, bindingOperation, getWSDL11Extensors(bindingOperationInfo));
        binding.addBindingOperation(bindingOperation);
    }
}
 
示例13
public void buildInterface(ServiceInfo si, PortType p) {
    InterfaceInfo inf = si.createInterface(p.getQName());
    DescriptionInfo d = si.getDescription();
    if (null != d) {
        d.getDescribed().add(inf);
    }
    copyDocumentation(inf, p);
    this.copyExtensors(inf, p.getExtensibilityElements());
    this.copyExtensionAttributes(inf, p);
    if (recordOriginal) {
        inf.setProperty(WSDL_PORTTYPE, p);
    }
    for (Operation op : cast(p.getOperations(), Operation.class)) {
        buildInterfaceOperation(inf, op);
    }

}
 
示例14
@SuppressWarnings("unchecked")
private static void addBindingOperation(Definition wsdlDefinition, PortType portType, Binding binding,
                                        ExtensionRegistry extReg) throws Exception {
    List<Operation> ops = portType.getOperations();
    for (Operation op : ops) {
        BindingOperation bindingOperation = wsdlDefinition.createBindingOperation();
        setSoapOperationExtElement(bindingOperation, extReg);
        bindingOperation.setName(op.getName());
        if (op.getInput() != null) {
            bindingOperation.setBindingInput(getBindingInput(op.getInput(), wsdlDefinition, extReg));
        }
        if (op.getOutput() != null) {
            bindingOperation.setBindingOutput(getBindingOutput(op.getOutput(), wsdlDefinition, extReg));
        }
        if (op.getFaults() != null && op.getFaults().size() > 0) {
            addSoapFaults(op, bindingOperation, wsdlDefinition, extReg);
        }
        bindingOperation.setOperation(op);
        binding.addBindingOperation(bindingOperation);
    }
}
 
示例15
@Test
public void testGreetMeOneWayOperation() throws Exception {
    setupWSDL(WSDL_PATH);
    PortType portType = newDef.getPortType(new QName(newDef.getTargetNamespace(),
        "Greeter"));
    Operation greetMeOneWay = portType.getOperation("greetMeOneWay", "greetMeOneWayRequest", null);
    assertNotNull(greetMeOneWay);
    assertEquals("greetMeOneWay", greetMeOneWay.getName());
    Input input = greetMeOneWay.getInput();
    assertNotNull(input);
    assertEquals("greetMeOneWayRequest", input.getName());
    Message message = input.getMessage();
    assertNotNull(message);
    assertEquals("greetMeOneWayRequest", message.getQName().getLocalPart());
    assertEquals(newDef.getTargetNamespace(), message.getQName().getNamespaceURI());
    assertEquals(1, message.getParts().size());
    assertEquals("in", message.getPart("in").getName());
    Output output = greetMeOneWay.getOutput();
    assertNull(output);
    assertEquals(0, greetMeOneWay.getFaults().size());
}
 
示例16
/**
 * 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;
}
 
示例17
/**
 * Get a list of all operations defined in this WSDL.
 *
 * @return List of WsdlOperations.
 */
@SuppressWarnings( "unchecked" )
public List<WsdlOperation> getOperations() throws KettleStepException {

  List<WsdlOperation> opList = new ArrayList<WsdlOperation>();
  PortType pt = _port.getBinding().getPortType();

  List<Operation> operations = pt.getOperations();
  for ( Iterator<Operation> itr = operations.iterator(); itr.hasNext(); ) {
    WsdlOperation operation = getOperation( itr.next().getName() );
    if ( operation != null ) {
      opList.add( operation );
    }
  }
  return opList;
}
 
示例18
/**
 * Constructor.
 *
 * @param op        Operation this arg list is for.
 * @param binding   Binding for the operation.
 * @param wsdlTypes Wsdl types.
 */
protected WsdlOpParameterList( Operation op, Binding binding, WsdlTypes wsdlTypes ) {

  _wsdlTypes = wsdlTypes;
  _returnParam = null;
  _operation = op;
  _parameterStyle = WsdlOperation.SOAPParameterStyle.BARE;
  _headerNames = WsdlUtils.getSOAPHeaders( binding, op.getName() );
}
 
示例19
/**
 * 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 HopException {

  _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();
}
 
示例20
/**
 * Create the fault list for this operation.
 *
 * @param op Operation
 */
@SuppressWarnings( "unchecked" )
private void loadFaults( Operation op ) throws HopTransformException {
  Map<?, Fault> faultMap = op.getFaults();
  for ( Fault fault : faultMap.values() ) {
    _faults.add( fault );
  }
}
 
示例21
private String getOutputMessageRootElementName( String operationName )
	throws IOException {
	String elementName = operationName + ((received) ? "Response" : "");
	Port port = getWSDLPort();
	if( port != null ) {
		try {
			Operation operation = port.getBinding().getPortType().getOperation( operationName, null, null );
			List< ExtensibilityElement > listExt;
			Message soapMessage;
			if( received ) {
				// We are sending a response
				soapMessage = operation.getOutput().getMessage();
				listExt = getWSDLPort().getBinding().getBindingOperation( operationName, null, null )
					.getBindingOutput().getExtensibilityElements();
			} else {
				// We are sending a request
				soapMessage = operation.getInput().getMessage();
				listExt = getWSDLPort().getBinding().getBindingOperation( operationName, null, null )
					.getBindingInput().getExtensibilityElements();
			}
			for( ExtensibilityElement element : listExt ) {
				if( element instanceof SOAPBodyImpl ) {
					SOAPBodyImpl sBodyImpl = (SOAPBodyImpl) element;
					if( sBodyImpl.getParts().size() > 0 ) {
						String partName = sBodyImpl.getParts().get( 0 ).toString();
						elementName = soapMessage.getPart( partName ).getElementName().getLocalPart();
					} else {
						Part part = ((Entry< String, Part >) soapMessage.getParts().entrySet().iterator().next())
							.getValue();
						elementName = part.getElementName().getLocalPart();
					}

				}
			}

		} catch( Exception e ) {
		}
	}
	return elementName;
}
 
示例22
private String[] getParameterOrder( String operationName )
	throws IOException {
	List< String > parameters = null;
	Port port = getWSDLPort();
	if( port != null ) {
		Operation operation = port.getBinding().getPortType().getOperation( operationName, null, null );
		if( operation != null ) {
			parameters = operation.getParameterOrdering();
		}
	}
	return (parameters == null) ? null : parameters.toArray( new String[ 0 ] );
}
 
示例23
private String owOperationToString( joliex.wsdl.impl.Operation operation ) {
	StringBuilder builder = new StringBuilder();
	builder.append( operation.name() ).append( '(' );
	if( operation.requestTypeName() == null ) {
		builder.append( "void" );
	} else {
		builder.append( operation.requestTypeName() );
	}
	builder.append( ')' );
	return builder.toString();
}
 
示例24
private void convertPortType( PortType portType, Binding binding )
	throws IOException {
	String comment = "";
	if( portType.getDocumentationElement() != null ) {
		comment = portType.getDocumentationElement().getNodeValue();
	}

	Style style = Style.DOCUMENT;
	for( ExtensibilityElement element : (List< ExtensibilityElement >) binding.getExtensibilityElements() ) {
		if( element instanceof SOAPBinding ) {
			if( "rpc".equals( ((SOAPBinding) element).getStyle() ) ) {
				style = Style.RPC;
			}
		} else if( element instanceof HTTPBinding ) {
			style = Style.HTTP;
		}
	}
	Interface iface = new Interface( portType.getQName().getLocalPart(), comment );
	List< Operation > operations = portType.getOperations();
	for( Operation operation : operations ) {
		if( operation.getOutput() == null ) {
			iface.addOneWayOperation( convertOperation( operation, style ) );
		} else {
			iface.addRequestResponseOperation( convertOperation( operation, style ) );
		}
	}
	interfaces.put( iface.name(), iface );
}
 
示例25
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, curFault.getValue() );
		fault.setMessage( flt_msg );
		wsdlOp.addFault( fault );

	}
	pt.addOperation( wsdlOp );

	return wsdlOp;
}
 
示例26
@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);
    }
}
 
示例27
@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;
}
 
示例28
private boolean checkR2209(final Operation operation,
                           final BindingOperation bop) {
    if ((bop.getBindingInput() == null && operation.getInput() != null)
        || (bop.getBindingOutput() == null && operation.getOutput() != null)) {
        addErrorMessage(getErrorPrefix("WSI-BP-1.0 R2209")
                        + "Unbound PortType elements in Operation '" + operation.getName() + "'");
        return false;
    }
    return true;
}
 
示例29
public boolean checkBinding() {
    for (PortType portType : wsdlHelper.getPortTypes(def)) {
        Iterator<?> ite = portType.getOperations().iterator();
        while (ite.hasNext()) {
            Operation operation = (Operation)ite.next();
            if (isOverloading(operation.getName())) {
                continue;
            }
            BindingOperation bop = wsdlHelper.getBindingOperation(def, operation.getName());
            if (bop == null) {
                addErrorMessage(getErrorPrefix("WSI-BP-1.0 R2718")
                                + "A wsdl:binding in a DESCRIPTION MUST have the same set of "
                                + "wsdl:operations as the wsdl:portType to which it refers. "
                                + operation.getName() + " not found in wsdl:binding.");
                return false;
            }
            Binding binding = wsdlHelper.getBinding(bop, def);
            String bindingStyle = binding != null ? SOAPBindingUtil.getBindingStyle(binding) : "";
            String style = StringUtils.isEmpty(SOAPBindingUtil.getSOAPOperationStyle(bop))
                ? bindingStyle : SOAPBindingUtil.getSOAPOperationStyle(bop);
            if ("DOCUMENT".equalsIgnoreCase(style) || StringUtils.isEmpty(style)) {
                boolean passed = checkR2201Input(operation, bop)
                    && checkR2201Output(operation, bop)
                    && checkR2209(operation, bop)
                    && checkR2716(bop);
                if (!passed) {
                    return false;
                }
            } else {
                if (!checkR2717AndR2726(bop)) {
                    return false;
                }
            }
        }
    }
    return true;
}
 
示例30
public boolean checkR2205() {
    Collection<Binding> bindings = CastUtils.cast(def.getBindings().values());
    for (Binding binding : bindings) {

        if (!SOAPBindingUtil.isSOAPBinding(binding)) {
            System.err.println("WSIBP Validator found <"
                               + binding.getQName() + "> is NOT a SOAP binding");
            continue;
        }
        if (binding.getPortType() == null) {
            //will error later
            continue;
        }

        for (Iterator<?> ite2 = binding.getPortType().getOperations().iterator(); ite2.hasNext();) {
            Operation operation = (Operation)ite2.next();
            Collection<Fault> faults = CastUtils.cast(operation.getFaults().values());
            if (CollectionUtils.isEmpty(faults)) {
                continue;
            }

            for (Fault fault : faults) {
                Message message = fault.getMessage();
                Collection<Part> parts = CastUtils.cast(message.getParts().values());
                for (Part part : parts) {
                    if (part.getElementName() == null) {
                        addErrorMessage(getErrorPrefix("WSI-BP-1.0 R2205") + "In Message "
                            + message.getQName() + ", part " + part.getName()
                                + " must specify a 'element' attribute");
                        return false;
                    }
                }
            }
        }
    }
    return true;
}