Package javax.xml.rpc

Examples of javax.xml.rpc.ServiceFactory


  public void testInOut() throws Exception {
      URL urlWsdl = new URL("http://localhost:8080/axis/services/AddressInOut?wsdl");
      String nameSpaceUri = "http://jaxrpcdynproxy.wsdl.test";
      String serviceName = "AddressInOut";
      String portName = "AddressInOut";
      ServiceFactory serviceFactory = ServiceFactory.newInstance();
      Service service = serviceFactory.createService(urlWsdl, new
              QName(nameSpaceUri, serviceName));
      AddressService myProxy = (AddressService) service.getPort(new
              QName(nameSpaceUri, portName), AddressService.class);
      AddressBean addressBean = new AddressBean();
      addressBean.setStreet("55, rue des Lilas");
View Full Code Here


   }

   // [JBWS-983] Configure SOAPAction on the Call object
   public void testCallActionFromProperty() throws Exception
   {
     ServiceFactory factory = ServiceFactory.newInstance();
      URL wsdlUrl = new URL("http://" + getServerHost() + ":8080/jaxrpc-jbws425?wsdl");
      QName serviceName = new QName("http://org.jboss.test.webservice/jbws425", "HelloService");
      QName portName = new QName("http://org.jboss.test.webservice/jbws425", "HelloPort");
      Service service = factory.createService(wsdlUrl, serviceName);
      Call call = service.createCall(portName, "hello");
      call.setProperty(Call.SOAPACTION_URI_PROPERTY, "uri:property-action");
      String soapAction = (String)call.invoke(new Object[] {"Hello Server"});
      assertEquals("\"uri:property-action\"", soapAction);
   }
View Full Code Here

   public void testHostAddress() throws Exception
   {
      InetAddress inetAddr = InetAddress.getByName(getServerHost());
      URL wsdlURL = new URL("http://" + inetAddr.getHostAddress() + ":8080/jaxws-jbws1178/testpattern?wsdl");

      ServiceFactory factory = ServiceFactory.newInstance();
      QName serviceName = new QName("http://org.jboss.ws/jbws1178", "TestEndpointService");
      QName portName = new QName("http://org.jboss.ws/jbws1178", "TestEndpointPort");
      Service service = factory.createService(wsdlURL, serviceName);
      CallImpl call = (CallImpl)service.createCall(portName);
      URL epURL = new URL(call.getEndpointMetaData().getEndpointAddress());

      assertEquals(wsdlURL.getHost(), epURL.getHost());
   }
View Full Code Here

   public void testHostName() throws Exception
   {
      InetAddress inetAddr = InetAddress.getByName(getServerHost());
      URL wsdlURL = new URL("http://" + inetAddr.getHostName() + ":8080/jaxws-jbws1178/testpattern?wsdl");

      ServiceFactory factory = ServiceFactory.newInstance();
      QName serviceName = new QName("http://org.jboss.ws/jbws1178", "TestEndpointService");
      QName portName = new QName("http://org.jboss.ws/jbws1178", "TestEndpointPort");
      Service service = factory.createService(wsdlURL, serviceName);
      CallImpl call = (CallImpl)service.createCall(portName);
      URL epURL = new URL(call.getEndpointMetaData().getEndpointAddress());

      assertEquals(wsdlURL.getHost(), epURL.getHost());
   }
View Full Code Here

   }

   /** Test a fault message for a non existant operation */
   public void testNonExistantOperationDII() throws Exception
   {
      ServiceFactory factory = ServiceFactory.newInstance();
      Service service = factory.createService(new QName(TARGET_NAMESPACE, "ExceptionService"));

      Call call = service.createCall();
      call.setOperationName(new QName(TARGET_NAMESPACE, "nonExistantOperation"));
      String targetAddress = "http://" + getServerHost() + ":8080/jaxrpc-samples-exception/ExceptionBean";
      call.setTargetEndpointAddress(targetAddress);
View Full Code Here

   /** Setup the multipart/related MIME message
    */
   private Call setupMimeMessage(String rpcMethodName, String contentType)
      throws Exception
   {
      ServiceFactory factory = ServiceFactory.newInstance();
      Service service = factory.createService(SERVICE_NAME);

      Call call = service.createCall();
      call.setOperationName(new QName(TARGET_NAMESPACE, rpcMethodName));
      call.addParameter("message", new QName(Constants.NS_SCHEMA_XSD, "string"), ParameterMode.IN);

View Full Code Here

   {
      String targetEndpoint = "http://" + getServerHost() + ":8080/jaxrpc-jbws413";
      String nsURI = "http://org.jboss.test.webservice/jbws413";
      QName serviceName = new QName(nsURI, "TestService");

      ServiceFactory factory = ServiceFactory.newInstance();
     
      // Note, this is a standard call to createService without mappingURL
      Service service = factory.createService(new URL(targetEndpoint + "?wsdl"), serviceName);
      Call call = service.createCall();
     
      call.setOperationName(new QName(nsURI, "doStuff"));
      call.setTargetEndpointAddress(targetEndpoint);
View Full Code Here

      assertNotNull(wsdlDefinition);

      QName serviceName = (QName)wsdlDefinition.getServices().keySet().iterator().next();

      // test construction of the client service
      ServiceFactory serviceFactory = ServiceFactory.newInstance();
      Service service = serviceFactory.createService(wsdlURL, serviceName);
      assertNotNull(service);
   }
View Full Code Here

   /** Setup the multipart/related MIME message
    */
   private Call setupMimeMessage(String rpcMethodName, String contentType)
      throws Exception
   {
      ServiceFactory factory = ServiceFactory.newInstance();
      Service service = factory.createService(SERVICE_NAME);

      Call call = service.createCall();
      call.setOperationName(new QName(TARGET_NAMESPACE, rpcMethodName));
      call.addParameter("message", new QName(Constants.NS_SCHEMA_XSD, "string"), ParameterMode.IN);

View Full Code Here

   public void testJSEEndpoint() throws Exception
   {
      deploy("jaxrpc-jbas897.war");
      try
      {
         ServiceFactory serviceFactory = ServiceFactory.newInstance();
         Service service = serviceFactory.createService(new URL("http://" + getServerHost() + ":8080/jaxrpc-jbas897/HelloJSE?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

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.