SoapCore icon indicating copy to clipboard operation
SoapCore copied to clipboard

[WIP] Fix for issue #326: MessageBodyMemberAttribute.Name is being ignored.

Open paleocomburo opened this issue 5 years ago • 1 comments

I have made a simple addition to MessageBodyMemberAttribute is handled always if the parent object has a MessageContractAttribute. Before it was only handled if that attribute was set to "IsWrapped = false".

I have manually verified it works, but, as per contributing guidelines, I want to add relevent unit-tests. But I have no idea where to start. I saw existing serialization tests, but these are not helpful because this is about the XML being generated. A class can perfectly serialize data wrong and deserialze that same wrong output back again. We need to know the serialization is not wrong. The raw SOAP 1.2 tests seem more like the thing I need, but then I would have to write the necessary plumbing to make those tests possible. Just adding them to the existing SOAP 1.2 tests seem incorrect as this has nothing the to with SOAP 1.2 specifically.

Any guidance?

paleocomburo avatar Sep 12 '19 15:09 paleocomburo

Hi! Thanks for having a crack at this functionality. With regards to your question:

Adding to the SOAP 1.2 tests is probably good enough coverage to start with. IMO tackle it in that way first if you don't want to duplicate the plumbing, alternatively you could look at making the plumbing better configurable. I have no specific suggestions with how you'd make it better configurable. The conclusion may be to just duplicate the existing plumbing (maybe it makes sense to!)

A question I have after consulting this (I have not had the opportunity to pull the code and review in full yet) --

Are you planning on implementing support for WrapperName and WrapperNamespace of MessageContractAttribute?

The MessageContractAttribute allows you to specify the WrapperName and WrapperNamespace attributes which control the name of the wrapper element in the body of the SOAP message. By default the name of the message contract type is used for the wrapper and the namespace in which the message contract is defined http://tempuri.org/ is used as the default namespace.

That would complete the picture for this attribute :)

Simon-Campbell avatar Oct 03 '19 08:10 Simon-Campbell

Closing this PR. Please resolve conflicts and re-open if still relevant

andersjonsson avatar Oct 24 '22 11:10 andersjonsson