Package org.apache.wsif

Examples of org.apache.wsif.WSIFOperation


    //-------------------------------------------------------------------------
    protected boolean transform(MessageExchange exchange, NormalizedMessage in, NormalizedMessage out) throws MessagingException {
        try {
            WSIFOperationInfo operationInfo = operationMap.getOperationForExchange(exchange);

            WSIFOperation operation = operationInfo.getWsifOperation();
            WSIFMessage inMessage = operation.createInputMessage();
            Object body = getBody(in);
            marshaler.fromNMS(operationInfo, inMessage, in, body);

            WSIFMessage outMessage = operation.createInputMessage();
            WSIFMessage faultMessage = operation.createInputMessage();
            boolean answer = operation.executeRequestResponseOperation(inMessage, outMessage, faultMessage);
            if (answer) {
                marshaler.toNMS(exchange, out, operationInfo, outMessage);
            }
            else {
                Fault fault = exchange.createFault();
View Full Code Here


    }

    public WSIFOperation createOperation(String operationName)
        throws WSIFException {
        Trc.entry(this, operationName);
        WSIFOperation wo = createOperation(operationName, null, null);
        Trc.exit(wo);
        return wo;
    }
View Full Code Here

                    + ":"
                    + inputName
                    + ":"
                    + outputName);
        }
        WSIFOperation wo = op.copy();
        Trc.exit(wo);
        return wo;
    }
View Full Code Here

    }

    public WSIFOperation createOperation(String operationName)
        throws WSIFException {
        Trc.entry(this);
        WSIFOperation wo = createOperation(operationName, null, null);
        Trc.exit(wo);
        return wo;
    }
View Full Code Here

                    + ":"
                    + inputName
                    + ":"
                    + outputName);
        }
        WSIFOperation wo = op.copy();
        Trc.exit(wo);
        return wo;
    }
View Full Code Here

     * @see WSIFPort#createOperation(String)
     */
    public WSIFOperation createOperation(String operationName)
        throws WSIFException {
        Trc.entry(this, operationName);
        WSIFOperation wo = createOperation(operationName, null, null);
        Trc.exit(wo);
        return wo;
    }
View Full Code Here

                    + ":"
                    + inputName
                    + ":"
                    + outputName);
        }
        WSIFOperation wo = op.copy();
        Trc.exit(wo);
        return wo;
    }
View Full Code Here

        String inputName = (input == null) ? null : input.getName();
        String outputName = (output == null) ? null : output.getName();
        Message inputMessage = (input == null) ? null : input.getMessage();
        Message outputMessage = (output == null) ? null : output.getMessage();

        WSIFOperation wsifOperation =
            wsifport.createOperation(method.getName(), inputName, outputName);

        // make the msg names for compiled msgs xxxAnt ask Mark why diff from inputName
        String inputMsgName = "";
        if (input != null) {
            Message m = input.getMessage();
            if (m != null) {
                QName qn = m.getQName();
                inputMsgName = (qn == null) ? "" : qn.getLocalPart();
            }
        }

        String outputMsgName = "";
        if (output != null) {
            Message m = output.getMessage();
            if (m != null) {
                QName qn = m.getQName();
                outputMsgName = (qn == null) ? "" : qn.getLocalPart();
            }
        }

        // There must be an inputMessage.
        WSIFMessage wsifInputMessage =
            wsifOperation.createInputMessage(inputMsgName);

        // There may not be an output message.
        WSIFMessage wsifOutputMessage = null;
        WSIFMessage wsifFaultMessage = null;
        if (output != null) {
            wsifOutputMessage = wsifOperation.createOutputMessage(inputMsgName);
            wsifFaultMessage = wsifOperation.createFaultMessage(inputMsgName);
        }

        List inputParts = (inputMessage == null)
           ? new ArrayList()
           : inputMessage.getOrderedParts(null);
        if (args != null) {
          if (inputParts.size() != args.length) {
                unWrapIfWrappedDocLit(inputParts, operation.getName());
            }
            Iterator partIt = inputParts.iterator();
            for (int argIndex = 0; partIt.hasNext(); argIndex++) {
                Part part = (Part) partIt.next();
                String partName;
                if (isWrappedInContext()) {
                    QName qn = part.getElementName();
                    partName = (qn == null) ? "" : qn.getLocalPart();
                } else {
                    partName = part.getName();
                }
                wsifInputMessage.setObjectPart(partName, args[argIndex]);
            }
        }

        if (output == null)
            wsifOperation.executeInputOnlyOperation(wsifInputMessage);
        else {
            boolean success =
                wsifOperation.executeRequestResponseOperation(
                    wsifInputMessage,
                    wsifOutputMessage,
                    wsifFaultMessage);
            if (!success) {
                StringBuffer sb = new StringBuffer();
View Full Code Here

    try {
      WSIFService portFactory = WSIFServiceFactory.newInstance().getService(serviceDefintion, importService, importPortType);

      WSIFPort port = portFactory.getPort();

      WSIFOperation operation = port.createOperation(GET_PORTTYPES_OPERATION);
      WSIFMessage inputMessage = operation.createInputMessage();
      WSIFMessage outputMessage = operation.createOutputMessage();
      inputMessage.setObjectPart(QUERY_STRING_PART, queryString);

      operation.executeRequestResponseOperation(inputMessage, outputMessage, null);

      PortTypeArray portTypeArray = (PortTypeArray) outputMessage.getObjectPart(RESULT_PART);

      port.close();
      return portTypeArray;
View Full Code Here

  public ImportDefinition getDefinition(PortTypeSelection portTypeSelection) throws WSIFException {
    try {
      WSIFService portFactory = WSIFServiceFactory.newInstance().getService(serviceDefintion, importService, importPortType);
      WSIFPort port = portFactory.getPort();

      WSIFOperation operation = port.createOperation(GET_DEFINITION_OPERATION);
      WSIFMessage inputMessage = operation.createInputMessage();
      WSIFMessage outputMessage = operation.createOutputMessage();

      inputMessage.setObjectPart(PORT_TYPE_SELECTION_PART, portTypeSelection);

      operation.executeRequestResponseOperation(inputMessage, outputMessage, null);

      ImportDefinition importDefinition = (ImportDefinition) outputMessage.getObjectPart(RESULT_PART);
      port.close();

      return importDefinition;
View Full Code Here

TOP

Related Classes of org.apache.wsif.WSIFOperation

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.