Issues with nfe WSDL import

Asked

Viewed 512 times

1

I’m having an error that I can’t figure out what it is. I took the SWDL from Nfeauthorization (homologation) and used the Axis2 to generate the classes. I solved some import and lib problems, but there are still some problems.

Code snippet where error:

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

First line error:

Cannot instantiate the type Adbdatasource.

Error of the second line:

The method createOMElement(Qname, Omcontainer) in the type Omfactory is not applicable for the Arguments (Omdatasource, Qname).

If I made the generation according to the WSDL, it shouldn’t have that kind of problem, right?

  • By the error described, maybe it is the arguments passed to the method that are not correct (I can’t be sure), but there is no way to know if you do not tell where the variables come from this, MY_QNAME and dataSource and of type they are, post an example of the code that can be reproduced to generate the error.

  • @I ended up solving it in a strange way. When I had the bug, I had generated the classes with the newer version of Axis, then I took a slightly older version, generated them again, and ended up solving. I have no idea why it decided being that the generation was made the same way, only with an older version.

  • Good that solved, could inform something more about the generated classes? Mainly put in all question if possible (do not need to be your project, preferably try to reproduce your problem in a simpler version) and add your question (editing it) and provide the Axi version and or any other tool you used to generate.

1 answer

2

File generation for communication really is costly and error prone.

Here at the company where I work, we had many problems with the classes generated by Axis, to the point that we only kept the generated stubs and reimplemented 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 generate problems. Here we had problems with namespaces in some cases and, as 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 to use here and did not find. So, we ended up releasing our own implementation, after the adaptation to Nfe 3.10. It is currently in https://github.com/wmixvideo/nfe, if you’re interested.

[]s

Browser other questions tagged

You are not signed in. Login or sign up in order to post.