Package org.jboss.ws.metadata.wsdl

Examples of org.jboss.ws.metadata.wsdl.WSDLDefinitions


   /** Initialize the endpoint encoding style from the binding operations
    */
   protected void initEndpointEncodingStyle(EndpointMetaData epMetaData)
   {
      WSDLDefinitions wsdlDefinitions = epMetaData.getServiceMetaData().getWsdlDefinitions();
      for (WSDLService wsdlService : wsdlDefinitions.getServices())
      {
         for (WSDLEndpoint wsdlEndpoint : wsdlService.getEndpoints())
         {
            if (epMetaData.getPortName().equals(wsdlEndpoint.getName()))
            {
               QName bindQName = wsdlEndpoint.getBinding();
               WSDLBinding wsdlBinding = wsdlDefinitions.getBinding(bindQName);
               if (wsdlBinding == null)
                  throw new WSException("Cannot obtain binding: " + bindQName);

               for (WSDLBindingOperation wsdlBindingOperation : wsdlBinding.getOperations())
               {
View Full Code Here


   /** Replace the address locations for a given port component.
    */
   public static void replaceAddressLocation(ServerEndpointMetaData sepMetaData)
   {
      WSDLDefinitions wsdlDefinitions = sepMetaData.getServiceMetaData().getWsdlDefinitions();
      QName portName = sepMetaData.getPortName();

      boolean endpointFound = false;
      for (WSDLService wsdlService : wsdlDefinitions.getServices())
      {
         for (WSDLEndpoint wsdlEndpoint : wsdlService.getEndpoints())
         {
            QName wsdlPortName = wsdlEndpoint.getName();
            if (wsdlPortName.equals(portName))
            {
               endpointFound = true;

               String orgAddress = wsdlEndpoint.getAddress();
               String uriScheme = getUriScheme(orgAddress);

               String transportGuarantee = sepMetaData.getTransportGuarantee();
               if ("CONFIDENTIAL".equals(transportGuarantee))
                  uriScheme = "https";

               String servicePath = sepMetaData.getContextRoot() + sepMetaData.getURLPattern();
               String serviceEndpointURL = getServiceEndpointAddress(uriScheme, servicePath);

               SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
               ServerConfig config = spiProvider.getSPI(ServerConfigFactory.class).getServerConfig();              
               boolean alwaysModify = config.isModifySOAPAddress();

               if (alwaysModify || uriScheme == null || orgAddress.indexOf("REPLACE_WITH_ACTUAL_URL") >= 0)
               {
                  log.debug("Replace service endpoint address '" + orgAddress + "' with '" + serviceEndpointURL + "'");
                  wsdlEndpoint.setAddress(serviceEndpointURL);
                  sepMetaData.setEndpointAddress(serviceEndpointURL);

                  // modify the wsdl-1.1 definition
                  if (wsdlDefinitions.getWsdlOneOneDefinition() != null)
                     replaceWSDL11SOAPAddress(wsdlDefinitions, portName, serviceEndpointURL);
               }
               else
               {
                  log.debug("Don't replace service endpoint address '" + orgAddress + "'");
View Full Code Here

         // Get the wsdl definition and write it to the wsdl publish location
         try
         {
            Writer fWriter = IOUtils.getCharsetFileWriter(wsdlFile, Constants.DEFAULT_XML_CHARSET);
            WSDLDefinitions wsdlDefinitions = serviceMetaData.getWsdlDefinitions();
            new WSDLWriter(wsdlDefinitions).write(fWriter, Constants.DEFAULT_XML_CHARSET);

            URL wsdlPublishURL = wsdlFile.toURL();
            log.info("WSDL published to: " + wsdlPublishURL);

            // udpate the wsdl file location
            serviceMetaData.setWsdlLocation(wsdlFile.toURL());

            // Process the wsdl imports
            Definition wsdl11Definition = wsdlDefinitions.getWsdlOneOneDefinition();
            if (wsdl11Definition != null)
            {
               List<String> published = new LinkedList<String>();
               publishWsdlImports(wsdlFile.toURL(), wsdl11Definition, published);

               // Publish XMLSchema imports
               Document document = wsdlDefinitions.getWsdlDocument();
               publishSchemaImports(wsdlFile.toURL(), document.getDocumentElement(), published);
            }
            else
            {
               throw new NotImplementedException("WSDL-2.0 imports");
View Full Code Here

   public void testWsdl() throws Exception
   {
      URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl");
      WSDLDefinitionsFactory factory = WSDLDefinitionsFactory.newInstance();
      WSDLDefinitions wsdlDefinitions = factory.parse(wsdlURL);
      WSDLService wsdlService = wsdlDefinitions.getServices()[0];
      WSDLEndpoint wsdlEndpoint = wsdlService.getEndpoints()[0];
      WSDLInterface wsdlInterface = wsdlEndpoint.getInterface();
      assertNotNull(wsdlInterface.getDocumentationElement());
      assertEquals("This is a test service doing nothing special", wsdlInterface.getDocumentationElement().getContent());
      WSDLInterfaceOperation wsdlOperation = wsdlInterface.getOperations()[0];
View Full Code Here

   {
      File wsdlFile = getResourceFile("jaxrpc/jbws1068/wsrp_services.wsdl");
      assertTrue(wsdlFile.exists());

      WSDLDefinitionsFactory factory = WSDLDefinitionsFactory.newInstance();
      WSDLDefinitions wsdlDefinitions = factory.parse(wsdlFile.toURL());
   }
View Full Code Here

      // Append the portType name to the return string
      QName portType = null;
      try
      {
         URL wsdlURL = new File(wsdlPath).toURL();
         WSDLDefinitions wsdl = WSDLDefinitionsFactory.newInstance().parse(wsdlURL);
         portType = wsdl.getInterfaces()[0].getName();
      }
      catch (Exception ex)
      {
         WSException.rethrow(ex);
      }
View Full Code Here

         if (toolMode)
            return sepMetaData;

         // Sanity check: read the generated WSDL and initialize the schema model
         // Note, this should no longer be needed, look into removing it
         WSDLDefinitions wsdlDefinitions = serviceMetaData.getWsdlDefinitions();
         JBossXSModel schemaModel = WSDLUtils.getSchemaModel(wsdlDefinitions.getWsdlTypes());
         serviceMetaData.getTypesMetaData().setSchemaModel(schemaModel);

         // Note, that @WebContext needs to be defined on the endpoint not the SEI
         processWebContext(dep, sepClass, linkName, sepMetaData);
View Full Code Here

         WSDLDefinitionsFactory factory = WSDLDefinitionsFactory.newInstance();
         if (wsdlLocation != null)
         {
            //we can no longer use the user provided wsdl without parsing it right now, since we
            //need to look for policies and eventually choose the supported policy alternatives
            WSDLDefinitions wsdlDefinitions = factory.parse(wsdlLocation);
            policyBuilder.processPolicyExtensions(epMetaData, wsdlDefinitions);
            //now we have the UMDM containing policy data; anyway we can't write a new wsdl file with
            //the supported alternatives and so on, since we need to publish the file the user provided
            serviceMetaData.setWsdlLocation(wsdlLocation);
         }
         else
         {
            WSDLDefinitions wsdlDefinitions = generator.generate(serviceMetaData);
            writeWsdl(serviceMetaData, wsdlDefinitions, epMetaData);
         }
      }
      catch (RuntimeException rte)
      {
View Full Code Here

               throw new IllegalStateException("Cannot find wsdl: " + wsdlFile);
            }
         }
      }
     
      WSDLDefinitions wsdlDefinitions = null;
      if (wsdlURL != null)
      {
         // The key should not after it is assigned
         if (wsdlCacheKey == null)
            wsdlCacheKey = "#" + (wsdlLocation != null ? wsdlLocation : wsdlFile);
View Full Code Here

    * @see UnifiedMetaData#eagerInitialize()
    */
   public void eagerInitialize()
   {
      // Initialize all wsdl definitions and schema objects
      WSDLDefinitions definitions = getWsdlDefinitions();
      if (definitions != null)
      {
         WSDLTypes types = definitions.getWsdlTypes();
         if (types != null)
         {
            JBossXSModel model = WSDLUtils.getSchemaModel(types);
            if (model != null)
               model.eagerInitialize();
View Full Code Here

TOP

Related Classes of org.jboss.ws.metadata.wsdl.WSDLDefinitions

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.