Package org.apache.wsif

Examples of org.apache.wsif.WSIFOperation


     */
    private void soap_body_parts1(WSIFService service, Mime stub)
        throws Exception {
        DataHandler dh = new DataHandler(new FileDataSource(flatfileLocation));
        WSIFPort port = service.getPort(portName);
        WSIFOperation op = port.createOperation("soapBodyParts1");
        WSIFMessage in = op.createInputMessage();
        WSIFMessage out = op.createOutputMessage();
        WSIFMessage fault = op.createFaultMessage();
        in.setBooleanPart("shouldBounce",true);
        in.setObjectPart("file",dh);

        boolean success = op.executeRequestResponseOperation(in,out,fault);
        assertTrue(success);

        String s = (String)(out.getObjectPart("buff"));
        assertTrue("1".equals(s));
    }
View Full Code Here


        // get the port
        WSIFPort port = service.getPort();

        // create the operation
        WSIFOperation operation = port.createOperation("GetLatLong");

        // create the input, output and fault messages associated with this operation
        WSIFMessage input = operation.createInputMessage();
        WSIFMessage output = operation.createOutputMessage();
        WSIFMessage fault = operation.createFaultMessage();

        // populate the input message
        input.setObjectPart("zipcode", args[1]);
        input.setObjectPart("LicenseKey", "");

        // do the invocation
        if (operation.executeRequestResponseOperation(input, output, fault)) {
            // invocation succeeded, extract information from output
            // message
            LatLongReturn zipInfo =
                (LatLongReturn) output.getObjectPart("GetLatLongResult");
            System.out.println(
View Full Code Here

    private void soap_body_parts2(WSIFService service, Mime stub)
        throws Exception {
        DataHandler dh = new DataHandler(new FileDataSource(flatfileLocation));
        WSIFPort port = service.getPort(portName);
        WSIFOperation op = port.createOperation("soapBodyParts2");
        WSIFMessage in = op.createInputMessage();
        WSIFMessage out = op.createOutputMessage();
        WSIFMessage fault = op.createFaultMessage();
        in.setObjectPart("file",dh);

        boolean success = op.executeRequestResponseOperation(in,out,fault);
        assertTrue(success);

        String s = (String)(out.getObjectPart("buff"));
        assertTrue("2".equals(s));
    }
View Full Code Here

    public java.lang.String echoString(java.lang.String argInputString)
        throws WSIFException {

        WSIFPort port = this.svc.getPort();

        WSIFOperation operation = port.createOperation("echoString", null, null);

        WSIFMessage inputMessage = operation.createInputMessage();

        WSIFMessage outputMessage = operation.createOutputMessage();

        inputMessage.setObjectPart("inputString", argInputString);

        operation.executeRequestResponseOperation(inputMessage, outputMessage, null);

        port.close();

        return (java.lang.String) outputMessage.getObjectPart("return");
View Full Code Here

    }

    private void soap_body_parts3(WSIFService service, Mime stub)
        throws Exception {
        WSIFPort port = service.getPort(portName);
        WSIFOperation op = port.createOperation("soapBodyParts3");
        WSIFMessage in = op.createInputMessage();
        WSIFMessage out = op.createOutputMessage();
        WSIFMessage fault = op.createFaultMessage();
        in.setBooleanPart("shouldBounce",true);

        boolean success = op.executeRequestResponseOperation(in,out,fault);
        assertTrue(success);

        String s = (String)(out.getObjectPart("buff"));
        assertTrue("3".equals(s));
    }
View Full Code Here

        java.lang.String[] argInputStringArray)
        throws WSIFException {

        WSIFPort port = this.svc.getPort();

        WSIFOperation operation =
            port.createOperation(
                "echoStringArray",
                "echoStringArrayRequest",
                "echoStringArrayResponse");

        WSIFMessage inputMessage = operation.createInputMessage();
        inputMessage.setName("echoStringArrayRequest");

        WSIFMessage outputMessage = operation.createOutputMessage();
        outputMessage.setName("echoStringArrayResponse");

        inputMessage.setObjectPart("inputStringArray", argInputStringArray);

        operation.executeRequestResponseOperation(inputMessage, outputMessage, null);

        port.close();

        return (java.lang.String[]) outputMessage.getObjectPart("return");
View Full Code Here

        WSIFService service = factory.getService(wsdlUrl, null, null,endpoint, null);

        WSIFPort port = service.getPort();

        WSIFOperation operation = port.createOperation(getOperationName());

        WSIFMessage input = operation.createInputMessage();
        WSIFMessage output = operation.createOutputMessage();
        WSIFMessage fault = operation.createFaultMessage();

        Message me = input.getMessageDefinition();
        Map partList = me.getParts();
        Set set = partList.keySet();

        int i = 0;
        for (Iterator iter = set.iterator(); iter.hasNext(); i++) {
          String partName = (String) iter.next();
          input.setObjectPart(partName, actualParameters[i]);
        }

        if (operation.executeRequestResponseOperation(input, output,fault)) {

          String partName = (String) output.getPartNames().next();
          Object result = output.getObjectPart(partName);

          ProcessVariable outputVar = getOutput();
View Full Code Here

    // Implementation methods
    //-------------------------------------------------------------------------
    protected void process(MessageExchange exchange, NormalizedMessage normalizedMessage) throws Exception {
        WSIFOperationInfo operationInfo = operationMap.getOperationForExchange(exchange);
        WSIFOperation operation = operationInfo.createWsifOperation();
        WSIFMessage message = operation.createInputMessage();
        marshaler.fromNMS(operationInfo, message, normalizedMessage, getBody(normalizedMessage));
        operation.executeInputOnlyOperation(message);
        done(exchange);
    }
View Full Code Here

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

            WSIFOperation operation = operationInfo.createWsifOperation();
            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

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

            WSIFOperation operation = operationInfo.createWsifOperation();
            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

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.