Package org.eclipse.wst.wsdl.util

Examples of org.eclipse.wst.wsdl.util.WSDLResourceImpl


   * <!-- end-user-doc -->
   * @generated
   */
  public Resource createResource(URI uri)
  {
    Resource result = new WSDLResourceImpl(uri);
    return result;
  }
View Full Code Here


    // Create a resource set, create a wsdl resource, and load the main wsdl file into it.

    ResourceSet resourceSet = new ResourceSetImpl();
    resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("wsdl", new WSDLResourceFactoryImpl());

    WSDLResourceImpl wsdlMainResource = (WSDLResourceImpl)resourceSet.createResource(URI.createURI("*.wsdl"));
    wsdlMainResource.setURI(uri);

    try
    {
      InputStream inputStream = resourceSet.getURIConverter().createInputStream(uri);
      wsdlMainResource.load(inputStream, resourceSet.getLoadOptions());
      //wsdlMainResource.load(resourceSet.getLoadOptions());
    }
    catch (IOException e)
    {
      throw new WSDLException(WSDLException.INVALID_WSDL, "WSDL URI: " + wsdlURI, e);
    }

    // Return the definitions of the main resource.
    return wsdlMainResource.getDefinition();
  }
View Full Code Here

   */
  public Definition readWSDL(String documentBaseURI, InputSource inputSource) throws WSDLException
  {
    ResourceSet resourceSet = new ResourceSetImpl();
    resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("wsdl", new WSDLResourceFactoryImpl());
    WSDLResourceImpl wsdlMainResource = (WSDLResourceImpl)resourceSet.createResource(URI.createURI("*.wsdl"));

    try
    {
      if (documentBaseURI != null)
        wsdlMainResource.setURI(createURI(documentBaseURI));
      resourceSet.getLoadOptions().put(WSDLResourceImpl.CONTINUE_ON_LOAD_ERROR, new Boolean(false));
      wsdlMainResource.load(inputSource.getByteStream(), resourceSet.getLoadOptions());
    }
    catch (IOException ioe)
    {
      throw new WSDLException(WSDLException.INVALID_WSDL, "", ioe);
    }

    Definition definition = wsdlMainResource.getDefinition();
    if (definition != null)
      definition.setDocumentBaseURI(documentBaseURI);

    return definition;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.wst.wsdl.util.WSDLResourceImpl

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.