Skip to Content (Press Enter)
OutSystems.com
Personal Edition
Community
Support
Training
Training
Online Training
Developer Schools
Boot Camps
Certifications
Tech Talks
Documentation
Documentation
Overview
ODC
O11
Forums
Forge
Get Involved
Get Involved
Jobs
Ideas
Members
Mentorship
User Groups
Platform
Platform
ODC
O11
Search in OutSystems
Log in
Get Started
Back to Forums
Dror Svartzman
147
Views
7
Comments
Passing empty values to structure
Question
Hi,
I have the following scenario:
1. Web service pass structure as a parameter to the web method
2. None of the attribute in the structure are mandatory, no value is set as a default
3. Consumer can fill in one or more attributes in the structure.
5. Web service converts the structure to xml
At this point, even If the consumer did not fill all the attributes, Outsystems will still take the default values for the empty ones. Integer values will receive 0, text - "" and so on...
Is there a way to bypass this behaivor, i.e empty values will be ignore and no XML Attribute element will be created for them?
Many thanks,
Dror
João Portela
Staff
Hi Dror,
I think there is no workaround to avoid sending non-mandatory values in the web-service response.Since all values have values (Platform default value instead of NULL), the .net web-services will send them in the web-service response.
You could add a "dummy" attribute indicating that the field is empty/null.
Regards,
João Portela
Dror Svartzman
João hi,
I have over 30 attributes on that structure. Creating a dummy structure to simulate value entry seems a bit cumbersome to me. Currently, values entry on the consumer side is done on design time (In the future it might have interface bound to it).
I've tried setting "magic"default values on the attribute of the designated web service. However, consumer ignores these values and pass the platform defaults....
There is no other way the platfom can tuckle an empty values?
Dror
João Portela
Staff
Hi Dror,
I'm assuming that each structure field could be null, right? In this case you would need to create a "clone" stucture with boolean fields, a little "a bit cumbersome" as you wrote.
Since the Platform will always send all the structure fields, you can add "semantics" to the structure fields' default value. For instance you can set the default value of an integer to -999999 and assume that when this value is passed it's a NULL value. It's not a optimum solution but at least you don't need to pass another stucture.
A drastic solution would pass to do it in csharp code using an extension...
Regards,
João Portela
Dror Svartzman
João hi,
I've used a solution which i'm not to proud of but it does i.e work - use text data type for all attribute. It's not type safe, and it relies on the user to enter valid values.However, at the moment, it's still done on design time, so i relie on the programmers credibility...
I find it weird that the structures, imported by the webservice through the WSDL, only import attribute name and datatype but disregard attributes such as default or description.
Regards,
Dror Svartzman
João Portela
Staff
Hi,
You should report these problems (as missing descriptions and fields default values) using Service Studio submit feedback or an email to OutSystems Product Support (support@outsystems.com). They will validate your request and forward it to the Product Management (if a product change request) or to the Product Maintenance (if a defect / missing feature).
Users/developers feedback if very important to improve the OutSystems Agile Platform.
BTW, you can submit feedback in Service Studio -> Help menu in the toolbar -> "Submit Feedback" option.
Regards,
João Portela
Dror Svartzman
O.K . I will. i thought it is behaivor by design.
10X!
Dror
Sugappa Badiger
Hi All,
I am also running into same situation. So, was there any solution found for this? Please let me know, your help is highly appreciated.
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
See the full guidelines
Loading...