MessageContract does not have parts in WSSF10

Topics: General Discussion Forum
Jun 11, 2010 at 4:59 PM
I recently upgrade to 2010 and whenever I go to validate my SC's i get "MessageContract does not have parts." This occurs on all of my contracts where I don't really care what kind of response I'm getting back from the service, I just need to know that it didn't error. Any help with this issue would be awesome because I'm not looking forwarding to throwing in a junk value for each SC just to make the contracts valid. Is this really a new requirement for service contracts in WSSF2010?
Aug 26, 2010 at 10:00 AM
Edited Aug 26, 2010 at 10:04 AM

Same issue here.

Upgraded from VS2008, DCs are OK. Validation for SCs fails because many 'MessageContracts does not have parts'.

Is there a workaroud for this? Is this a new requirement for WSSF?

As cmasonrun said, adding junk properties isn't great.

Developer
Aug 26, 2010 at 11:42 AM

I agree that adding properties to a MC just to pass a validation rules makes no sense. However I wonder why you are defining a MC if you don;t need to return any result. Im that case you can simply remove the MC from the Response operation property so the serivce contract will define a void return for this operation and therefore a "clean"contract. Remember that you will still be using a Request-Response message pattern and you can catch any exception from the service as long as you don;t set that operation as One Way (Is One Way property set to false). 

Regards,

Hernan

Aug 26, 2010 at 12:00 PM

Thank you for your quick answer.

In my case, missing parts are in input messages. I agree an empty message has no real meaning but removing those messages would imply tons of changes in the project.

Isn't there a way to generate code even if validation doesn't pass?

Developer
Aug 26, 2010 at 5:08 PM

If you need to disable that validation rule (code will be generated fine regardless), you can open the rules.config file located in the main installation folder for ""  and comment lines 307 to 310 which defines the "NotEmptyMessagePartCollectionValidator" that will check for existing message parts in a message contract.

After that you can re open VS and try to generate code.

Regards,

Hernan

Aug 27, 2010 at 8:28 AM

Thank you very much, it works :)

For further reference, the right config file was located in:
C:\Users\<user>\AppData\Local\Microsoft\VisualStudio\10.0\Extensions\Microsoft\Web Service Software Factory 2010\4.0\ruleset.config