Package javax.xml.rpc

Examples of javax.xml.rpc.ServiceFactory


   public void testEJBEndpoint() throws Exception
   {
      deploy("jaxrpc-jbas897.jar");
      try
      {
         ServiceFactory serviceFactory = ServiceFactory.newInstance();
         Service service = serviceFactory.createService(new URL("http://" + getServerHost() + ":8080/jaxrpc-jbas897/HelloEJB?wsdl"), SERVICE_NAME);
         Call call = (Call)service.createCall(new QName(NAMESPACE, "HelloPort"), "sayHello");
         String retstr = (String)call.invoke(new Object[] { "Hello" });
         assertEquals("'Hello' to you too!", retstr);
      }
      finally
View Full Code Here


   public void testUnconfiguredCall_SetReturnType() throws Exception
   {
      QName serviceName = new QName(NAMESPACE, "TestService");
      QName operationName = new QName(NAMESPACE, "echo");

      ServiceFactory factory = ServiceFactory.newInstance();
      Service service = factory.createService(serviceName);

      Call call = (Call)service.createCall();
      call.setOperationName(operationName);
      call.addParameter("String_1", Constants.TYPE_LITERAL_STRING, ParameterMode.IN);
      call.setTargetEndpointAddress(TARGET_ENDPOINT_ADDRESS);
View Full Code Here

   public void testUnconfiguredCall_AddOutParam() throws Exception
   {
      QName serviceName = new QName(NAMESPACE, "TestService");
      QName operationName = new QName(NAMESPACE, "echo");

      ServiceFactory factory = ServiceFactory.newInstance();
      Service service = factory.createService(serviceName);

      Call call = (Call)service.createCall();
      call.setOperationName(operationName);
      call.addParameter("String_1", Constants.TYPE_LITERAL_STRING, ParameterMode.IN);
      call.addParameter("String_2", Constants.TYPE_LITERAL_STRING, ParameterMode.OUT);
View Full Code Here

      QName serviceName = new QName(NAMESPACE, "TestService");
      QName operationName = new QName(NAMESPACE, "echo");

      URL wsdlLocation = new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl");

      ServiceFactory factory = (ServiceFactory)ServiceFactory.newInstance();
      Service service = factory.createService(wsdlLocation, serviceName);

      Call call = (Call)service.createCall();
      call.setOperationName(operationName);
      call.setTargetEndpointAddress(TARGET_ENDPOINT_ADDRESS);
View Full Code Here

   {
      setModifySOAPAddress(true);
      deploy("jaxrpc-addressrewrite.war");
      try
      {
         ServiceFactory serviceFactory = ServiceFactory.newInstance();

         Service service = serviceFactory.createService(new URL(wsdlLocation), new QName(NAMESPACE, "ValidURLService"));
         Call call = (Call)service.createCall(new QName(NAMESPACE, "ValidURLPort"), "sayHello");
         assertEquals("http://" + webServiceHost + ":8080/jaxrpc-addressrewrite/ValidURL", call.getTargetEndpointAddress());

         service = serviceFactory.createService(new URL(wsdlLocation), new QName(NAMESPACE, "InvalidURLService"));
         call = (Call)service.createCall(new QName(NAMESPACE, "InvalidURLPort"), "sayHello");
         assertEquals("http://" + webServiceHost + ":8080/jaxrpc-addressrewrite/InvalidURL", call.getTargetEndpointAddress());

         service = serviceFactory.createService(new URL(wsdlLocation), new QName(NAMESPACE, "ValidSecureURLService"));
         call = (Call)service.createCall(new QName(NAMESPACE, "ValidSecureURLPort"), "sayHello");
         assertEquals("https://" + webServiceHost + ":8443/jaxrpc-addressrewrite/ValidSecureURL", call.getTargetEndpointAddress());

         service = serviceFactory.createService(new URL(wsdlLocation), new QName(NAMESPACE, "InvalidSecureURLService"));
         call = (Call)service.createCall(new QName(NAMESPACE, "InvalidSecureURLPort"), "sayHello");
         assertEquals("https://" + webServiceHost + ":8443/jaxrpc-addressrewrite/InvalidSecureURL", call.getTargetEndpointAddress());
      }
      finally
      {
View Full Code Here

   public void testSecureRewrite() throws Exception
   {
      deploy("jaxrpc-addressrewrite-sec.war");
      try
      {
         ServiceFactory serviceFactory = ServiceFactory.newInstance();

         Service service = serviceFactory.createService(new URL(wsdlLocationSec), new QName(NAMESPACE, "ValidURLService"));
         Call call = (Call)service.createCall(new QName(NAMESPACE, "ValidURLPort"), "sayHello");
         assertEquals("https://" + webServiceHost + ":8443/jaxrpc-addressrewrite-sec/ValidURL", call.getTargetEndpointAddress());

         service = serviceFactory.createService(new URL(wsdlLocationSec), new QName(NAMESPACE, "InvalidURLService"));
         call = (Call)service.createCall(new QName(NAMESPACE, "InvalidURLPort"), "sayHello");
         assertEquals("https://" + webServiceHost + ":8443/jaxrpc-addressrewrite-sec/InvalidURL", call.getTargetEndpointAddress());

         service = serviceFactory.createService(new URL(wsdlLocationSec), new QName(NAMESPACE, "ValidSecureURLService"));
         call = (Call)service.createCall(new QName(NAMESPACE, "ValidSecureURLPort"), "sayHello");
         assertEquals("https://" + webServiceHost + ":8443/jaxrpc-addressrewrite-sec/ValidSecureURL", call.getTargetEndpointAddress());

         service = serviceFactory.createService(new URL(wsdlLocationSec), new QName(NAMESPACE, "InvalidSecureURLService"));
         call = (Call)service.createCall(new QName(NAMESPACE, "InvalidSecureURLPort"), "sayHello");
         assertEquals("https://" + webServiceHost + ":8443/jaxrpc-addressrewrite-sec/InvalidSecureURL", call.getTargetEndpointAddress());
      }
      finally
      {
View Full Code Here

   {
      setModifySOAPAddress(false);
      deploy("jaxrpc-addressrewrite.war");
      try
      {
         ServiceFactory serviceFactory = ServiceFactory.newInstance();

         Service service = serviceFactory.createService(new URL(wsdlLocation), new QName(NAMESPACE, "ValidURLService"));
         Call call = (Call)service.createCall(new QName(NAMESPACE, "ValidURLPort"), "sayHello");
         assertEquals("http://somehost:80/somepath", call.getTargetEndpointAddress());

         service = serviceFactory.createService(new URL(wsdlLocation), new QName(NAMESPACE, "InvalidURLService"));
         call = (Call)service.createCall(new QName(NAMESPACE, "InvalidURLPort"), "sayHello");
         assertEquals("http://" + webServiceHost + ":8080/jaxrpc-addressrewrite/InvalidURL", call.getTargetEndpointAddress());

         service = serviceFactory.createService(new URL(wsdlLocation), new QName(NAMESPACE, "ValidSecureURLService"));
         call = (Call)service.createCall(new QName(NAMESPACE, "ValidSecureURLPort"), "sayHello");
         assertEquals("https://somehost:443/some-secure-path", call.getTargetEndpointAddress());

         service = serviceFactory.createService(new URL(wsdlLocation), new QName(NAMESPACE, "InvalidSecureURLService"));
         call = (Call)service.createCall(new QName(NAMESPACE, "InvalidSecureURLPort"), "sayHello");
         assertEquals("https://" + webServiceHost + ":8443/jaxrpc-addressrewrite/InvalidSecureURL", call.getTargetEndpointAddress());
      }
      finally
      {
View Full Code Here

        URL urlWsdl = new URL(wsdlLocation);
        String nameSpaceUri = "http://" + thisHost + ":" + thisPort +
                "/jws/AutoTypesTest.jws";
        String serviceName = "AutoTypesTestService";
        String portName = "AutoTypesTest";
        ServiceFactory serviceFactory = ServiceFactory.newInstance();
        Service service = serviceFactory.createService(urlWsdl, new
                QName(nameSpaceUri, serviceName));
        Stub stub = (Stub) service.getPort(new
                QName(nameSpaceUri, portName), IAutoTypes.class);
        IAutoTypes myProxy = (IAutoTypes) stub;
        return myProxy;
View Full Code Here

    public void test1() throws Exception {
        try {
            String wsdlLocation = "http://www.xmethods.net/sd/2001/TemperatureService.wsdl";
            String wsdlNsp = "http://www.xmethods.net/sd/TemperatureService.wsdl";
            ServiceFactory factory = ServiceFactory.newInstance();
            Service service = factory.createService(new URL(wsdlLocation),
                                  new QName(wsdlNsp, "TemperatureService"));
            Call[] calls = service.getCalls(new QName(wsdlNsp,"TemperaturePort"));
            assertTrue(calls != null);
            assertEquals(calls[0].getOperationName().getLocalPart(),"getTemp");
            ((org.apache.axis.client.Call)calls[0]).setTimeout(new Integer(15*1000));
 
View Full Code Here

        //location of wsdl file
        String wsdlLocation = "http://" + thisHost + ":" + thisPort + "/axis/services/AddressBookNoImplSEI?WSDL";
        URL orgWsdlUrl = new URL(wsdlLocation);

        ServiceFactory serviceFactory = ServiceFactory.newInstance();
        Service addressBookService =
                serviceFactory.createService(orgWsdlUrl,
                        new QName(nameSpaceUri, serviceName));

        // Add the typemapping entries
        TypeMappingRegistry registry = addressBookService.getTypeMappingRegistry();
        TypeMapping map = registry.getDefaultTypeMapping();
View Full Code Here

TOP

Related Classes of javax.xml.rpc.ServiceFactory

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.