-
Notifications
You must be signed in to change notification settings - Fork 397
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
Error unmarshalling responses from VirtualBox vboxwebsrv #37
Comments
Can you confirm if the issue is similar to the one described here? #17. My comment on it here: #17 (comment) |
@c4milo I think this is a different problem. In that case, the NRCS web service is rejecting the request created by In my case, the problem is with unmarshalling the response returned by the web service. Specifically, the fact that the Line 133 in 8413716
|
Looks like there's a proposal to expose the namespace bindings in the decoder: golang/go#12406 This could help with this issue, though it doesn't help with Go 1.5. |
I managed to write some code that I think does the right thing for dynamic unmarshalling: https://github.com/md5/gowsdl-vboxwebsrv-test/blob/0f89b3888adf2c3ccb06b69dceec39c669783e97/unmarshal.go It's getting late for me here, but I may have some time in the next few days to try to work it into a PR for Please bear in mind that I'm still learning Go, so I may have done some silly things here... |
hey @md5, thanks for looking into this. I think you are definitely on the right track. We need to parse the whole response in one shoot so namespaces declared at the root of the document are considered. |
I'm trying to use
gowsdl
to generate code to interface with VirtualBox'svboxwebsrv
SOAP service, but I'm running into namespace issues.My test code can be found here: https://github.com/md5/gowsdl-vboxwebsrv-test, including the generated service code, but the stripped-down test file looks like this:
When I run it with
go run test.go
, I get the following error:After looking through the
gowsdl
code, it appears that the issue is that the<vbox:IWebsessionManager_logonResponse><returnval>954ddf3e6d57d58b-000000000000000a</returnval></vbox:IWebsessionManager_logonResponse>
body is being unmarshalled by an instance ofxml.Decoder
that no longer has thexmlns:vbox="http://www.virtualbox.org/"
namespace mapping.Any advice you can provide here would be appreciated. It seems like
gowsdl
might need to use something lower level thanxml.Unmarshal
to allow the samexml.Decoder
to decode the entire SOAP payload and maintain its namespace mappings.Here's my Go version:
The text was updated successfully, but these errors were encountered: