Re: Axis2 Corba webservices using JSON

robertlazarski <[email protected]> Wed, 25 Jun 2025 07:19:03 -1000
Newsgroups gmane.text.xml.axis.user
Message-ID <CABpPLBXFfEo2YqqRWgPGhqMuW5fLPG3_ASiKqMsGx10aTJuZDQ@mail.gmail.com>
--00000000000001863a063868a551
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Did you set up your axis2.xml file for badgerfish? Can you post it, if you
edited it? The axis2.xml file is the place to customize optional features
like these.

I don't use badgerfish myself - but I read that doc a lot as I use the
later introduced JSON support with GSON / Moshi quite a bit.

Unless you have a reason to use Badgerfish, I suggest Moshi though the GSON
support is nearly identical.




On Wed, Jun 25, 2025 at 12:19=E2=80=AFAM Serban Mihai <mihaiserban1234@gmai=
l.com>
wrote:

> 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 so=
me
> 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" fil=
e):
> <mappings>
>     <mapping xmlNamespace=3D"http://SM/xsd <http://sm/xsd>"
> jsonNamespace=3D""/>
> </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=3D\"
> 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 t=
he
> 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 Mappe=
d
> 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(CorbaMessage=
Receiver.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.invokeBusinessLog=
ic(AbstractInOutMessageReceiver.java:40)
> ~[axis2-kernel-2.0.0.jar:2.0.0]
>         at
> org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessag=
eReceiver.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(Applicat=
ionFilterChain.java:195)
> [catalina.jar:10.1.34]
>         at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilte=
rChain.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(Applicat=
ionFilterChain.java:164)
> [catalina.jar:10.1.34]
>         at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilte=
rChain.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(AuthenticatorB=
ase.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.j=
ava:74)
> [catalina.jar:10.1.34]
>         at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:34=
4)
> [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.j=
ava:63)
> [tomcat-coyote.jar:10.1.34]
>         at
> org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProt=
ocol.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.ja=
va:52)
> [tomcat-coyote.jar:10.1.34]
>         at
> org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExe=
cutor.java:1190)
> [tomcat-util.jar:10.1.34]
>         at
> org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolEx=
ecutor.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) [?:?]
>

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

<div dir=3D"ltr"><div>Did you set up your axis2.xml file for badgerfish? Ca=
n you post it, if you edited it? The axis2.xml file is the place to customi=
ze=C2=A0optional features like these.=C2=A0</div><div><br></div><div>I don&=
#39;t use badgerfish myself - but I read that doc a lot as I use the later =
introduced JSON support with GSON / Moshi quite a bit.=C2=A0</div><div><br>=
</div><div>Unless you have a reason to use Badgerfish, I suggest Moshi thou=
gh the GSON support is nearly identical.=C2=A0</div><div><br></div><div><br=
></div><div>=C2=A0</div></div><br><div class=3D"gmail_quote gmail_quote_con=
tainer"><div dir=3D"ltr" class=3D"gmail_attr">On Wed, Jun 25, 2025 at 12:19=
=E2=80=AFAM Serban Mihai &lt;<a href=3D"mailto:[email protected]">m=
[email protected]</a>&gt; wrote:<br></div><blockquote class=3D"gmail=
_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204=
,204);padding-left:1ex"><div dir=3D"ltr">Hello all,<div><br><div>Over the p=
ast few weeks we have spent some time migrating our corba services to webse=
rvices 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.</div></div><div><br></div><div=
>I have tried following the documentation: update axis2.xml, then add the f=
ollowing to the &quot;SysM.xml&quot; file (which corresponds to the &quot;S=
ysM.idl&quot; file):</div><div><font face=3D"monospace">&lt;mappings&gt;<br=
>=C2=A0 =C2=A0 &lt;mapping xmlNamespace=3D&quot;<a href=3D"http://sm/xsd" t=
arget=3D"_blank">http://SM/xsd</a>&quot; jsonNamespace=3D&quot;&quot;/&gt;<=
/font></div><div><font face=3D"monospace">&lt;/mappings&gt;</font></div><di=
v><br></div><div>But this does not seem to have any effect, since on this r=
equest:</div><div><font face=3D"monospace">$ curl -H &#39;Content-Type: app=
lication/json&#39; -d &#39;{&quot;geMgrIPs&quot;:{&quot;MgrIPs&quot;:&quot;=
&quot;}}&#39; https://</font><span style=3D"font-family:monospace">&lt;ip&g=
t;</span><font face=3D"monospace">/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;so=
apenv:Fault xmlns:soapenv=3D\&quot;<a href=3D"http://schemas.xmlsoap.org/so=
ap/envelope/%5C" target=3D"_blank">http://schemas.xmlsoap.org/soap/envelope=
/\</a>&quot;&gt;&lt;faultcode&gt;soapenv:Server&lt;\/faultcode&gt;&lt;fault=
string&gt;<b>namespace mismatch require=C2=A0<a href=3D"http://sm/xsd" targ=
et=3D"_blank">http://SM/xsd</a>=C2=A0found none</b>&lt;\/faultstring&gt;&lt=
;detail&gt;...&lt;\/detail&gt;&lt;\/soapenv:Fault&gt;&quot;}</font></div><d=
iv><br></div><div>I notice that the error is related to the namespace and i=
s returned in JSON format - to me this would mean that JSON Mapped conventi=
on handling is enabled, however the namespace is not mapped accordingly. It=
 seems that the SysM.xml file is not an equivalent of the &quot;services.xm=
l&quot; file - does it only handle the corba-specific fields? Is there a wa=
y to enable the Mapped convention on corba services?<br></div><div><br></di=
v><div>Any insight on this issue would be much appreciated.</div><div><br><=
/div><div>Thank you,</div><div>Serban</div><div><br></div><div>Maybe useful=
:</div><div><b>Working example with Badgerfish convention:</b></div><div>Re=
quest:</div><div><font face=3D"monospace">$ curl -H &#39;Content-Type: text=
/json&#39; -d &#39;{&quot;xsl:getMgrIPs&quot;: {&quot;@xmlns&quot;: {&quot;=
xsl&quot;: &quot;<a href=3D"http://sm/xsd" target=3D"_blank">http://SM/xsd<=
/a>&quot;}, &quot;MgrIPs&quot;: {&quot;$&quot;:&quot;&quot;}}}&#39; https:/=
/&lt;ip&gt;/AXIS/services/SysM</font></div><div><br></div><div>Response:</d=
iv><div><font face=3D"monospace">{&quot;ns:getMgrIPsResponse&quot;:{&quot;@=
xmlns&quot;:{&quot;ns&quot;:&quot;<a href=3D"http://sm/xsd" target=3D"_blan=
k">http://SM/xsd</a>&quot;},&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 st=
yle=3D"font-family:monospace">&lt;ip1&gt;</span><font face=3D"monospace">&q=
uot;},{&quot;$&quot;:&quot;</font><span style=3D"font-family:monospace">&lt=
;ip2&gt;</span><font face=3D"monospace">&quot;}]}}}</font></div><div><br></=
div><div><b>The full error taken from the logs:</b></div><div><font face=3D=
"monospace">ERROR [2025-06-23 14:28:48,614] [org.apache.axis2.util.OnDemand=
Logger] - processAxisFault() on error message: namespace mismatch require=
=C2=A0<a href=3D"http://sm/xsd" target=3D"_blank">http://SM/xsd</a>=C2=A0fo=
und none , found a null HTTP status<br>from the MessageContext instance, se=
tting HttpServletResponse status to HttpServletResponse.SC_INTERNAL_SERVER_=
ERROR<br>org.apache.axis2.AxisFault: namespace mismatch require=C2=A0<a hre=
f=3D"http://sm/xsd" target=3D"_blank">http://SM/xsd</a>=C2=A0found none<br>=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 at org.apache.axis2.corba.receivers.CorbaMessag=
eReceiver.invoke(CorbaMessageReceiver.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.Corb=
aMessageReceiver.invokeBusinessLogic(CorbaMessageReceiver.java:53) ~[axis2-=
corba-2.0.0.jar:2.0.0]<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 at org.apache.axis2.r=
eceivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMess=
ageReceiver.java:40) ~[axis2-kernel-2.0.0.jar:2.0.0]<br>=C2=A0 =C2=A0 =C2=
=A0 =C2=A0 at org.apache.axis2.receivers.AbstractMessageReceiver.receive(Ab=
stractMessageReceiver.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(AxisEngi=
ne.java:169) ~[axis2-kernel-2.0.0.jar:2.0.0]<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0=
 at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostReque=
st(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(HttpSe=
rvlet.java:590) [tomcat-servlet-6.0-api.jar:6.0]<br>=C2=A0 =C2=A0 =C2=A0 =
=C2=A0 at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:658) [t=
omcat-servlet-6.0-api.jar:6.0]<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 at org.apache=
.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterCha=
in.java:195) [catalina.jar:10.1.34]<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 at org.a=
pache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.=
java:140) [catalina.jar:10.1.34]<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 at org.apac=
he.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51) [tomcat-webs=
ocket.jar:10.1.34]<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 at org.apache.catalina.co=
re.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:164)=
 [catalina.jar:10.1.34]<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 at org.apache.catali=
na.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140) [c=
atalina.jar:10.1.34]<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 at org.apache.catalina.=
core.StandardWrapperValve.invoke(StandardWrapperValve.java:167) [catalina.j=
ar:10.1.34]<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 at org.apache.catalina.core.Stan=
dardContextValve.invoke(StandardContextValve.java:90) [catalina.jar:10.1.34=
]<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 at org.apache.catalina.authenticator.Authe=
nticatorBase.invoke(AuthenticatorBase.java:483) [catalina.jar:10.1.34]<br>=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 at org.apache.catalina.core.StandardHostValve.i=
nvoke(StandardHostValve.java:115) [catalina.jar:10.1.34]<br>=C2=A0 =C2=A0 =
=C2=A0 =C2=A0 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorRe=
portValve.java:93) [catalina.jar:10.1.34]<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 at=
 org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.ja=
va:74) [catalina.jar:10.1.34]<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 at org.apache.=
catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:344) [catalina.=
jar:10.1.34]<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 at org.apache.coyote.ajp.AjpPro=
cessor.service(AjpProcessor.java:431) [tomcat-coyote.jar:10.1.34]<br>=C2=A0=
 =C2=A0 =C2=A0 =C2=A0 at org.apache.coyote.AbstractProcessorLight.process(A=
bstractProcessorLight.java:63) [tomcat-coyote.jar:10.1.34]<br>=C2=A0 =C2=A0=
 =C2=A0 =C2=A0 at org.apache.coyote.AbstractProtocol$ConnectionHandler.proc=
ess(AbstractProtocol.java:905) [tomcat-coyote.jar:10.1.34]<br>=C2=A0 =C2=A0=
 =C2=A0 =C2=A0 at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.do=
Run(NioEndpoint.java:1741) [tomcat-coyote.jar:10.1.34]<br>=C2=A0 =C2=A0 =C2=
=A0 =C2=A0 at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProc=
essorBase.java:52) [tomcat-coyote.jar:10.1.34]<br>=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPo=
olExecutor.java:1190) [tomcat-util.jar:10.1.34]<br>=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadP=
oolExecutor.java:659) [tomcat-util.jar:10.1.34]<br>=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskT=
hread.java:63) [tomcat-util.jar:10.1.34]<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 at =
java.base/java.lang.Thread.run(Thread.java:858) [?:?]</font></div></div>
</blockquote></div>

--00000000000001863a063868a551--