Model contains "definitions", Ecore specifies "Definition" [message #869474] |
Thu, 03 May 2012 12:58 |
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 10:01 |
Ed Merks Messages: 33224 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
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.04106 seconds