Hi,

I generated the proxy classes using wsdl2java with "-b jaxbri" provided by
Axis2. During writing client side codes with the generated proxy classes,
how can I use a custom namespace prefix mapper in the data binding?

The XML request message generated by axis2 by default looks like: (the
namespaces are in the root element)
<?xml version="1.0" encoding="UTF-8"?>
<CreateItemRequest xmlns:ns2="http://www.ibm.com/xmlns/db2/cm/api/1.0/schema";

xmlns="http://www.ibm.com/xmlns/db2/cm/beans/1.0/schema";>
 <AuthenticationData>
  <ServerDef>
   <ServerName>icmnlsdb</ServerName>
  </ServerDef>
  <LoginData>
   <UserID>icmadmin</UserID>
   <Password>********</Password>
  </LoginData>
 </AuthenticationData>
 <Item>
  <ItemXML>
   <CLAIM_1047 DESC_1047="This is a claim regarding the accident.3"
CLAIMNO_1047="1234" DATE_1047="2004-01-27">
    <ns2:properties type="document"/>
    <VEHICLE_1047 VIN_1047="38">
     <OWNER_1047 LNAME_1047="Dover" FNAME_1047="Ben"/>
     <OWNER_1047 LNAME_1047="Dover" FNAME_1047="Eileen"/>
    </VEHICLE_1047>
    <VEHICLE_1047 VIN_1047="34">
     <OWNER_1047 LNAME_1047="Freely" FNAME_1047="I.P."/>
    </VEHICLE_1047>
    <ICMBASE>
     <ns2:resourceObject MIMEType="image/tiff">
      <ns2:label name="base 1"/>
     </ns2:resourceObject>
    </ICMBASE>
   </CLAIM_1047>
  </ItemXML>
 </Item>
</CreateItemRequest>

The message I expected looks like: (the namespaces are places where they are
needed)
<?xml version="1.0" encoding="UTF-8"?>
<CreateItemRequest xmlns="http://www.ibm.com/xmlns/db2/cm/beans/1.0/schema";>

 <AuthenticationData>
  <ServerDef>
   <ServerName>icmnlsdb</ServerName>
  </ServerDef>
  <LoginData>
   <UserID>icmadmin</UserID>
   <Password>********</Password>
  </LoginData>
 </AuthenticationData>
 <Item>
  <ItemXML>
   <CLAIM_1047 DATE_1047="2004-01-27" CLAIMNO_1047="1234" DESC_1047="This is

a claim regarding the accident.3">
    <properties xmlns="http://www.ibm.com/xmlns/db2/cm/api/1.0/schema";
type="document"/>
    <VEHICLE_1047 VIN_1047="38">
     <OWNER_1047 FNAME_1047="Ben" LNAME_1047="Dover"/>
     <OWNER_1047 FNAME_1047="Eileen" LNAME_1047="Dover"/>
    </VEHICLE_1047>
    <VEHICLE_1047 VIN_1047="34">
     <OWNER_1047 FNAME_1047="I.P." LNAME_1047="Freely"/>
    </VEHICLE_1047>
    <ICMBASE>
     <resourceObject xmlns="http://www.ibm.com/xmlns/db2/cm/api/1.0/schema";
MIMEType="image/tiff">
      <label name="base 1"/>
     </resourceObject>
    </ICMBASE>
   </CLAIM_1047>
  </ItemXML>
 </Item>
</CreateItemRequest>

Is there someone knows how to achieve this?

THanks a lot!

-- 

Best regards,
Yuval

Reply via email to