Axis2 Corba webservices using JSON

Serban Mihai <[email protected]> Wed, 25 Jun 2025 13:19:11 +0300
Newsgroups gmane.text.xml.axis.user
Message-ID <CAOq3TpTJtyxge8NUUHs7AkOnUZfw_Bn28-JDSTp-v2t7kbfbfQ@mail.gmail.com>
--0000000000004f5696063862c756
Content-Type: text/plain; charset="UTF-8"

Hello all,

Over the past few weeks we have spent some time migrating our corba
services to webservices using Axis2. We managed to enable JSON support
using the Badgerfish convention and, since it does not require any
additional configuration, it worked as expected just by following the
documentation. However, due to the enhanced readability of the Mapped
convention in our use-case it would be preferrable - but we are facing some
issues.

I have tried following the documentation: update axis2.xml, then add the
following to the "SysM.xml" file (which corresponds to the "SysM.idl" file):
<mappings>
    <mapping xmlNamespace="http://SM/xsd <http://sm/xsd>" jsonNamespace=""/>
</mappings>

But this does not seem to have any effect, since on this request:
$ curl -H 'Content-Type: application/json' -d '{"geMgrIPs":{"MgrIPs":""}}'
https://<ip>/AXIS/services/SysM

I am getting this error (see full error at the end of this email):
{"Fault":"<soapenv:Fault xmlns:soapenv=\"
http://schemas.xmlsoap.org/soap/envelope/\
"><faultcode>soapenv:Server<\/faultcode><faultstring>*namespace mismatch
require http://SM/xsd <http://sm/xsd> found none*
<\/faultstring><detail>...<\/detail><\/soapenv:Fault>"}

I notice that the error is related to the namespace and is returned in JSON
format - to me this would mean that JSON Mapped convention handling is
enabled, however the namespace is not mapped accordingly. It seems that the
SysM.xml file is not an equivalent of the "services.xml" file - does it
only handle the corba-specific fields? Is there a way to enable the Mapped
convention on corba services?

Any insight on this issue would be much appreciated.

Thank you,
Serban

Maybe useful:
*Working example with Badgerfish convention:*
Request:
$ curl -H 'Content-Type: text/json' -d '{"xsl:getMgrIPs": {"@xmlns":
{"xsl": "http://SM/xsd <http://sm/xsd>"}, "MgrIPs": {"$":""}}}' https://
<ip>/AXIS/services/SysM

Response:
{"ns:getMgrIPsResponse":{"@xmlns":{"ns":"http://SM/xsd <http://sm/xsd>
"},"return":{"$":"0"},"MgrIPs":{"item":[{"@xmlns":{"$":"http://SM/xsd
<http://sm/xsd>"},"$":"<ip0>"},{"$":"<ip1>"},{"$":"<ip2>"}]}}}

*The full error taken from the logs:*
ERROR [2025-06-23 14:28:48,614] [org.apache.axis2.util.OnDemandLogger] -
processAxisFault() on error message: namespace mismatch require
http://SM/xsd <http://sm/xsd> found none , found a null HTTP status
from the MessageContext instance, setting HttpServletResponse status to
HttpServletResponse.SC_INTERNAL_SERVER_ERROR
org.apache.axis2.AxisFault: namespace mismatch require http://SM/xsd
<http://sm/xsd> found none
        at
org.apache.axis2.corba.receivers.CorbaMessageReceiver.invoke(CorbaMessageReceiver.java:102)
~[axis2-corba-2.0.0.jar:2.0.0]
        at
org.apache.axis2.corba.receivers.CorbaMessageReceiver.invokeBusinessLogic(CorbaMessageReceiver.java:53)
~[axis2-corba-2.0.0.jar:2.0.0]
        at
org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:40)
~[axis2-kernel-2.0.0.jar:2.0.0]
        at
org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:106)
~[axis2-kernel-2.0.0.jar:2.0.0]
        at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:169)
~[axis2-kernel-2.0.0.jar:2.0.0]
        at
org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:181)
~[axis2-transport-http-2.0.0.jar:2.0.0]
        at
org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:175)
[axis2-transport-http-2.0.0.jar:2.0.0]
        at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:590)
[tomcat-servlet-6.0-api.jar:6.0]
        at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:658)
[tomcat-servlet-6.0-api.jar:6.0]
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:195)
[catalina.jar:10.1.34]
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140)
[catalina.jar:10.1.34]
        at
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
[tomcat-websocket.jar:10.1.34]
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:164)
[catalina.jar:10.1.34]
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140)
[catalina.jar:10.1.34]
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:167)
[catalina.jar:10.1.34]
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90)
[catalina.jar:10.1.34]
        at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:483)
[catalina.jar:10.1.34]
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:115)
[catalina.jar:10.1.34]
        at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93)
[catalina.jar:10.1.34]
        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
[catalina.jar:10.1.34]
        at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:344)
[catalina.jar:10.1.34]
        at
org.apache.coyote.ajp.AjpProcessor.service(AjpProcessor.java:431)
[tomcat-coyote.jar:10.1.34]
        at
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63)
[tomcat-coyote.jar:10.1.34]
        at
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:905)
[tomcat-coyote.jar:10.1.34]
        at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1741)
[tomcat-coyote.jar:10.1.34]
        at
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52)
[tomcat-coyote.jar:10.1.34]
        at
org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1190)
[tomcat-util.jar:10.1.34]
        at
org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
[tomcat-util.jar:10.1.34]
        at
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:63)
[tomcat-util.jar:10.1.34]
        at java.base/java.lang.Thread.run(Thread.java:858) [?:?]

--0000000000004f5696063862c756
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hello all,<div><br><div>Over the past few weeks we have sp=
ent some time migrating our corba services to webservices using Axis2. We m=
anaged to enable JSON support using the Badgerfish convention and, since it=
 does not require any additional configuration, it worked as expected just =
by following the documentation. However, due to the enhanced readability of=
 the Mapped convention in our use-case it would be preferrable - but we are=
 facing some issues.</div></div><div><br></div><div>I have tried following =
the documentation: update axis2.xml, then add the following to the &quot;Sy=
sM.xml&quot; file (which corresponds to the &quot;SysM.idl&quot; file):</di=
v><div><font face=3D"monospace">&lt;mappings&gt;<br>=C2=A0 =C2=A0 &lt;mappi=
ng xmlNamespace=3D&quot;<a href=3D"http://sm/xsd" target=3D"_blank">http://=
SM/xsd</a>&quot; jsonNamespace=3D&quot;&quot;/&gt;</font></div><div><font f=
ace=3D"monospace">&lt;/mappings&gt;</font></div><div><br></div><div>But thi=
s does not seem to have any effect, since on this request:</div><div><font =
face=3D"monospace">$ curl -H &#39;Content-Type: application/json&#39; -d &#=
39;{&quot;geMgrIPs&quot;:{&quot;MgrIPs&quot;:&quot;&quot;}}&#39; https://</=
font><span style=3D"font-family:monospace">&lt;ip&gt;</span><font face=3D"m=
onospace">/AXIS/services/SysM</font></div><div><br></div><div>I am getting =
this error (see full error at the end of this email):=C2=A0</div><div><font=
 face=3D"monospace">{&quot;Fault&quot;:&quot;&lt;soapenv:Fault xmlns:soapen=
v=3D\&quot;<a href=3D"http://schemas.xmlsoap.org/soap/envelope/%5C" target=
=3D"_blank">http://schemas.xmlsoap.org/soap/envelope/\</a>&quot;&gt;&lt;fau=
ltcode&gt;soapenv:Server&lt;\/faultcode&gt;&lt;faultstring&gt;<b>namespace =
mismatch require=C2=A0<a href=3D"http://sm/xsd" target=3D"_blank">http://SM=
/xsd</a>=C2=A0found none</b>&lt;\/faultstring&gt;&lt;detail&gt;...&lt;\/det=
ail&gt;&lt;\/soapenv:Fault&gt;&quot;}</font></div><div><br></div><div>I not=
ice that the error is related to the namespace and is returned in JSON form=
at - to me this would mean that JSON Mapped convention handling is enabled,=
 however the namespace is not mapped accordingly. It seems that the SysM.xm=
l file is not an equivalent of the &quot;services.xml&quot; file - does it =
only handle the corba-specific fields? Is there a way to enable the Mapped =
convention on corba services?<br></div><div><br></div><div>Any insight on t=
his issue would be much appreciated.</div><div><br></div><div>Thank you,</d=
iv><div>Serban</div><div><br></div><div>Maybe useful:</div><div><b>Working =
example with Badgerfish convention:</b></div><div>Request:</div><div><font =
face=3D"monospace">$ curl -H &#39;Content-Type: text/json&#39; -d &#39;{&qu=
ot;xsl:getMgrIPs&quot;: {&quot;@xmlns&quot;: {&quot;xsl&quot;: &quot;<a hre=
f=3D"http://sm/xsd" target=3D"_blank">http://SM/xsd</a>&quot;}, &quot;MgrIP=
s&quot;: {&quot;$&quot;:&quot;&quot;}}}&#39; https://&lt;ip&gt;/AXIS/servic=
es/SysM</font></div><div><br></div><div>Response:</div><div><font face=3D"m=
onospace">{&quot;ns:getMgrIPsResponse&quot;:{&quot;@xmlns&quot;:{&quot;ns&q=
uot;:&quot;<a href=3D"http://sm/xsd" target=3D"_blank">http://SM/xsd</a>&qu=
ot;},&quot;return&quot;:{&quot;$&quot;:&quot;0&quot;},&quot;MgrIPs&quot;:{&=
quot;item&quot;:[{&quot;@xmlns&quot;:{&quot;$&quot;:&quot;<a href=3D"http:/=
/sm/xsd" target=3D"_blank">http://SM/xsd</a>&quot;},&quot;$&quot;:&quot;&lt=
;ip0&gt;&quot;},{&quot;$&quot;:&quot;</font><span style=3D"font-family:mono=
space">&lt;ip1&gt;</span><font face=3D"monospace">&quot;},{&quot;$&quot;:&q=
uot;</font><span style=3D"font-family:monospace">&lt;ip2&gt;</span><font fa=
ce=3D"monospace">&quot;}]}}}</font></div><div><br></div><div><b>The full er=
ror taken from the logs:</b></div><div><font face=3D"monospace">ERROR [2025=
-06-23 14:28:48,614] [org.apache.axis2.util.OnDemandLogger] - processAxisFa=
ult() on error message: namespace mismatch require=C2=A0<a href=3D"http://s=
m/xsd" target=3D"_blank">http://SM/xsd</a>=C2=A0found none , found a null H=
TTP status<br>from the MessageContext instance, setting HttpServletResponse=
 status to HttpServletResponse.SC_INTERNAL_SERVER_ERROR<br>org.apache.axis2=
.AxisFault: namespace mismatch require=C2=A0<a href=3D"http://sm/xsd" targe=
t=3D"_blank">http://SM/xsd</a>=C2=A0found none<br>=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 at org.apache.axis2.corba.receivers.CorbaMessageReceiver.invoke(CorbaMe=
ssageReceiver.java:102) ~[axis2-corba-2.0.0.jar:2.0.0]<br>=C2=A0 =C2=A0 =C2=
=A0 =C2=A0 at org.apache.axis2.corba.receivers.CorbaMessageReceiver.invokeB=
usinessLogic(CorbaMessageReceiver.java:53) ~[axis2-corba-2.0.0.jar:2.0.0]<b=
r>=C2=A0 =C2=A0 =C2=A0 =C2=A0 at org.apache.axis2.receivers.AbstractInOutMe=
ssageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:40) ~[a=
xis2-kernel-2.0.0.jar:2.0.0]<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 at org.apache.a=
xis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java=
:106) ~[axis2-kernel-2.0.0.jar:2.0.0]<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 at org=
.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:169) ~[axis2-kernel=
-2.0.0.jar:2.0.0]<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 at org.apache.axis2.transp=
ort.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:=
181) ~[axis2-transport-http-2.0.0.jar:2.0.0]<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0=
 at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:175=
) [axis2-transport-http-2.0.0.jar:2.0.0]<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 at =
jakarta.servlet.http.HttpServlet.service(HttpServlet.java:590) [tomcat-serv=
let-6.0-api.jar:6.0]<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 at jakarta.servlet.http=
.HttpServlet.service(HttpServlet.java:658) [tomcat-servlet-6.0-api.jar:6.0]=
<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 at org.apache.catalina.core.ApplicationFilt=
erChain.internalDoFilter(ApplicationFilterChain.java:195) [catalina.jar:10.=
1.34]<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 at org.apache.catalina.core.Applicatio=
nFilterChain.doFilter(ApplicationFilterChain.java:140) [catalina.jar:10.1.3=
4]<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 at org.apache.tomcat.websocket.server.WsF=
ilter.doFilter(WsFilter.java:51) [tomcat-websocket.jar:10.1.34]<br>=C2=A0 =
=C2=A0 =C2=A0 =C2=A0 at org.apache.catalina.core.ApplicationFilterChain.int=
ernalDoFilter(ApplicationFilterChain.java:164) [catalina.jar:10.1.34]<br>=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 at org.apache.catalina.core.ApplicationFilterCh=
ain.doFilter(ApplicationFilterChain.java:140) [catalina.jar:10.1.34]<br>=C2=
=A0 =C2=A0 =C2=A0 =C2=A0 at org.apache.catalina.core.StandardWrapperValve.i=
nvoke(StandardWrapperValve.java:167) [catalina.jar:10.1.34]<br>=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 at org.apache.catalina.core.StandardContextValve.invoke(S=
tandardContextValve.java:90) [catalina.jar:10.1.34]<br>=C2=A0 =C2=A0 =C2=A0=
 =C2=A0 at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authe=
nticatorBase.java:483) [catalina.jar:10.1.34]<br>=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.=
java:115) [catalina.jar:10.1.34]<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 at org.apac=
he.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93) [catal=
ina.jar:10.1.34]<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 at org.apache.catalina.core=
.StandardEngineValve.invoke(StandardEngineValve.java:74) [catalina.jar:10.1=
.34]<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 at org.apache.catalina.connector.Coyote=
Adapter.service(CoyoteAdapter.java:344) [catalina.jar:10.1.34]<br>=C2=A0 =
=C2=A0 =C2=A0 =C2=A0 at org.apache.coyote.ajp.AjpProcessor.service(AjpProce=
ssor.java:431) [tomcat-coyote.jar:10.1.34]<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 a=
t org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.j=
ava:63) [tomcat-coyote.jar:10.1.34]<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 at org.a=
pache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.ja=
va:905) [tomcat-coyote.jar:10.1.34]<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 at org.a=
pache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:17=
41) [tomcat-coyote.jar:10.1.34]<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 at org.apach=
e.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) [tom=
cat-coyote.jar:10.1.34]<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 at org.apache.tomcat=
.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1190) [t=
omcat-util.jar:10.1.34]<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 at org.apache.tomcat=
.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) [t=
omcat-util.jar:10.1.34]<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 at org.apache.tomcat=
.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:63) [tomcat-u=
til.jar:10.1.34]<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 at java.base/java.lang.Thre=
ad.run(Thread.java:858) [?:?]</font></div></div>

--0000000000004f5696063862c756--