Hi,
I am also facing a similar situation. Anybody got any idea.....
I need to remove the empty tags that are coming in the response, even if not
set in the server side. I want to remove the empty tags from the response coming
from the axis2 deployed service as .aar
The same is working fine using JBoss4.2.2 deployment where the empty tags are automatically
removed while sending back the response to client. I verified the empty tags in the etheral logs as well
as through soap UI.
sample response with empty tags...
-----------------------------------------------------------------------------------
<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
<soapenv:Body>
<ns:createProfileResponse xmlns:ns="http://example">
<ns:return xmlns:ax230="http://example/xsd" type="example.Response">
<ax230:desc xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
<ax230:respCode>0000</ax230:respCode>
<ax230:respStr>Your name - hello, Age- 1</ax230:respStr>
<ax230:tokenId xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
</ns:return>
</ns:createProfileResponse>
</soapenv:Body>
</soapenv:Envelope>
-----------------------------------------------------------------------------------
The last tag (attribute) is empty tag which I don't want in soap response at all. This is something to
do with backward compatibility. If the older client does not know of a newly added attribute/tag in
the new version, it will fail while parsing the response. This is not an issue with both the server and clients
as
java but will be an issue if the client is non java and will fail.
what I want is the following without the empty tag...
-----------------------------------------------------------------------------------
<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
<soapenv:Body>
<ns:createProfileResponse xmlns:ns="http://example">
<ns:return xmlns:ax230="http://example/xsd" type="example.Response">
<ax230:desc xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
<ax230:respCode>0000</ax230:respCode>
<ax230:respStr>Your name - hello, Age- 1</ax230:respStr>
</ns:return>
</ns:createProfileResponse>
</soapenv:Body>
</soapenv:Envelope>
-----------------------------------------------------------------------------------
Ideally spaking if any empty tag is there it should be removed by default which works fine if
I deploy the service in
JBoss. But is not if I deploy it on Axis2 +
Tomcat environment.
Thanks in advance...