I needed to get an old software (which I didn’t develop) to test an old equipment. The equipment ‘talks’ to the server by webservices. These webservices are auto generated by axis (Axis takes a class and make webservices from it’s methods).
The problem is: the equipment was developed to read an xml like this:
<ns:getReferenceCurveResponse xmlns:ns="http://services.teste.org" xmlns:ax22="http://data.teste.org/xsd" xmlns:ax23="http://util.java/xsd">
<ns:return type="org.teste.ReferenceCurve">
<ax21:createdOn>2012-08-16 17:00:59.0</ax21:createdOn>
<ax21:endPoint>9.2</ax21:endPoint>
<ax21:fiberId>21</ax21:fiberId>
<ax21:id>42</ax21:id>
And now the webservice is coming like this:
<ns:getReferenceCurveResponse xmlns:ns="http://services.teste.org" xmlns:ax22="http://data.teste.org/xsd" xmlns:ax23="http://util.java/xsd">
<ns:return type="org.teste.ReferenceCurve">
<ax22:createdOn>2012-08-16 17:00:59.0</ax22:createdOn>
<ax22:endPoint>9.2</ax22:endPoint>
<ax22:fiberId>21</ax22:fiberId>
<ax22:id>42</ax22:id>
As you noticed the prefix in namespace has changed from ax21 to ax22 which is generating errors since the equipment was coded to prefix ax21.
I’ve dug for a solution but could not find. I have recompiled the server side, also without success. I couldn’t find anywhere to change this namespace prefix, since is auto-generated by Axis2
I couldn’t find anything to fix this.
Since it’s for testing locally (The server side, is up and running in out client) and since this change would affect only server side, I’ve managed to change the namespace prefix ‘ax22’ to ‘ns’
You can do that by adding this tag to services.xml:
Like, if you have the com.google.something package, it should be like this: