hooklift / gowsdl

WSDL2Go code generation as well as its SOAP proxy
Mozilla Public License 2.0
1.16k stars 392 forks source link

add nillable=true support for data fields #193

Closed moihn closed 3 years ago

moihn commented 3 years ago

Hi,

Thanks for this gowsdl project, it helped a lot in our project. This is our 2 cents in supporting nillable=true attribute of WSDL, so that nillable fields can be identified in SOAP request and response, especially for fields of integer data types(int, int32, etc...).

We tried to read the gowsdl code generator design, and if we misunderstood anything, please don't hesitate to let us know, and we can update our code to make them right.

Thanks and regards

c4milo commented 3 years ago

I really appreciate the contribution @moihn, Thank you 🙌 .

Did you test this PR with your WSDL and it worked fine? is this backwards compatible?

moihn commented 3 years ago

Yes, it works so far so good with our SOAP services. I think it is backward compatible for fields with nillable="false". But where nillable="true", I am not sure it is intended to be backward compatible, as this was zero initialized by Go in current master branch, and is never a nil value, so there is kind of semantics difference. Let me know if you have any concern.

crazydadz commented 3 years ago

Hi guys, it seems that multiple tests fail since that PR was merged.

Ex: genTypes error template: types:43:59: executing "Attributes" at <.Nillable>: can't evaluate field Nillable in type *gowsdl.XSDAttribute

Thanks!

moihn commented 3 years ago

I will try to take a look this weekend.

moihn commented 3 years ago

New PR fixing the issue is created here : https://github.com/hooklift/gowsdl/pull/194