Package org.jboss.wsf.spi.metadata.webservices

Examples of org.jboss.wsf.spi.metadata.webservices.WebservicesMetaData


      assertEquals(exp,act);
   }
  
   private WebservicesMetaData constructWSMetaData()
   {
      WebservicesMetaData wm = new WebservicesMetaData(null);
      WebserviceDescriptionMetaData wsdm = new WebserviceDescriptionMetaData(wm);
      populateWebserviceDescriptionMetaData(wsdm);
      wm.addWebserviceDescription(wsdm);
      return wm;
   }
View Full Code Here


   public void testJAXWSElementParsing() throws Exception
   {
      URL webservicesURL = getResourceURL("jaxws/wsdd/WEB-INF/webservices.xml");
      // Unmarshall webservices.xml
      WebservicesMetaData webservices = null;
      InputStream is = webservicesURL.openStream();
      try
      {
         Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
         ObjectModelFactory factory = new WebservicesFactory(webservicesURL);
         webservices = (WebservicesMetaData)unmarshaller.unmarshal(is, factory, null);
      }
      finally
      {
         is.close();
      }

      assertNotNull(webservices);

      WebserviceDescriptionMetaData wsDesc = webservices.getWebserviceDescriptions()[0];
      assertNotNull(wsDesc);
      assertTrue(wsDesc.getPortComponents().length == 1);

      PortComponentMetaData portComp = wsDesc.getPortComponents()[0];
      assertNotNull(portComp);
View Full Code Here

{
   public void testWebServicesMetaDataRead() throws Exception
   {
      URL webservicesURL = getResourceURL("tools/metadatafixture/webservices.xml");
      // Unmarshall webservices.xml
      WebservicesMetaData webservices = null;
      InputStream is = webservicesURL.openStream();
      try
      {
         Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
         ObjectModelFactory factory = new WebservicesFactory(webservicesURL);
View Full Code Here

  
   public void testWebServicesMetaDataWrite() throws Exception
   {
      URL webservicesURL = getResourceURL("tools/metadatafixture/webservices.xml");
      // Unmarshall webservices.xml
      WebservicesMetaData webservices = constructWSMetaData();
      assertNotNull("WebServicesMetaData is null?",webservices);
      String wmdata = webservices.serialize();
      Element exp = DOMUtils.parse(webservicesURL.openStream());
      Element act = DOMUtils.parse(wmdata);
      assertEquals(exp,act);
   }
View Full Code Here

    * The deployment descriptors are only used to override or augment the annotation member attributes.
    * @param sepMetaData
    */
   private void processWSDDContribution(ServerEndpointMetaData sepMetaData)
   {
      WebservicesMetaData webservices = WebservicesFactory.loadFromVFSRoot(sepMetaData.getRootFile());
      if (webservices != null)
      {
         for (WebserviceDescriptionMetaData wsDesc : webservices.getWebserviceDescriptions())
         {
            for (PortComponentMetaData portComp : wsDesc.getPortComponents())
            {
               // We match portComp's by SEI first and portQName second
               // In the first case the portComp may override the portQName that derives from the annotation
View Full Code Here

    public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
        final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
        final ResourceRoot deploymentRoot = deploymentUnit.getAttachment(Attachments.DEPLOYMENT_ROOT);
        UnifiedVirtualFile uvf = new VirtualFileAdaptor(deploymentRoot.getRoot());
        WebservicesMetaData wsmd = WebservicesFactory.loadFromVFSRoot(uvf);
        if (wsmd != null) {
            deploymentUnit.putAttachment(WSAttachmentKeys.WEBSERVICES_METADATA_KEY, wsmd);
        }
    }
View Full Code Here

      this.append = append;
   }

   public void generateWSXMLDescriptor(File wsXmlFile) throws IOException
   {
      WebservicesMetaData webservices = constructWSMetaData();

      // handle append flag
      if (append && wsXmlFile.exists())
      {
         WebservicesMetaData existingWebservices;

         // parse existing webservices descriptor
         InputStream wsXmlStream = new FileInputStream(wsXmlFile);
         try
         {
            Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
            ObjectModelFactory factory = new WebservicesFactory(wsXmlFile.toURL());
            existingWebservices = (WebservicesMetaData)unmarshaller.unmarshal(wsXmlStream, factory, null);
         }
         catch (JBossXBException e)
         {
            throw new WSException("Could not unmarshal existing webservices descriptor: " + wsXmlFile, e);
         }
         finally
         {
            wsXmlStream.close();
         }

         // append generated webservice-descriptions to existing descriptor
         for (WebserviceDescriptionMetaData webserviceDescription : webservices.getWebserviceDescriptions())
            existingWebservices.addWebserviceDescription(webserviceDescription);

         webservices = existingWebservices;
      }

      // (re-)write generated webservices descriptor to file
View Full Code Here

   //PRIVATE METHODS

   private WebservicesMetaData constructWSMetaData()
   {
      WebservicesMetaData wm = new WebservicesMetaData();
      WebserviceDescriptionMetaData wsdm = new WebserviceDescriptionMetaData(wm);
      populateWebserviceDescriptionMetaData(wsdm);
      wm.addWebserviceDescription(wsdm);
      return wm;
   }
View Full Code Here

         ClassLoader runtimeClassLoader = dep.getRuntimeClassLoader();
         if(null == runtimeClassLoader)
            throw new IllegalArgumentException("Runtime loader cannot be null");
         wsMetaData.setClassLoader(runtimeClassLoader);

         WebservicesMetaData jaxrpcMapping = dep.getAttachment(WebservicesMetaData.class);
         WebserviceDescriptionMetaData[] wsDescriptionArr = jaxrpcMapping.getWebserviceDescriptions();
         for (WebserviceDescriptionMetaData wsdMetaData : wsDescriptionArr)
         {
            ServiceMetaData serviceMetaData = new ServiceMetaData(wsMetaData, null);
            serviceMetaData.setWebserviceDescriptionName(wsdMetaData.getWebserviceDescriptionName());
            wsMetaData.addService(serviceMetaData);
View Full Code Here

    * The deployment descriptors are only used to override or augment the annotation member attributes.
    * @param sepMetaData
    */
   private void processWSDDContribution(ServerEndpointMetaData sepMetaData)
   {
      WebservicesMetaData webservices = WebservicesFactory.loadFromVFSRoot(sepMetaData.getRootFile());
      if (webservices != null)
      {
         for (WebserviceDescriptionMetaData wsDesc : webservices.getWebserviceDescriptions())
         {
            for (PortComponentMetaData portComp : wsDesc.getPortComponents())
            {
               // We match portComp's by SEI first and portQName second
               // In the first case the portComp may override the portQName that derives from the annotation
View Full Code Here

TOP

Related Classes of org.jboss.wsf.spi.metadata.webservices.WebservicesMetaData

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.