Package javax.xml.ws

Examples of javax.xml.ws.WebServiceClient


        DescriptionBuilderComposite dbcInServiceDesc = DescriptionTestUtils2.getServiceDescriptionComposite(serviceDesc);
        assertSame(composite, dbcInServiceDesc.getSparseComposite(serviceDelegate));
        assertEquals(Service.class, dbcInServiceDesc.getCorrespondingClass());
        // The target namespace for the key should be overriden; it should not be overriden for
        // no key.
        WebServiceClient wsClient = dbcInServiceDesc.getWebServiceClientAnnot();
        assertNull(wsClient);
       
        WebServiceClient wsClientKeyed = dbcInServiceDesc.getWebServiceClientAnnot(serviceDelegate);
        assertNotNull(wsClientKeyed);
        assertNull(wsClientKeyed.wsdlLocation());
        assertEquals("overrideTNS", wsClientKeyed.targetNamespace());
        assertNull(wsClientKeyed.name());

    }
View Full Code Here


        assertNotNull(serviceDesc);
        DescriptionBuilderComposite dbcInServiceDesc = DescriptionTestUtils2.getServiceDescriptionComposite(serviceDesc);
        assertSame(composite, dbcInServiceDesc.getSparseComposite(serviceDelegate));
        assertEquals(Service.class, dbcInServiceDesc.getCorrespondingClass());
        // Since this is a generic Service with  overrides, there will be a WebServiceClient annotation
        WebServiceClient wsClient = dbcInServiceDesc.getWebServiceClientAnnot();
        assertNull(wsClient);
        wsClient = dbcInServiceDesc.getWebServiceClientAnnot(serviceDelegate);
        assertNotNull(wsClient);
        assertEquals(getWsdlLocation(overridenWsdl), wsClient.wsdlLocation());
        assertNull(wsClient.targetNamespace());
        assertNull(wsClient.name());

        // WSDL override specified in the composite
        assertTrue("Wrong WSDL used", validatePort(service, overridenWsdl_portLocalPart));

    }
View Full Code Here

        DescriptionBuilderComposite dbcInServiceDesc = DescriptionTestUtils2.getServiceDescriptionComposite(serviceDesc);
        assertSame(composite, dbcInServiceDesc.getSparseComposite(serviceDelegate));
        assertEquals(ClientMetadataGeneratedService.class, dbcInServiceDesc.getCorrespondingClass());
        // There is WebServiceClient on the generated Service and it was overriden in the composite
        // for this key, however the keyless composite should not have any overrides.
        WebServiceClient wsClient = dbcInServiceDesc.getWebServiceClientAnnot();
        assertNotNull(wsClient);
        assertEquals(originalWsdl, wsClient.wsdlLocation());
        assertEquals("originalTNS", wsClient.targetNamespace());
        assertEquals("", wsClient.name());
       
        WebServiceClient wsClientKeyed = dbcInServiceDesc.getWebServiceClientAnnot(serviceDelegate);
        assertNotSame(wsClient, wsClientKeyed);
        assertEquals(getWsdlLocation(overridenWsdl), wsClientKeyed.wsdlLocation());
        assertEquals("originalTNS", wsClientKeyed.targetNamespace());
        assertEquals("", wsClientKeyed.name());
       
        // WSDL override specified in the composite
        assertTrue("Wrong WSDL used", validatePort(service, overridenWsdl_portLocalPart));
    }
View Full Code Here

              "subclass as @WebServiceRef(...) value.");
        }
        if (StringUtils.hasLength(this.wsdlLocation)) {
          try {
            Constructor ctor = this.lookupType.getConstructor(new Class[] {URL.class, QName.class});
            WebServiceClient clientAnn = this.lookupType.getAnnotation(WebServiceClient.class);
            if (clientAnn == null) {
              throw new IllegalStateException("JAX-WS Service class [" + this.lookupType.getName() +
                  "] does not carry a WebServiceClient annotation");
            }
            service = (Service) BeanUtils.instantiateClass(ctor,
                new Object[] {new URL(this.wsdlLocation), new QName(clientAnn.targetNamespace(), clientAnn.name())});
          }
          catch (NoSuchMethodException ex) {
            throw new IllegalStateException("JAX-WS Service class [" + this.lookupType.getName() +
                "] does not have a (URL, QName) constructor. Cannot apply specified WSDL location [" +
                this.wsdlLocation + "].");
View Full Code Here

              "subclass as @WebServiceRef(...) value.");
        }
        if (StringUtils.hasLength(this.wsdlLocation)) {
          try {
            Constructor<?> ctor = this.lookupType.getConstructor(new Class[] {URL.class, QName.class});
            WebServiceClient clientAnn = this.lookupType.getAnnotation(WebServiceClient.class);
            if (clientAnn == null) {
              throw new IllegalStateException("JAX-WS Service class [" + this.lookupType.getName() +
                  "] does not carry a WebServiceClient annotation");
            }
            service = (Service) BeanUtils.instantiateClass(ctor,
                new URL(this.wsdlLocation), new QName(clientAnn.targetNamespace(), clientAnn.name()));
          }
          catch (NoSuchMethodException ex) {
            throw new IllegalStateException("JAX-WS Service class [" + this.lookupType.getName() +
                "] does not have a (URL, QName) constructor. Cannot apply specified WSDL location [" +
                this.wsdlLocation + "].");
View Full Code Here

              "subclass as @WebServiceRef(...) value.");
        }
        if (StringUtils.hasLength(this.wsdlLocation)) {
          try {
            Constructor<?> ctor = this.lookupType.getConstructor(new Class[] {URL.class, QName.class});
            WebServiceClient clientAnn = this.lookupType.getAnnotation(WebServiceClient.class);
            if (clientAnn == null) {
              throw new IllegalStateException("JAX-WS Service class [" + this.lookupType.getName() +
                  "] does not carry a WebServiceClient annotation");
            }
            service = (Service) BeanUtils.instantiateClass(ctor,
                new URL(this.wsdlLocation), new QName(clientAnn.targetNamespace(), clientAnn.name()));
          }
          catch (NoSuchMethodException ex) {
            throw new IllegalStateException("JAX-WS Service class [" + this.lookupType.getName() +
                "] does not have a (URL, QName) constructor. Cannot apply specified WSDL location [" +
                this.wsdlLocation + "].");
View Full Code Here

                            
      URLClassLoader loader = new URLClassLoader(new URL[] { new URL("file:"+System.getProperty("user.dir")+"/wsconsume/java/") });
      String seiClassName = "org.jboss.test.ws.tools.testWsdlLocation.TestService";
      Class sei = loader.loadClass(seiClassName);

      WebServiceClient webServiceClient = (WebServiceClient) sei.getAnnotation(WebServiceClient.class);
      assertNotNull("@WebServiceClient not generated on service interface", webServiceClient);
      assertEquals("@WebServiceClient.wsdlLocation not set", "http://foo.bar.com/endpoint?wsdl", webServiceClient.wsdlLocation());
   }
View Full Code Here

              "subclass as @WebServiceRef(...) value.");
        }
        if (StringUtils.hasLength(this.wsdlLocation)) {
          try {
            Constructor ctor = this.lookupType.getConstructor(new Class[] {URL.class, QName.class});
            WebServiceClient clientAnn = this.lookupType.getAnnotation(WebServiceClient.class);
            if (clientAnn == null) {
              throw new IllegalStateException("JAX-WS Service class [" + this.lookupType.getName() +
                  "] does not carry a WebServiceClient annotation");
            }
            service = (Service) BeanUtils.instantiateClass(ctor,
                new Object[] {new URL(this.wsdlLocation), new QName(clientAnn.targetNamespace(), clientAnn.name())});
          }
          catch (NoSuchMethodException ex) {
            throw new IllegalStateException("JAX-WS Service class [" + this.lookupType.getName() +
                "] does not have a (URL, QName) constructor. Cannot apply specified WSDL location [" +
                this.wsdlLocation + "].");
View Full Code Here

        // WSDL document location
        if (!serviceRef.isSetWsdlFile()) {
            String wsdlLocation = annotation.wsdlLocation();

            if (wsdlLocation == null || wsdlLocation.trim().length() == 0) {
                WebServiceClient wsClient = null;
                if (Object.class.equals(webServiceRefValue)) {
                    wsClient = (WebServiceClient) webServiceRefType.getAnnotation(WebServiceClient.class);
                } else {
                    wsClient = (WebServiceClient) webServiceRefValue.getAnnotation(WebServiceClient.class);
                }
                if (wsClient == null) {
                    wsdlLocation = null;
                } else {
                    wsdlLocation = wsClient.wsdlLocation();
                }
            }

            if (wsdlLocation != null && wsdlLocation.trim().length() > 0) {
                XsdAnyURIType wsdlFile = serviceRef.addNewWsdlFile();
View Full Code Here

   
    public void build() throws DeploymentException {
        if (this.wsdlURI == null) {
            // wsdl explitely not specified, try to get it from
            // the service class annotation
            WebServiceClient webServiceClient =
                (WebServiceClient) this.serviceClass.getAnnotation(WebServiceClient.class);
            if (webServiceClient != null) {
                this.wsdlURI = getWSDLLocation(webServiceClient);              
                this.serviceQName = getServiceQName(webServiceClient);
            }
View Full Code Here

TOP

Related Classes of javax.xml.ws.WebServiceClient

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.