Examples of WSIFPort


Examples of org.apache.wsif.WSIFPort

          null, // serviceNS
        null, // serviceName
            "http://wsifservice.stockquote/", // portTypeNS
        portType); // portTypeName

      WSIFPort port = service.getPort(portName);

      // Executing synchronous executeRequestResponseOperation(input, output, fault )
      WSIFOperation operation = port.createOperation(operationName);

      WSIFMessage context = operation.getContext();
      context.setObjectPart( WSIFConstants.CONTEXT_JMS_PREFIX + "JMSReplyTo",
                             TestUtilities.getWsifProperty("wsif.nativejms.responseq") );
      operation.setContext( context );

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

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

      doSyncOp( operation, input, output, context );
      float value = ((Float)output.getObjectPart( "quote" )).floatValue();
      System.out.println("sync stockquote found value = " + value);
      assertTrue( "doSyncOp stockquote value incorrect!",
                  value == -1.0F );

      // Executing executeRequestResponseAsync(input, handler)
      operation = port.createOperation(operationName);

      operation.setContext( context );

      input = operation.createInputMessage();
      input.setName("GetQuoteInput");
      input.setObjectPart("symbol", "" );
     
      output = doAsyncOp( operation, input, context );
      value = ((Float)output.getObjectPart( "quote" )).floatValue();
      System.out.println("async stockquote found value = " + value);
      assertTrue( "doAsyncOp stockquote value incorrect!",
                  value == -1.0F );

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

      operation.setContext( context );

      input = operation.createInputMessage();
      input.setName("GetQuoteInput");
View Full Code Here

Examples of org.apache.wsif.WSIFPort

      service.mapType(
         new javax.xml.namespace.QName("http://wsiftypes.addressbook/", "phone"),
         Class.forName("addressbook.wsiftypes.Phone"));

      WSIFPort port = service.getPort(portName);

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

      WSIFMessage input = operation.createInputMessage();
      input.setObjectPart("name", name1);
      input.setObjectPart("address", addr1);
View Full Code Here

Examples of org.apache.wsif.WSIFPort

      service.mapType(
         new javax.xml.namespace.QName("http://wsiftypes.addressbook/", "phone"),
         Class.forName("addressbook.wsiftypes.Phone"));

      WSIFPort port = service.getPort(portName);

      // Executing synchronous executeRequestResponseOperation(input, output, fault )
      String inputMsgName = "GetAddressFromNameRequest";
      String outputMsgName = "GetAddressFromNameResponse";
      WSIFOperation operation =
        port.createOperation(operationName, inputMsgName, outputMsgName);

      WSIFMessage context = operation.getContext();
      context.setObjectPart( WSIFConstants.CONTEXT_JMS_PREFIX + "JMSReplyTo",
                             TestUtilities.getWsifProperty("wsif.nativejms.responseq") );
      operation.setContext( context );
   
      WSIFMessage input = operation.createInputMessage();
      input.setObjectPart("name", name1);

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

      doSyncOp( operation, input, output, context );
     
      Address addressResponse = (Address) output.getObjectPart("address");
      System.out.println("Found address = " + addressResponse);
      assertTrue( "doSyncOp addresses not equal!", addr1.equals(addressResponse) );

      // Executing executeRequestResponseOperation(input, output, fault )
      operation =
        port.createOperation(operationName, inputMsgName, outputMsgName);

      operation.setContext( context );
   
      input = operation.createInputMessage();
      input.setObjectPart("name", name1);

      output = operation.createOutputMessage();

      output = doAsyncOp( operation, input, context );
     
      addressResponse = (Address) output.getObjectPart("address");
      System.out.println("Found address = " + addressResponse);
      assertTrue( "doAsyncOp addresses not equal!", addr1.equals(addressResponse) );

      // Executing executeRequestResponseAsync(input)
      operation =
        port.createOperation(operationName, inputMsgName, outputMsgName);

      operation.setContext( context );
   
      input = operation.createInputMessage();
      input.setObjectPart("name", name1);
View Full Code Here

Examples of org.apache.wsif.WSIFPort

     */
    private void bounce_image2(WSIFService service, Mime stub, String portName)
        throws Exception {
        DataHandler dh1 = new DataHandler(new FileDataSource(imageLocation));

        WSIFPort port = service.getPort(portName);
        WSIFOperation op = port.createOperation("bounceImage2");
        WSIFMessage in = op.createInputMessage();
        WSIFMessage out = op.createOutputMessage();
        WSIFMessage fault = op.createFaultMessage();
        in.setObjectPart("file",dh1);

View Full Code Here

Examples of org.apache.wsif.WSIFPort

     * and so would not be able to find this signature in the portType.
     */
    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);
View Full Code Here

Examples of org.apache.wsif.WSIFPort

    }

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

Examples of org.apache.wsif.WSIFPort

        assertTrue("2".equals(s));
    }

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

Examples of org.apache.wsif.WSIFPort

        assertTrue("3".equals(s));
    }

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

        boolean success = op.executeRequestResponseOperation(in,out,fault);
View Full Code Here

Examples of org.apache.wsif.WSIFPort

            new DataHandler(new FileDataSource(flatfileLocation2));
        String position1 = "Position One";
        String position2 = "Position Two";
        String position3 = "Position Three";

        WSIFPort port = service.getPort(portName);
        WSIFOperation op = port.createOperation("mixMimeParts");
        WSIFMessage in = op.createInputMessage();
        WSIFMessage out = op.createOutputMessage();
        WSIFMessage fault = op.createFaultMessage();
        in.setObjectPart("position1", position1);
        in.setObjectPart("file1", dh1);
View Full Code Here

Examples of org.apache.wsif.WSIFPort

        Service service = WSIFUtils.selectService(def, serviceNS, serviceName);
        PortType portType = WSIFUtils.selectPortType(def, portTypeNS, portTypeName);

        WSIFServiceFactory factory = WSIFServiceFactory.newInstance();
        WSIFService dpf = factory.getService(def, service, portType);
        WSIFPort port = (portName == null) ? dpf.getPort() : dpf.getPort(portName);

        System.out.println("HeadersTest executing getQuote for \"\"" + operationName);
        WSIFOperation operation =
            port.createOperation("getQuote", inputName, outputName);
        WSIFMessage input = operation.createInputMessage();
        WSIFMessage output = operation.createOutputMessage();
        WSIFMessage fault = operation.createFaultMessage();
        input.setObjectPart("symbol", "");

        // set a basic authentication header
        WSIFMessage headers = operation.getContext();
        headers.setObjectPart(WSIFConstants.CONTEXT_HTTP_USER, "petra");
        headers.setObjectPart(WSIFConstants.CONTEXT_HTTP_PSWD, "washere");
        operation.setContext(headers);

        boolean ok = operation.executeRequestResponseOperation(input, output, fault);
        System.out.println("operation returned " + ok);

        float q = ((Float) output.getObjectPart("quote")).floatValue();

        if (q == -1.0F) {
            assertTrue(true);
        } else {
            assertTrue(false);
        }

        // do it agian without context so you can see the difference
        System.out.println(
            "HeadersTest no headers executing getQuote for \"\"" + operationName);
        operation = port.createOperation("getQuote", inputName, outputName);
        input = operation.createInputMessage();
        output = operation.createOutputMessage();
        fault = operation.createFaultMessage();
        input.setObjectPart("symbol", "");
        ok = operation.executeRequestResponseOperation(input, output, fault);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.