Package org.apache.wsif

Examples of org.apache.wsif.WSIFMessage


     * Gets the context information for this WSIFService.
     * @return context
     */
    public WSIFMessage getContext() throws WSIFException {
        Trc.entry(this);
      WSIFMessage contextCopy;
      if (this.context == null) {
        contextCopy = new WSIFDefaultMessage();
      } else {
        try {
          contextCopy = (WSIFMessage) this.context.clone();
View Full Code Here


            port = service.getPort(portName);

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

            WSIFMessage inputMessage = operation.createInputMessage();
            WSIFMessage outputMessage = operation.createOutputMessage();
            WSIFMessage faultMessage = operation.createFaultMessage();

            // Create a name and address to add to the addressbook
            String nameToAdd = "Chris P. Bacon";
            Address addressToAdd =
                new Address(
View Full Code Here

            WSIFOperation op = port.createOperation( "getAddressFromName" );
           
            AsyncResponseHandler abHandler = new AsyncResponseHandler( 1 ); // 1 async call

            WSIFMessage inMsg = op.createInputMessage();
            inMsg.setObjectPart( "name", name );

            WSIFMessage outmsg = op.createOutputMessage();
            WSIFMessage faultMsg = op.createFaultMessage();

            WSIFMessage context = op.getContext();
            context.setObjectPart( WSIFConstants.CONTEXT_JMS_PREFIX + "JMSReplyTo",
                                   TestUtilities.getWsifProperty("wsif.async.replytoq") );
            op.setContext( context );

            WSIFCorrelationId id = op.executeRequestResponseAsync(inMsg, abHandler);
            assertTrue("null correlation id returned from async request!", id != null );
View Full Code Here

   */
  public void doitStockquote(String portName, String protocol, String fakeFile, String error) {
    float value;
    WSIFPort port;
    WSIFOperation operation;
    WSIFMessage input, output, fault, context;

    if (portName.toUpperCase().indexOf("JMS") != -1
        && !TestUtilities.areWeTesting("jms")) {
        return;
    }

    TestUtilities.setProviderForProtocol( protocol );

    System.out.println("\n=== StockQuote");
    try {
      WSIFServiceFactory factory = WSIFServiceFactory.newInstance();
        WSIFService service = factory.getService( WSDL_LOCATION,
          null, // serviceNS
        null, // serviceName
            "http://wsifservice.stockquote/", // portTypeNS
        "StockquotePT" ); // portTypeName

      port = service.getPort(portName);

      // Executing executeRequestResponseAsync(input)
      operation = port.createOperation( "getQuote" );

      context = operation.getContext();
      context.setObjectPart(
         WSIFConstants.CONTEXT_JMS_PREFIX + "WSIF_FAKE",
         "\"" + fakeFile + "\"" );

      input = operation.createInputMessage();
      input.setName("GetQuoteInput");
      input.setObjectPart("symbol", "" );
      output = operation.createOutputMessage();

      //output = doAsyncOpNoHandler( operation, input, context );
      doSyncOp( operation, input, output, context );
     
View Full Code Here

                         WSIFMessage input,
                         WSIFMessage output,
                         WSIFMessage context) throws WSIFException {
      //try {
         op.setContext( context );
         WSIFMessage fault = op.createFaultMessage();
         boolean ok = op.executeRequestResponseOperation(input, output, fault );
         assertTrue( "executeRequestResponseOperation returned false!", ok );
      //} catch (Exception ex) {
      //    ex.printStackTrace();
      //   assertTrue( "exception executing request: " + ex.getMessage(), false );
View Full Code Here

      return handler.getOutputs()[0];
  }

  private WSIFMessage doAsyncOpNoHandler(WSIFOperation op, WSIFMessage input, WSIFMessage context)
                                                              throws WSIFException, JMSException  {
      WSIFMessage output = null;

         context.setObjectPart( WSIFConstants.CONTEXT_JMS_PREFIX + "JMSReplyTo",
                                TestUtilities.getWsifProperty("wsif.async.replytoq2") );
         context.setObjectPart( "testJMSnoHandler", "true" );
         op.setContext( context );
         WSIFCorrelationId id = op.executeRequestResponseAsync( input );
         System.out.println( "async operation done, correlation id=" + id.getCorrelationId() );
         op = null;
        
        Object jmsResponse =
            TestUtilities.getJMSAsyncResponse(
                id.getCorrelationId(),
                TestUtilities.getWsifProperty("wsif.async.replytoq2"));
        
         WSIFCorrelationService cs =
            WSIFCorrelationServiceLocator.getCorrelationService();
         Object o;
         synchronized( cs ) {
            o = cs.get( id );
         }
         if ( o != null && o instanceof WSIFOperation ) {     
            cs.remove( id );
            op = (WSIFOperation)o;
         } else {
           assertTrue( "stored correlation object not as expected: " + o, false );
         }
         output = op.createOutputMessage();
         WSIFMessage fault = op.createFaultMessage();
         op.processAsyncResponse( jmsResponse, output, fault );

      return output;
  }
View Full Code Here

                Class.forName("addressbook.wsiftypes.Phone"));                   
            WSIFPort port = service.getPort(server+"Port");
            WSIFOperation op = port.createOperation("addEntry", "AddEntryWholeNameRequest", null);           
            doItPort(port, "WSIFPort_ApacheSOAP");
            WSIFOperation op2 = port.createOperation("addEntry", "AddEntryWholeNameRequest", null);
            WSIFMessage inputMessage = op2.createInputMessage();
            WSIFMessage outputMessage = op2.createOutputMessage();
            WSIFMessage faultMessage = op2.createFaultMessage();

            // Create a name and address to add to the addressbook
            String nameToAdd = "Chris P. Bacon";
            Address addressToAdd =
                new Address(
View Full Code Here

                    "ShoppingCart_JavaService",
                    "http://www.shoppingcart.com/definitions/ShoppingCartInterface",
                    "ShoppingCart_JavaPortType");
            WSIFPort port = service.getPort();
            WSIFOperation op = port.createOperation("addItemOperation");
            WSIFMessage message = op.createInputMessage();
            message.setObjectPart("testPart1", "test1");           
//            message.setObjectPart("testPart2", new StringTokenizer("test2"));           
            doItMessage(message);         
        } catch (Exception e) {
            System.out.println(
                "\nAn error occured when running testWSIFPort_Java " + e);              
View Full Code Here

        }
    }

    private void doItMessage(WSIFMessage message) {
        try {
            WSIFMessage m2 = (WSIFMessage) writeItReadIt(message);
            assertNotNull(m2);
            System.out.println("\n WSIFMessage was serialized and deserialized without problem");
        } catch (Exception e) {
            System.out.println("\nError testing message:- " + e);
            System.out.println("The full stack trace is:");
View Full Code Here

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

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

        boolean b =
            operation.executeRequestResponseOperation(
                inputMessage,
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.