Package javax.xml.rpc

Examples of javax.xml.rpc.Service


   }

   public void testBasicSecuredServiceAccess() throws Exception
   {
      InitialContext iniCtx = getClientContext();
      Service service = (Service)iniCtx.lookup("java:comp/env/service/BasicSecured");
      Organization endpoint = (Organization)service.getPort(new QName(nsURI, "BasicSecuredPort"), Organization.class);

      try
      {
         endpoint.getContactInfo("mafia");
         fail("Security exception expected");
View Full Code Here


      File wsdlFile = new File("resources/webservice/jbws309/META-INF/wsdl/OrganizationService.wsdl");
      assertTrue("wsdl file exists", wsdlFile.exists());

      ServiceFactory factory = ServiceFactory.newInstance();
      Service service = factory.createService(wsdlFile.toURL(), new QName(nsURI, "OrganizationService"));
      Call call = service.createCall(new QName(nsURI, "BasicSecuredPort"), "getContactInfo");
      call.setTargetEndpointAddress(targetAddress);

      try
      {
         call.invoke(new Object[] { "mafia" });
View Full Code Here

   }

   public void testRoleSecuredServiceAccess() throws Exception
   {
      InitialContext iniCtx = getClientContext();
      Service service = (Service)iniCtx.lookup("java:comp/env/service/RoleSecured");
      Organization endpoint = (Organization)service.getPort(new QName(nsURI, "RoleSecuredPort"), Organization.class);

      try
      {
         endpoint.getContactInfo("mafia");
         fail("Security exception expected");
View Full Code Here

   }

   public void testHelloString() throws Exception
   {
      InitialContext iniCtx = getClientContext();
      Service service = (Service)iniCtx.lookup("java:comp/env/service/HelloService");
      Hello helloPort = (Hello)service.getPort(Hello.class);

      String retStr = helloPort.helloString("Kermit");
      assertEquals("Hello Kermit!", retStr);
   }
View Full Code Here

   {
      super.setUp();
      if (helloPort == null)
      {
         InitialContext iniCtx = getClientContext();
         Service service = (Service)iniCtx.lookup("java:comp/env/service/HelloService");

         // JBAS-8540 debugging
         URL wsdl = service.getWSDLDocumentLocation() ;
         printURLContents(wsdl) ;
        
         helloPort = (Hello)service.getPort(Hello.class);
      }
   }
View Full Code Here

            String namespaceURI = "http://acme.org/magicGball";
            QName serviceQName = new QName(namespaceURI, "MagicGBallService");
            QName portQName = new QName(namespaceURI, "MagicGBallPort");

            ServiceFactory serviceFactory = ServiceFactory.newInstance();
            Service service = serviceFactory.createService(wsdlURL, serviceQName);
            MagicGBallEndpoint mGball = (MagicGBallEndpoint) service.getPort(portQName, MagicGBallEndpoint.class);

            for (int i = 0; i < args.length; i++) {
                String question = args[i];
                String answer = mGball.ask(question);
                System.out.println(answer);
View Full Code Here

    * Get a handle to the MeridioMetaCarta Web Service
    *================================================================*/
    if (meridioManifoldCFWSUrl != null)
    {
      MetaCartaLocator meridioMCWS = new MetaCartaLocator(engineConfiguration);
      Service McWsService = null;
      MetaCartaSoapStub meridioMetaCartaWebService = new MetaCartaSoapStub(meridioManifoldCFWSUrl, McWsService);

      meridioMetaCartaWebService.setPortName(meridioMCWS.getMetaCartaSoapWSDDServiceName());
      meridioMetaCartaWebService.setUsername(userName);
      meridioMetaCartaWebService.setPassword(password);
View Full Code Here

    public ServiceGetPort(String name) {
        super(name);
    } // ctor
   
    public void testGetGeneratedStub() throws Exception {
        Service service = ServiceFactory.newInstance().createService(
                new URL("file:samples/addr/AddressBook.wsdl"),
                new QName("urn:AddressFetcher2", "AddressBookService"));
        QName portName = new QName("urn:AddressFetcher2", "AddressBook");
        Remote stub = service.getPort(portName, AddressBook.class);
        assertTrue("Stub should be an instance of AddressBookSOAPBindingStub; instead, it is " + stub.getClass().getName(), stub instanceof AddressBookSOAPBindingStub);
    } // testGetGeneratedStub
View Full Code Here

        super(name);
    }

    private TypeTest getProxyWithWSDL() {
        try {
            Service service = ServiceFactory.newInstance().createService(
                new URL("file", "", "test/wsdl/types/ComprehensiveTypes.wsdl"),
                new QName("urn:comprehensive-service.types.wsdl.test",
                        "TypeTestService"));
            return (TypeTest) service.getPort(
                new QName("", "TypeTest"), TypeTest.class);
        }
        catch (MalformedURLException mue) {
            throw new AssertionFailedError(
                    "MalformedURLException caught: " + mue);
View Full Code Here

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

TOP

Related Classes of javax.xml.rpc.Service

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.