How to exclude nillable elements from the response of an Admin Service

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

How to exclude nillable elements from the response of an Admin Service

Hasini Witharana
Hi All,

I have added a new attribute "element1" to SAMLSSOServiceProviderDTO. Admin service IdentitySAMLSSOConfigService  has been changed by that addition. "element1" is represented in the WSDL as follows.

<xs:element minOccurs="0" name="element1" nillable="true" type="xs:string"/>
For an existing Service provider when the getServiceProviders method is called the "element1" returns null. The response is shown below.

<ax2429:element1 xsi:nil="true"/>

For the backward compatibility when an existing client call the Admin Service, the null values should not be present. Is there a way to omit such empty elements when the admin service is called?

Thank You.
Hasini
--
Hasini Witharana | Software Engineer | WSO2 Inc
(m) 0766435725 | (w) 0713850143 | (e) [hidden email]


_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: How to exclude nillable elements from the response of an Admin Service

Hasini Witharana
Hi All,

I added the "@XmlElement"

On Thu, Feb 7, 2019 at 7:03 PM Hasini Witharana <[hidden email]> wrote:
Hi All,

I have added a new attribute "element1" to SAMLSSOServiceProviderDTO. Admin service IdentitySAMLSSOConfigService  has been changed by that addition. "element1" is represented in the WSDL as follows.

<xs:element minOccurs="0" name="element1" nillable="true" type="xs:string"/>
For an existing Service provider when the getServiceProviders method is called the "element1" returns null. The response is shown below.

<ax2429:element1 xsi:nil="true"/>

For the backward compatibility when an existing client call the Admin Service, the null values should not be present. Is there a way to omit such empty elements when the admin service is called?

Thank You.
Hasini
--
Hasini Witharana | Software Engineer | WSO2 Inc
(m) 0766435725 | (w) 0713850143 | (e) [hidden email]



--
Hasini Witharana | Software Engineer | WSO2 Inc
(m) 0766435725 | (w) 0713850143 | (e) [hidden email]


_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: How to exclude nillable elements from the response of an Admin Service

Hasini Witharana
In reply to this post by Hasini Witharana
Hi All,

Sorry for the previous reply.

I have added "@XmlElement( name = "element1")" annotation on top of the attribute "element1" and its get method. According to [1], this annotation should exclude null elements. [2] [3] and [4] are some resources that is useful for the solution. Still the nillable elements are not excluded from the response.


Thank You.
Hasini

On Thu, Feb 7, 2019 at 7:03 PM Hasini Witharana <[hidden email]> wrote:
Hi All,

I have added a new attribute "element1" to SAMLSSOServiceProviderDTO. Admin service IdentitySAMLSSOConfigService  has been changed by that addition. "element1" is represented in the WSDL as follows.

<xs:element minOccurs="0" name="element1" nillable="true" type="xs:string"/>
For an existing Service provider when the getServiceProviders method is called the "element1" returns null. The response is shown below.

<ax2429:element1 xsi:nil="true"/>

For the backward compatibility when an existing client call the Admin Service, the null values should not be present. Is there a way to omit such empty elements when the admin service is called?

Thank You.
Hasini
--
Hasini Witharana | Software Engineer | WSO2 Inc
(m) 0766435725 | (w) 0713850143 | (e) [hidden email]



--
Hasini Witharana | Software Engineer | WSO2 Inc
(m) 0766435725 | (w) 0713850143 | (e) [hidden email]


_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: How to exclude nillable elements from the response of an Admin Service

Sagara Gunathunga-2
In reply to this post by Hasini Witharana


Check whether any of the following help you, please use any version after Apache Axis2 1.7. 


Thanks ! 
On Thu, Feb 7, 2019 at 7:06 PM Hasini Witharana <[hidden email]> wrote:
Hi All,

I added the "@XmlElement"

On Thu, Feb 7, 2019 at 7:03 PM Hasini Witharana <[hidden email]> wrote:
Hi All,

I have added a new attribute "element1" to SAMLSSOServiceProviderDTO. Admin service IdentitySAMLSSOConfigService  has been changed by that addition. "element1" is represented in the WSDL as follows.

<xs:element minOccurs="0" name="element1" nillable="true" type="xs:string"/>
For an existing Service provider when the getServiceProviders method is called the "element1" returns null. The response is shown below.

<ax2429:element1 xsi:nil="true"/>

For the backward compatibility when an existing client call the Admin Service, the null values should not be present. Is there a way to omit such empty elements when the admin service is called?

Thank You.
Hasini
--
Hasini Witharana | Software Engineer | WSO2 Inc
(m) 0766435725 | (w) 0713850143 | (e) [hidden email]



--
Hasini Witharana | Software Engineer | WSO2 Inc
(m) 0766435725 | (w) 0713850143 | (e) [hidden email]



--
Sagara Gunathunga | Director | WSO2 Inc.
(m) +94712149951 | (w) +94 11 7435800 | (e) [hidden email]




_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev