Problems with nfe's WSDL import

1

I have an error that I can not figure out what it is. I got the SWDL from NfeAuthorization (homologation) and used Axis2 to generate the classes. I solved some import and lib problems, but there are still some problems.

Excerpt from the code where the error occurred:

  org.apache.axiom.om.OMDataSource dataSource =new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME);
           return factory.createOMElement(dataSource,MY_QNAME);

First line error:

  

Can not instantiate the type ADBDataSource.

Second line error:

  

The method createOMElement (QName, OMContainer) in the type OMFactory   is not applicable for the arguments (OMDataSource, QName).

If I did the generation according to the WSDL, it should not have that kind of problem, right?

    
asked by anonymous 31.12.2014 / 13:30

1 answer

2

Generating files for communication is really costly and error prone.

Here at the company where I work, we had many problems with the classes generated by the axis, to the point that we only keep the generated stubs and reimplement the whole mapping. If you look at the generated classes, you will see that there is a lot of junk, duplicates and other "bad smells" in the code that, in some cases, can cause problems. Here we had problems with the namespaces in some cases and, as the classes were generated, it was difficult to change them.

The classes we implemented worked very well in version 2.0, and when we migrated to 3.10, we tried to find something on the internet that was well tested and reliable for us to use here and did not find. So we ended up releasing our own implementation after adapting to NFe 3.10. She is currently on link , if you are interested.

[] s

    
24.03.2015 / 23:12