我需要一箇舊軟件(我沒有開發過)來測試舊設備。設備通過web服務向服務器「通話」。這些Web服務是由軸自動生成的(Axis需要一個類並使用它的方法創建Web服務)。(Axis + Jetty)前綴自動生成的前綴命名空間
的問題是:設備的開發是爲了讀這樣一個xml:
<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>
而現在的web服務未來是這樣的:
<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>
正如您所注意到的前綴命名空間有因爲設備被編碼爲前綴ax21,所以從ax21更改爲ax22將產生錯誤。
我已經找到了一個解決方案,但找不到。我已經重新編譯了服務器端,也沒有成功。我無法找到任何地方來改變這個名稱空間前綴,因爲它是自動生成的Axis2
呀。我沒有找到任何東西來證明這一點。大多數地方都說Axis2自己決定這件事。 – lcguida 2012-08-20 12:46:56