Examples of WebServiceClient


Examples of javax.xml.ws.WebServiceClient

        assertNotNull(serviceDesc);
        DescriptionBuilderComposite dbcInServiceDesc = DescriptionTestUtils2.getServiceDescriptionComposite(serviceDesc);
        assertSame(composite, dbcInServiceDesc.getSparseComposite(serviceDelegate));
        assertEquals(ClientMetadataGeneratedService.class, dbcInServiceDesc.getCorrespondingClass());
        // There is WebServiceClient on the generated Service and it wasn't overriden in the composite
        WebServiceClient wsClient = dbcInServiceDesc.getWebServiceClientAnnot();
        assertNotNull(wsClient);
        assertEquals(originalWsdl, wsClient.wsdlLocation());
        assertEquals("originalTNS", wsClient.targetNamespace());
        assertEquals("", wsClient.name());
       
        // No WSDL override specified in the composite, so generated Service should use the annotation value
        assertTrue("Wrong WSDL Used", validatePort(service, originalWsdl_portLocalPart));

    }
View Full Code Here

Examples of javax.xml.ws.WebServiceClient

        assertNotNull(serviceDesc);
        DescriptionBuilderComposite dbcInServiceDesc = DescriptionTestUtils2.getServiceDescriptionComposite(serviceDesc);
        assertSame(composite, dbcInServiceDesc.getSparseComposite(serviceDelegate));
        assertEquals(ClientMetadataGeneratedService.class, dbcInServiceDesc.getCorrespondingClass());
        // There is WebServiceClient on the generated Service and it wasn't overriden in the composite
        WebServiceClient wsClient = dbcInServiceDesc.getWebServiceClientAnnot();
        assertNotNull(wsClient);
        assertEquals(originalWsdl, wsClient.wsdlLocation());
        assertEquals("originalTNS", wsClient.targetNamespace());
        assertEquals("", wsClient.name());

        // WSDL was specified on the generated Service constructor, and none in the composite
        // so should get the WSDL specified on the constructor
        assertTrue("Wrong WSDL used", validatePort(service, otherWsdl_portLocalPart));
    }
View Full Code Here

Examples of javax.xml.ws.WebServiceClient

        assertNotNull(serviceDesc);
        DescriptionBuilderComposite dbcInServiceDesc = DescriptionTestUtils2.getServiceDescriptionComposite(serviceDesc);
        assertSame(composite, dbcInServiceDesc.getSparseComposite(serviceDelegate));
        assertEquals(Service.class, dbcInServiceDesc.getCorrespondingClass());
        // This is a generic Service with overrides, there will be 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

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

Examples of javax.xml.ws.WebServiceClient

        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

Examples of javax.xml.ws.WebServiceClient

        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

Examples of javax.xml.ws.WebServiceClient

              "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

Examples of javax.xml.ws.WebServiceClient

              "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

Examples of javax.xml.ws.WebServiceClient

              "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

Examples of javax.xml.ws.WebServiceClient

                            
      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
TOP
Copyright © 2018 www.massapi.com. 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.