-
Notifications
You must be signed in to change notification settings - Fork 391
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NRCS Envelope Fault #17
Comments
It seems to be a namespace issue. Go XML package doesn't support namespace prefixes yet but it does set the namespace attribute on each element explicitly instead. That NRCS service doesn't seem to be aware of this and is rejecting what I would consider a valid SOAP request that is at the same time WS-I compliant. Assuming they are using Java, by default the native Java DOMBuilderFactory is configured to ignore namespaces, thus |
If you could give some direction, I could try working something out. I also actually know some of the people that work for the NRCS on this service in particular, although unlikely, might be able to do something on that end. |
FWIW, I did improve a little bit error reporting when SOAP faults are received: 8cdcd28 |
@EntilZha these guys ran somewhat into a similar issue and worked around it: https://bitbucket.org/anacrolix/dms/commits/fbd23ce |
Regarding direction, I would start by reading how the Go xml package is currently dealing with namespaces to see if they can be easily defined at the top of the XML document, using prefixes. In other words, I would try to tackling this issue: https://code.google.com/p/go/issues/detail?id=6800 |
So just to test my understanding, the issue is the xmlns attribute on the getStations element? If it were not there, it would work correctly (it is not related to the "tns" in tns:getStations)? So the "fix" would be figuring out a way to stick this at the top of the xml doc? |
Yes, it has to be replaced by a namespace prefix in the element instead.
Yes, and setting the namespace with the prefix like so |
I look forward to seeing how you guys deal with this. As far as I'm concerned XML is an unfortunate necessity and poorly supported by the Go standard library. I also found that Go's "size optimizations" regarding " and ' caused problems with some decoders. |
Any advice on where I might learn to get an idea of what I will need to do in order to accomplish that? (Reading through the prior link, wondering other resources to in general get knowledge required since I am not super savy on xml/soap prior to this) |
Hey @EntilZha, apologies for the very late response. So, in addition to what I previously mentioned regarding how to start tackling this issue, I would also suggest asking in the golang-dev mailing list. By the way, the issue was moved to golang/go#6800. |
I ended up on using Scala for this project in part for native support through existing Java libraries (in part from preference) and am too busy to work on this separately. If I end up having time in the future, I will take your advice though. Thanks |
I was able to resolve this issue by using another package : https://github.com/jteeuwen/go-pkg-xmlx , this package transformed the xml into an node struct, which I was then able to parse and reassign the name spaces in accordance to the headers. Then perform a SaveDoc and voila nicely marshelled document |
@notzippy, nice! do you think we could use that library in gowsdl? |
Hoping to, I am working through a solution... will let you know what I have in the form of a PR later |
ah, great! thank you! |
Got around to working more on the NRCS wsdl service I was interested. Ran into another problem, like before open to helping, but some insight/maybe fix would be great. I am using the code from #15
Below is what I wrote additionally to query all stations which are also snotels, so using networkCd of SNTL.
When I do this, I get the following error:
PANIC: expected element type <getStationsResponse> but have <Fault>
Wireshark shows these request contents, couldn't find a way to copy/paste so they are images
Here is the wireshark of my pre-existing ruby code that makes a successful request.
Thanks and let me know how else I can help with info/etc
The text was updated successfully, but these errors were encountered: