Skip to content
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

Implement xml.Unmarshaller for SOAPBody #43

Merged
merged 1 commit into from
Sep 16, 2015
Merged

Implement xml.Unmarshaller for SOAPBody #43

merged 1 commit into from
Sep 16, 2015

Conversation

md5
Copy link
Contributor

@md5 md5 commented Sep 16, 2015

I'm opening this PR to get some feedback since I'm very new at writing Go code.

These changes allow unmarshalling and marshalling to happen in a single pass, which allows a broader range of SOAP responses to be parsed. In particular, it handles the case where the xmlns used on the <SOAP-ENV:Body> entries is declared on a parent element instead of on the entry itself.

I would have liked to add some tests here, but I'm not clear on how to structure tests that use the generated code from soap_tmpl.go. I'm happy to add some tests if someone can give me some pointers on how to do so. I was able to run make test, so I at least don't think I broke any of the existing tests.

Fixes #37

Allows unmarshalling to happen in a single pass

Fixes #37
@md5
Copy link
Contributor Author

md5 commented Sep 16, 2015

BTW, I used my modified version of gowsdl to start working on a client for VirtualBox here: https://github.com/appropriate/go-virtualboxclient

@c4milo
Copy link
Member

c4milo commented Sep 16, 2015

This looks good to me @md5. Thank you!

c4milo added a commit that referenced this pull request Sep 16, 2015
Implement xml.Unmarshaller for SOAPBody
@c4milo c4milo merged commit bf87138 into hooklift:master Sep 16, 2015
@md5 md5 deleted the single-pass-unmarshal branch September 17, 2015 01:48
@md5
Copy link
Contributor Author

md5 commented Sep 17, 2015

Thanks @c4milo 👍

I'm still willing to add some tests in this area, assuming I can get a start in the right direction. Perhaps @sanbornm might have some ideas here.

@sanbornm
Copy link
Collaborator

@md5 I think we need to figure out how to check if our generated code would compile or not. We are currently testing it by running it through go fmt (https://github.com/hooklift/gowsdl/blob/master/gowsdl_test.go#L56) which catches a lot of errors but I am not sure it checks everything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants