cancel
Showing results for 
Search instead for 
Did you mean: 

Missing mandatory field error on element contained in optional object

Highlighted
New Contributor

Missing mandatory field error on element contained in optional object

I am just learning to use SoapUI and I am encountering a missing mandatory field error when one of my optional request elements for a SOAP API contains a mandatory element. You can see in attached image that 'owner' is mandatory on 'changeNotice', but 'changeNotice' is optional on 'rev'. How do I avoid this error?MandatoryMissing.jpg

2 REPLIES 2
Highlighted
Community Leader

Re: Missing mandatory field error on element contained in optional object

Hi @stevemcw,

 

I think this error is generating because owner tag is incorrect.

Either you remove it completly or do like: <owner> </owner>

 

 


Click "Accept as Solution" if my answer has helped, and remember to give "kudos" 🙂

Thanks and Regards,
Himanshu Tayal
Highlighted
New Contributor

Re: Missing mandatory field error on element contained in optional object

I think the picture I posted mistakenly had the node collapsed so the owner tag looked wrong.

Anyway, on further testing, it looks like the problem might be that the wChangeNotice class contains some other elements which also contain wChangeNotices, etc. recursively. 

While the first occurrence (pic on left) is fully specified, the later wChangeNotice (pic on right) is just an empty tag. Anyway, I just removed all the optional fields and got my test case to run correctly.

CN1.jpgCN2.jpg

New Here?
Join us and watch the welcome video:
Top Kudoed Authors