Package org.apache.wsif

Examples of org.apache.wsif.WSIFMessage


    private Object invokeOperation( WSIFPort port, String name, Object partVal ) throws Exception
    {
        Object result = null;
        WSIFOperation operation = port.createOperation( name );

        WSIFMessage inputMessage = operation.createInputMessage();
        WSIFMessage outputMessage = operation.createOutputMessage();
        WSIFMessage faultMessage = operation.createFaultMessage();
        inputMessage.setObjectPart( "dummy", partVal );

        assertTrue( operation.executeRequestResponseOperation( inputMessage, outputMessage, faultMessage ) );

        result = outputMessage.getObjectPart( "return" );
View Full Code Here


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

            assertNotNull( operation );

            // create the input message associated with this operation
            WSIFMessage input = operation.createInputMessage();

            // populate the input message
            input.setObjectPart( "firstName", "John" );
            input.setObjectPart( "lastName", "Smith" );

            // create an address object to populate the input
            Address address = new Address();
            address.setStreetNum( 20 );
            address.setStreetName( "Peachtree Avenue" );
            address.setCity( "Atlanta" );
            address.setState( "GA" );
            address.setZip( 39892 );
            Phone phone = new Phone();
            phone.setAreaCode( 701 );
            phone.setExchange( "555" );
            phone.setNumber( "8721" );
            address.setPhoneNumber( phone );

            input.setObjectPart( "address", address );

            // do the invocation
            System.out.println( "Adding address for John Smith..." );
            operation.executeInputOnlyOperation( input );
View Full Code Here

            WSIFOperation operation = port.createOperation( "getAddressFromName" );

            assertNotNull( operation );

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

            // populate the input message
            input.setObjectPart( "name", "John Smith" );

            // do the invocation
View Full Code Here

                    "addEntry",
                    "AddEntryWholeNameRequest",
                    null);
                   
            // create the input message associated with this operation
            WSIFMessage input = operation.createInputMessage();

            // populate the input message
            input.setObjectPart("name", "John Smith");

            // create an address object to populate the input
            Address address = new Address();
            address.setStreetNum(25);
            address.setStreetName("Willow Road");
            address.setCity("MyTown");
            address.setState("PA");
            address.setZip(28382);
            Phone phone = new Phone();
            phone.setAreaCode(288);
            phone.setExchange("555");
            phone.setNumber("9891");
            address.setPhoneNumber(phone);

            input.setObjectPart("address", address);

            // do the invocation
            System.out.println("Adding address for John Smith...");
            operation.executeInputOnlyOperation(input);
View Full Code Here

                    "addEntry",
                    "AddEntryFirstAndLastNamesRequest",
                    null);

            // create the input message associated with this operation
            WSIFMessage input = operation.createInputMessage();

            // populate the input message
            input.setObjectPart("firstName", "Jane");
            input.setObjectPart("lastName", "White");

            // create an address object to populate the input
            Address address = new Address();
            address.setStreetNum(20);
            address.setStreetName("Peachtree Avenue");
            address.setCity("Atlanta");
            address.setState("GA");
            address.setZip(39892);
            Phone phone = new Phone();
            phone.setAreaCode(701);
            phone.setExchange("555");
            phone.setNumber("8721");
            address.setPhoneNumber(phone);

            input.setObjectPart("address", address);

            // do the invocation
            System.out.println("Adding address for Jane White...");
            operation.executeInputOnlyOperation(input);
View Full Code Here

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

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

            // populate the input message
            input.setObjectPart("name", "John Smith");

            // do the invocation
View Full Code Here

    //-------------------------------------------------------------------------
    protected void process(MessageExchange exchange, NormalizedMessage normalizedMessage) throws MessagingException {
        try {
            WSIFOperationInfo operationInfo = operationMap.getOperationForExchange(exchange);
            WSIFOperation operation = operationInfo.getWsifOperation();
            WSIFMessage message = operation.createInputMessage();
            marshaler.fromNMS(operationInfo, message, normalizedMessage, getBody(normalizedMessage));
            operation.executeInputOnlyOperation(message);
            done(exchange);
        }
        catch (WSIFException e) {
View Full Code Here

    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 {
View Full Code Here

  public void fireAsyncResponse(Object response) throws WSIFException {
    Trc.entry(this, response);

    // use processAsyncResponse
    // **NS
    WSIFMessage output = createOutputMessage();
    WSIFMessage fault = createFaultMessage();

    receiveJmsMessage(response, output, fault);

    handler.executeAsyncResponse(output, fault);
    Trc.exit();
View Full Code Here

    // name is in the jms:input list. Parts defined in the
    // WSDL but not in the input message defualt to null.
    String partName;
    ArrayList wsdlInputParts = getWSDLInputPartNames();
    HashMap propertyParts = getPropertyParts();
    WSIFMessage message = createInputMessage();
    for (Iterator i = input.getPartNames(); i.hasNext();) {
      partName = (String) i.next();
      if (propertyParts.containsKey(partName)) {
        String name = (String) propertyParts.get(partName);
        Object value = input.getObjectPart(partName);
        if (!timeoutProperty(name, value)) {
          jmsDest.setProperty(name, value);
        }
      } else if (wsdlInputParts.contains(partName)) {
        wsdlInputParts.remove(partName);
        if (fieldInput == null) {
          message.setObjectPart(
            partName,
            input.getObjectPart(partName));
        } else if (fieldInput.getParts().contains(partName)) {
          message.setObjectPart(
            partName,
            input.getObjectPart(partName));
        }
      }
    }

    // default missing parts to null
    for (Iterator i = wsdlInputParts.iterator(); i.hasNext();) {
      message.setObjectPart((String) i.next(), null);
    }

    // properties from the context
    setDestinationContext();
View Full Code Here

TOP

Related Classes of org.apache.wsif.WSIFMessage

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.