7
Views
3
Comments
Solved
Output null values in SOAP request
Application Type
Service
Platform Version
11.8.2 (Build 15398)

I am trying to call an external SOAP web service with a couple of empty parameters. At the moment Outsystems is sending the request without including the empty parameters

  <Body>

    <SearchPremiseByPostcodeFlatOrNumber>

      <sPostcode>kt1 4bu</sPostcode>

    </SearchPremise_ByPostcodeFlatOrNumber>

  <Body>


What I would like is to have the request look like this

  <Body>

    <SearchPremiseByPostcodeFlatOrNumber>

      <sFlatOrBuildingName/>

      <sPremisesNumber/>

      <sPostcode>kt1 4bu</sPostcode>

    </SearchPremise_ByPostcodeFlatOrNumber>

  <Body>

Is this possible? 

Thanks

Mike

Rank: #116
Solution

Hello Mike,

Yes, that is possible.

Most likely, those fields are defined as non-mandatory (in OutSystems). If so, when they are empty, they will not be sent on the request to the external API.

Please, try to define those fields as mandatory and they should be sent on the request to the API (even if they are empty).


Hope that this helps you!


Kind regards,

Rui Barradas

Rank: #1749
Solution

Thanks Rui, yes you were mostly correct and your answer put me on the correct track. The option I needed to set was on the input parameters of the service call - I needed to set "Send Default Value" to true on each one.

Rank: #116
Solution

Hello Mike,

Yes, that is possible.

Most likely, those fields are defined as non-mandatory (in OutSystems). If so, when they are empty, they will not be sent on the request to the external API.

Please, try to define those fields as mandatory and they should be sent on the request to the API (even if they are empty).


Hope that this helps you!


Kind regards,

Rui Barradas

Rank: #1749
Solution

Thanks Rui, yes you were mostly correct and your answer put me on the correct track. The option I needed to set was on the input parameters of the service call - I needed to set "Send Default Value" to true on each one.