Package javax.xml.ws

Examples of javax.xml.ws.Dispatch


        URL wsdl1 = getClass().getResource("/wsdl/calculator.wsdl");
        assertNotNull(wsdl1);
       
        ServiceImpl service = new ServiceImpl(getBus(), wsdl1, SERVICE_1, ServiceImpl.class);

        Dispatch dispatch = service.createDispatch(PORT_1, Source.class, Service.Mode.PAYLOAD);
        assertNotNull(dispatch);
    }
View Full Code Here


        URL wsdl1 = getClass().getResource("/wsdl/calculator.wsdl");
        assertNotNull(wsdl1);
       
        ServiceImpl service = new ServiceImpl(getBus(), wsdl1, SERVICE_1, ServiceImpl.class);

        Dispatch dispatch = service.createDispatch(PORT_1, Source.class, Service.Mode.PAYLOAD);
        assertNotNull(dispatch);
    }
View Full Code Here

    private QName portQname = new QName("http://test", "TestPort");
   
    public void testDefaultInvocationController() {
        Service svc = Service.create(svcQname);
        svc.addPort(portQname, SOAPBinding.SOAP11HTTP_BINDING, "http://localhost");
        Dispatch d = svc.createDispatch(portQname, Source.class, Service.Mode.PAYLOAD);
       
        BaseDispatch bd = (BaseDispatch) d;
       
        assertTrue("An InvocationController instance was not created", bd.ic != null);
        assertTrue("The default InvocationController type was incorrect.",
View Full Code Here

    public void testPluggableInvocationController() {
        FactoryRegistry.setFactory(InvocationControllerFactory.class, new TestInvocationControllerFactory());
       
        Service svc = Service.create(svcQname);
        svc.addPort(portQname, SOAPBinding.SOAP11HTTP_BINDING, "http://localhost");
        Dispatch d = svc.createDispatch(portQname, Source.class, Service.Mode.PAYLOAD);
       
        BaseDispatch bd = (BaseDispatch) d;
       
        // Set it back to the default so we don't break other tests.
        FactoryRegistry.setFactory(InvocationControllerFactory.class, new InvocationControllerFactoryImpl());
View Full Code Here

        } catch (MalformedURLException e) {
            e.printStackTrace();
        }
       
        Service svc = Service.create(url, new QName("http://jaxws.axis2.apache.org", "EchoService"));
        Dispatch dispatch = svc.createDispatch(new QName("http://jaxws.axis2.apache.org", "EchoPort"),
                String.class, Mode.PAYLOAD);
       
        try {
            dispatch.invoke("");
           
            // If an exception wasn't thrown, then it's an error.
            fail();
        } catch (WebServiceException e) {
            // We should only get a WebServiceException here.  Anything else
View Full Code Here

   
    public void testSetInvalidClientProperties() throws Exception {
        Service svc = Service.create(new QName("http://test", "TestService"));
        QName portQName = new QName("http://test", "TestPort");
        svc.addPort(portQName, null, null);
        Dispatch dispatch = svc.createDispatch(portQName, String.class, Mode.PAYLOAD);
       
        Map<String, Object> map = dispatch.getRequestContext();
       
        try {
            map.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, new Integer(4));
            fail();
        }
View Full Code Here

     */
    public void testDisptachBindingProviderSPI() {
        Service svc = Service.create(serviceQName);
        svc.addPort(portQName, SOAPBinding.SOAP11HTTP_BINDING, "");
       
        Dispatch dsp = svc.createDispatch(portQName, Source.class, Service.Mode.MESSAGE);
       
        // Make sure we can cast the object to the right interfaces
        assertTrue("The Dispatch object should also be a javax.xml.ws.BindingProvider",
                (dsp instanceof javax.xml.ws.BindingProvider));
        assertTrue("The Dispatch object should also be a org.apache.axis2.jaxws.spi.BindingProvider",
View Full Code Here

    public void testDispatchAddressingDisabledByDefault() {
        Service svc = Service.create(serviceQName);
        svc.addPort(portQName, SOAPBinding.SOAP11HTTP_BINDING, "");

        Dispatch dsp = svc.createDispatch(portQName, Source.class,
                Service.Mode.MESSAGE);

        org.apache.axis2.jaxws.spi.BindingProvider bp = (org.apache.axis2.jaxws.spi.BindingProvider) dsp;

        Boolean addressingDisabled = (Boolean) bp.getRequestContext().get(
View Full Code Here

      QName portName = new QName(targetNS, "DocBarePort");
      URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-samples-soapbinding/DocBareService?wsdl");

      Service service = Service.create(wsdlURL, serviceName);
      JAXBContext jbc = JAXBContext.newInstance(new Class[] { SubmitBareRequest.class, SubmitBareResponse.class });
      Dispatch dispatch = service.createDispatch(portName, jbc, Mode.PAYLOAD);

      SubmitBareRequest poReq = new SubmitBareRequest("Ferrari");
      SubmitBareResponse poRes = (SubmitBareResponse)dispatch.invoke(poReq);
      assertEquals("Ferrari", poRes.getProduct());
   }
View Full Code Here

      QName serviceName = new QName(targetNS, "DocBareService");
      QName portName = new QName(targetNS, "DocBarePort");
      URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-samples-soapbinding/DocBareService?wsdl");

      Service service = Service.create(wsdlURL, serviceName);
      Dispatch dispatch = service.createDispatch(portName, SOAPMessage.class, Mode.MESSAGE);

      String reqEnv =
      "<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>" +
      " <env:Header/>" +
      " <env:Body>" +
      "  <ns1:SubmitPO xmlns:ns1='" + targetNS + "'>" +
      "   <ns1:product>Ferrari</ns1:product>" +
      "  </ns1:SubmitPO>" +
      " </env:Body>" +
      "</env:Envelope>";

      SOAPMessage reqMsg = MessageFactory.newInstance().createMessage(null, new ByteArrayInputStream(reqEnv.getBytes()));
      SOAPMessage resMsg = (SOAPMessage)dispatch.invoke(reqMsg);

      QName qname = new QName(targetNS, "SubmitPOResponse");
      SOAPElement soapElement = (SOAPElement)resMsg.getSOAPBody().getChildElements(qname).next();
      soapElement = (SOAPElement)soapElement.getChildElements(new QName(targetNS, "product")).next();
      assertEquals("Ferrari", soapElement.getValue());
View Full Code Here

TOP

Related Classes of javax.xml.ws.Dispatch

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.