Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » Model contains "definitions", Ecore specifies "Definition"
Model contains "definitions", Ecore specifies "Definition" [message #869474] Thu, 03 May 2012 08:58 Go to next message
Tex Iano is currently offline Tex Iano
Messages: 99
Registered: February 2012
Member
Hi,

I want to load an WSDL file using ATL. I registered the WSDL.ecore from the Eclipse package:

Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("ecore",
				new EcoreResourceFactoryImpl());

ResourceSet rs = new ResourceSetImpl();
		Resource r = rs.getResource(URI.createURI("file:/C:/workspace/Trans/bin//metamodels/WSDL.ecore"), true);
		
		EObject eObject = r.getContents().get(0);
		if (eObject instanceof EPackage) {
		    EPackage p = (EPackage)eObject;
		    rs.getPackageRegistry().put(p.getNsURI(), p);
		    EPackage.Registry.INSTANCE.put("schemas.xmlsoap.org/wsdl/", p);

		}


When I start the transformation, I get this error:

org.eclipse.emf.ecore.resource.Resource$IOWrappedException: Class 'definitions' is not found or is abstract. (file:///C:/workspace/Trans/IN, 2, 273)
	at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.handleErrors(XMLLoadImpl.java:83)
	at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl.java:191)
	at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLResourceImpl.java:242)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1511)
	at org.eclipse.m2m.atl.drivers.emf4atl.EMFModelLoader.loadModel(EMFModelLoader.java:183)
	at Transformation.main(Transformation.java:143)


And of course he is right. In the WSDL.ecore there is no "definitions", only "Definition". So how does it map this discrepancy?

Is it really necessary to work with ecore? Why is there no XSD for WSDL that I can use?

Regards,

Tex
Re: Model contains "definitions", Ecore specifies "Definition" [message #869787 is a reply to message #869474] Fri, 04 May 2012 06:01 Go to previous message
Ed Merks is currently offline Ed Merks
Messages: 26014
Registered: July 2009
Senior Member
As I mentioned in your other posts, you'll really need to use the
generated model for WSDL and its specialized resource factory because
it's full of hand written logic for mapping the XML syntax to the
abstract component structure.

On 03/05/2012 2:58 PM, Tex Iano wrote:
> Hi,
>
> I want to load an WSDL file using ATL. I registered the WSDL.ecore
> from the Eclipse package:
>
>
> Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("ecore",
>
> new EcoreResourceFactoryImpl());
>
> ResourceSet rs = new ResourceSetImpl();
> Resource r =
> rs.getResource(URI.createURI("file:/C:/workspace/Trans/bin//metamodels/WSDL.ecore"),
> true);
>
> EObject eObject = r.getContents().get(0);
> if (eObject instanceof EPackage) {
> EPackage p = (EPackage)eObject;
> rs.getPackageRegistry().put(p.getNsURI(), p);
>
> EPackage.Registry.INSTANCE.put("schemas.xmlsoap.org/wsdl/", p);
>
> }
>
>
> When I start the transformation, I get this error:
>
>
> org.eclipse.emf.ecore.resource.Resource$IOWrappedException: Class
> 'definitions' is not found or is abstract.
> (file:///C:/workspace/Trans/IN, 2, 273)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.handleErrors(XMLLoadImpl.java:83)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl.java:191)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLResourceImpl.java:242)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1511)
> at
> org.eclipse.m2m.atl.drivers.emf4atl.EMFModelLoader.loadModel(EMFModelLoader.java:183)
> at Transformation.main(Transformation.java:143)
>
>
> And of course he is right. In the WSDL.ecore there is no
> "definitions", only "Definition". So how does it map this discrepancy?
>
> Is it really necessary to work with ecore? Why is there no XSD for
> WSDL that I can use?
> Regards,
>
> Tex
>
Previous Topic:ATLLauncher and ATL Virtual Machine
Next Topic:[QVTO] Large script - editor slow
Goto Forum:
  


Current Time: Tue Sep 02 05:13:41 EDT 2014

Powered by FUDForum. Page generated in 0.02092 seconds