I am currently using Axis to parse my WSDL and generate Java stub classes, but I'm having a number of problems. I just tried using wsimport to generate the stubs, but the XML stream that ultimately gets produced by the generated code is not compatable with the SOAP server I'm using (it's a homegrown thing that I do not have the ability to modify). The problem is in the namespace prefix that wsimport adds to the SOAP tags, such as the 'ns2' in the following example:
<?xml version="1.0" ?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:ns1="http://www.w3.org/XML/1998/namespace"
xmlns:ns2="urn:obj.api.acme.com">
<soapenv:Body>
<ns2:exec>
<ns2:transaction>
<ns2:account_get>
<ns2:sub_tbl>
<ns2:tbl_id>1</ns2:tbl_id>
</ns2:sub_tbl>
</ns2:account_get>
</ns2:transaction>
</ns2:exec>
</soapenv:Body>
</soapenv:Envelope>
The Axis WSDL2Java program generates code that produces the following XML stream using the same WSDL file:
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<exec xmlns="urn:obj.api.acme.com">
<transaction>
<account_get>
<id>1</id>
</account_get>
</transaction>
</exec>
</soapenv:Body>
</soapenv:Envelope>
My question is this: is it possible to get rid of the namespace prefix so the output from the code generated by wsimport will look more like that of the Axis WSDL2Java tool?
Any suggestions would be greatly appreciated.
Thanks,
Jim