Package javax.xml.rpc

Examples of javax.xml.rpc.Stub


    } // getProxyWithWSDL

    private TypeTest getProxy() {
        try {
            Service service = ServiceFactory.newInstance().createService(null);
            Stub binding = (Stub) service.getPort(TypeTest.class);
            binding._setProperty(Stub.ENDPOINT_ADDRESS_PROPERTY,
                    "http://localhost:8080/axis/services/TypeTest");
            throw new AssertionFailedError("Should not get a binding");
        }
        catch (ServiceException jre) {
            return null;
View Full Code Here


                    se.getLinkedCause() == null);
        }

        // Make sure we get the proper ports
        try {
            Stub one = (Stub) service.getPort(portAOne, One.class);
            Stub two = (Stub) service.getPort(portATwo, Two.class);
            Stub three = (Stub) service.getPort(portAThree, Three.class);
            assertTrue("getPort(portAOne) should be of type One, instead it is " + one.getClass().getName(), one instanceof One);
            assertTrue("getPort(portAOne) should have " + ADR_PORTAONE + ", instead it has " + one._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY),
                ADR_PORTAONE.equals(one._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY)));
        
            assertTrue("getPort(portATwo) should be of type Two, instead it is " + two.getClass().getName(), two instanceof Two);
            assertTrue("getPort(portATwo) should have address " + ADR_PORTATWO + ", instead it has " + two._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY),
               ADR_PORTATWO.equals(two._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY)));
        
            assertTrue("getPort(portAThree) should be of type Three, instead it is " + three.getClass().getName(), three instanceof Three);
            assertTrue("getPort(portAThree) should have address " +
                       ADR_PORTATHREE + ", instead it has " +
                       three._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY),
                       ADR_PORTATHREE.equals(three._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY)));
        }
        catch (ServiceException se) {
            fail("unexpected failure:  " + se);
        }
    } // testNormalService
View Full Code Here

                    se.getLinkedCause() == null);
        }

        // Make sure we get the proper ports
        try {
            Stub one = (Stub) service.getPort(portBOne, One.class);
            Stub two = (Stub) service.getPort(portBTwo, Two.class);
            Stub three = (Stub) service.getPort(portBTwoA, Two.class);
            assertTrue("getPort(portBOne) should be of type One, instead it is " + one.getClass().getName(), one instanceof One);
            assertTrue("getPort(portBOne) should have address http://localhost:8080/axis/services/portBOne,"
                       + " instead it has " + one._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY),
                       "http://localhost:8080/axis/services/portBOne".equals(one._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY)));

            assertTrue("getPort(portBTwo) should be of type Two, instead it is " + two.getClass().getName(), two instanceof Two);
            assertTrue("getPort(portBTwo) should have address"
                       + "http://localhost:8080/axis/services/portBTwo,"
                       + "instead it has " + two._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY)
                       + ", port is " + two.toString(),
                       "http://localhost:8080/axis/services/portBTwo".equals(two._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY)));

            assertTrue("getPort(portBTwoA) should be of type Two, instead it is " + three.getClass().getName(), three instanceof Two);
            assertTrue("getPort(portBTwoA) should have address "
                  + "http://localhost:8080/axis/services/portBTwoA, "
                  + "instead it has " + three._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY),
                  "http://localhost:8080/axis/services/portBTwoA".equals(three._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY)));
        }
        catch (ServiceException se) {
            fail("unexpected failure:  " + se);
        }
    } // testDoublePortService1
View Full Code Here

                    se.getLinkedCause() == null);
        }

        // Make sure we get the proper ports
        try {
            Stub one = (Stub) service.getPort(portCOne, One.class);
            Stub two = (Stub) service.getPort(portCTwo, Two.class);
            Stub three = (Stub) service.getPort(portCThree, Three.class);
            assertTrue("getPort(portCOne) should be of type One, instead it is " + one.getClass().getName(), one instanceof One);
            assertTrue("getPort(portCOne) should have address "
               + "http://localhost:8080/axis/services/portCOne, "
               + "instead it has " + one._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY),
               "http://localhost:8080/axis/services/portCOne".equals(one._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY)));
              
              
            assertTrue("getPort(portCTwo) should be of type Two, instead it is " + two.getClass().getName(), two instanceof Two);
            assertTrue("getPort(portCTwo) should have address "
                 + "http://localhost:8080/axis/services/portCTwo, "
                 + "instead it has " + two._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY),
                 "http://localhost:8080/axis/services/portCTwo".equals(two._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY)));
                
                
            assertTrue("getPort(portCThree) should be of type One, instead it is " + three.getClass().getName(), three instanceof One);
            assertTrue("getPort(portCThree) should have address "
                 + "http://localhost:8080/axis/services/portCThree,"
                 + " instead it has " + three._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY),
                 "http://localhost:8080/axis/services/portCThree".equals(three._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY)));
        }
        catch (ServiceException se) {
            fail("unexpected failure:  " + se);
        }
    } // testDoublePortService2
View Full Code Here

      catch (RemoteException ignore)
      {
         // ignore expected exception
      }

      Stub stub = (Stub)port;
      stub._setProperty(Stub.USERNAME_PROPERTY, USERNAME);
      stub._setProperty(Stub.PASSWORD_PROPERTY, PASSWORD);

      String info = port.getContactInfo("mafia");
      assertEquals("The 'mafia' boss is currently out of office, please call again.", info);
   }
View Full Code Here

      catch (RemoteException ignore)
      {
         // ignore expected exception
      }

      Stub stub = (Stub)port;
      stub._setProperty(Stub.USERNAME_PROPERTY, USERNAME);
      stub._setProperty(Stub.PASSWORD_PROPERTY, PASSWORD);

      String info = port.getContactInfo("mafia");
      assertEquals("The 'mafia' boss is currently out of office, please call again.", info);
   }
View Full Code Here

    *
    * @throws Exception
    */
   public void testCall_NoSecurity() throws Exception
   {
      Stub stub = (Stub)port;
      stub._setProperty(TestSecurityHandler.JBWS1316_CREATED, null);
      stub._setProperty(TestSecurityHandler.JBWS1316_EXPIRES, null);

      try
      {
         port.echoMessage(MESSAGE);
         fail("Call should have failed due to no wsse:Security.");
View Full Code Here

   public void testCall_ValidTimestamp() throws Exception
   {
      long started = System.currentTimeMillis();

      Stub stub = (Stub)port;
      stub._setProperty(TestSecurityHandler.JBWS1316_CREATED, Integer.valueOf(0));
      stub._setProperty(TestSecurityHandler.JBWS1316_EXPIRES, Integer.valueOf(10));

      String response = port.echoMessage(MESSAGE);
      assertEquals("Expected Response", MESSAGE, response);

      long finished = System.currentTimeMillis();
View Full Code Here

      InitialContext iniCtx = getInitialContext();
      Service service = (Service)iniCtx.lookup("java:comp/env/service/ConfidentialSecured");
      QName portName = new QName("http://org.jboss.ws/jbws723", "ConfidentialPort");
      OrganizationService port = (OrganizationService)service.getPort(portName, OrganizationService.class);

      Stub stub = (Stub)port;
      String address = (String)stub._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY);
      assertEquals("https://" + getServerHost() + ":8443/jaxrpc-jbws723/ConfidentialSecured", address);

      // test non-confidential access
      try
      {
         stub._setProperty(Stub.ENDPOINT_ADDRESS_PROPERTY, "http://" + getServerHost() + ":8080/jaxrpc-jbws723/ConfidentialSecured");
         port.getContactInfo("mafia");

         if (isTargetJBoss50())
            System.out.println("FIXME: [JBAS-3595] - Tomcat allows http access with transport guarantie CONFIDENTIAL");
         else fail("Security exception expected");
View Full Code Here

   public void testCall_FutureTimestamp() throws Exception
   {
      long started = System.currentTimeMillis();

      Stub stub = (Stub)port;
      stub._setProperty(TestSecurityHandler.JBWS1316_CREATED, Integer.valueOf(10));
      stub._setProperty(TestSecurityHandler.JBWS1316_EXPIRES, Integer.valueOf(20));

      String response = port.echoMessage(MESSAGE);
      assertEquals("Expected Response", MESSAGE, response);

      long finished = System.currentTimeMillis();
View Full Code Here

TOP

Related Classes of javax.xml.rpc.Stub

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.