Package javax.wsdl

Examples of javax.wsdl.Fault


    public List<DataType> getFaultTypes() throws InvalidWSDLException {
        if (faultTypes == null) {
            Collection faults = operation.getFaults().values();
            faultTypes = new ArrayList<DataType>();
            for (Object f : faults) {
                Fault fault = (Fault)f;
                Message faultMsg = fault.getMessage();
                List faultParts = faultMsg.getOrderedParts(null);
                if (faultParts.size() != 1) {
                    throw new InvalidWSDLException("The fault message MUST have a single part");
                }
                Part part = (Part)faultParts.get(0);
View Full Code Here


    }

    int count = 1 ;
    if (faultMessages != null) {
      for (Message message : faultMessages) {
        Fault fault = def.createFault();
        fault.setMessage(message);
        fault.setName("fault" + (count++));
        op.addFault(fault);
      }
    }
    portType.addOperation(op);
    portType.setUndefined(false);
View Full Code Here

    }
    final Map faults = op.getFaults() ;
    if (faults != null) {
      Iterator iterator = op.getFaults().values().iterator();
      while (iterator.hasNext()) {
        Fault fault = (Fault) iterator.next();
        BindingFault bfault = def.createBindingFault();
        bfault.setName(fault.getName());
        bop.addBindingFault(bfault);
        SOAPFaultImpl soapFault = new SOAPFaultImpl();
        soapFault.setName(fault.getName());
        soapFault.setUse("literal");
        bfault.addExtensibilityElement(soapFault);
      }
    }
    binding.addBindingOperation(bop);
View Full Code Here

                Object faultPart = invocationFault;
                // Should we use the class of the method signature here ?
                fault.setObjectPart(faultMessageInfo.fieldPartName, faultPart);
                fault.setName(faultMessageInfo.fieldMessageName);
                if (faultMessageInfo.fieldMessageName != null) {
                  Fault wsdlFault = fieldBindingOperationModel.getOperation().getFault(faultMessageInfo.fieldMessageName);
                  if (wsdlFault != null) {
                      fault.setMessageDefinition(wsdlFault.getMessage());
                  }
                }
                operationSucceeded = false;
            } else {
                // Try to find a matching class:
                Class invocationFaultClass = invocationFault.getClass();
                Class tempClass = null;
                Iterator it = faultMessageInfos.values().iterator();
                boolean found = false;
                while (it.hasNext()) {
                    faultMessageInfo = (FaultMessageInfo) it.next();
                    try {
                        tempClass =
                            Class.forName(
                                faultMessageInfo.fieldFormatType,
                                true,
                                Thread.currentThread().getContextClassLoader());
                        if (tempClass.isAssignableFrom(invocationFaultClass)) {
                            found = true;
                            Object faultPart = invocationFault;
                            // Should we use the class of the method signature here ?
                            fault.setObjectPart(faultMessageInfo.fieldPartName, faultPart);
                            fault.setName(faultMessageInfo.fieldMessageName);
                            if (faultMessageInfo.fieldMessageName != null) {
                              Fault wsdlFault = fieldBindingOperationModel.getOperation().getFault(faultMessageInfo.fieldMessageName);
                              if (wsdlFault != null) {
                                fault.setMessageDefinition(wsdlFault.getMessage());
                              }
                            }
                            operationSucceeded = false;
                        }
                    } catch (Exception exc) { // Nothing to do - just try the next one...
View Full Code Here

        BindingFault bndF)
        throws WSIFException {
        Trc.entry(this, out, binding, bop, bndFName, bndF);

        Operation op = bop.getOperation();
        Fault fault = op.getFault(bndFName);
        if (fault == null)
            throw new WSIFException(
                "No fault "
                    + bndFName
                    + " found in operation "
                    + op.getName());

        JMSMessage fhMsg =
            new JMSMessage(
                fieldDefinition,
                binding,
                fault.getMessage(),
                getFaultParts(bndF));

        fhMsg.read(out);
        Trc.exit(fhMsg);
        return fhMsg;
View Full Code Here

                Object faultPart = invocationFault;
                // Should we use the class of the method signature here ?
                fault.setObjectPart(faultMessageInfo.fieldPartName, faultPart);
                fault.setName(faultMessageInfo.fieldMessageName);
                if (faultMessageInfo.fieldMessageName != null) {
                  Fault wsdlFault = fieldBindingOperationModel.getOperation().getFault(faultMessageInfo.fieldMessageName);
                  if (wsdlFault != null) {
                      fault.setMessageDefinition(wsdlFault.getMessage());
                  }
                }
                operationSucceeded = false;
            } else {
                // Try to find a matching class:
                Class invocationFaultClass = invocationFault.getClass();
                Class tempClass = null;
                Iterator it = faultMessageInfos.values().iterator();
                boolean found = false;
                while (it.hasNext()) {
                    faultMessageInfo = (FaultMessageInfo) it.next();
                    try {
                        tempClass =
                            Class.forName(
                                faultMessageInfo.fieldFormatType,
                                true,
                                Thread.currentThread().getContextClassLoader());
                        if (tempClass.isAssignableFrom(invocationFaultClass)) {
                            found = true;
                            Object faultPart = invocationFault;
                            // Should we use the class of the method signature here ?
                            fault.setObjectPart(
                                faultMessageInfo.fieldPartName,
                                faultPart);
                            fault.setName(faultMessageInfo.fieldMessageName);
                            if (faultMessageInfo.fieldMessageName != null) {
                              Fault wsdlFault = fieldBindingOperationModel.getOperation().getFault(faultMessageInfo.fieldMessageName);
                              if (wsdlFault != null) {
                                fault.setMessageDefinition(wsdlFault.getMessage());
                              }
                            }
                            operationSucceeded = false;
                        }
                    } catch (Exception exc) {
View Full Code Here

  private void addFaultInfo(Map faults,MethodInfo methodinfo)throws WrapperFault{
    if(faults == null)
      return;
    Iterator faultIt = faults.values().iterator();
    while(faultIt.hasNext()){
      Fault fault = (Fault)faultIt.next();
      FaultInfo faultinfo = new FaultInfo(fault.getName());
      Map parts = fault.getMessage().getParts();
      Iterator partIt = parts.values().iterator();
      while(partIt.hasNext()){
        faultinfo.addParam(createParameterInfo((Part)partIt.next()));
      }       
    }  
View Full Code Here

                        vNodes.add(vOutMsgNode);
                        messageRefNames.add(outMsg.getQName());
                    }
                }
                for (Iterator iter = operation.getFaults().values().iterator(); iter.hasNext();) {
                    Fault fault = (Fault) iter.next();
                    javax.wsdl.Message faultMsg = fault.getMessage();
                    XNode vFaultMsgNode = getXNode(faultMsg);
                    vFaultMsgNode.setFailurePoint(getFaultXNode(vOperationNode, fault.getName()));
                    vNodes.add(vFaultMsgNode);
                    messageRefNames.add(faultMsg.getQName());
                }
            }
        }
View Full Code Here

                    output.setMessage(message);
                    operation.setOutput(output);
                }
                //loop to add fault
                Collection<FaultInfo> faults = operationInfo.getFaults();
                Fault fault = null;
                for (FaultInfo faultInfo : faults) {
                    fault = def.createFault();
                    fault.setName(faultInfo.getFaultName().getLocalPart());
                    message = def.createMessage();
                    buildMessage(message, faultInfo, def);
                    this.addExtensibilityAttributes(fault, faultInfo.getExtensionAttributes());
                    fault.setMessage(message);
                    operation.addFault(fault);
                }
            }
            portType.addOperation(operation);
        }
View Full Code Here

            // part.setElementName(element.getQName());
            part.setElementName(new QName(definition.getTargetNamespace(), exceptionName));
            faultMsg.addPart(part);

            // porttype - operation - fault
            Fault fault = definition.createFault();
            fault.setMessage(faultMsg);
            fault.setName(faultMsg.getQName().getLocalPart());
            operation.addFault(fault);

            // binding - operation - corba:operation - corba:raises
            RaisesType raisesType = new RaisesType();
            raisesType.setException(new QName(typesVisitor.getCorbaTypeMapping().getTargetNamespace(),
View Full Code Here

TOP

Related Classes of javax.wsdl.Fault

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.