I’m converting some services from Apache SOAP to Axis2, so the Java service classes already exist. I created a new project in Eclipse, imported the source, made sure that the Axis2 project facets were installed, and Axis2 emitter properties are correct. Then, in Eclipse, I selected the service class and chose “Create Web Service,” choosing the Axis2 runtime. The service is up and running on my PC, and when I append “?wsdl” to the service’s path, I do indeed get a WSDL that I save locally. Attempting to import this into SoapUI to build a client gives the error:
ERROR:org.apache.xmlbeans.XmlException: C:\projects\soapUI\Axis2\DALService.wsdl:0: error: src-resolve: type 'SOAPException@http://www.w3.org/2001/XMLSchema' not found.
The type it’s referring to (SOAPException) is a holdover from the Apache SOAP services, and in the service code, I changed all “import” references in the service code (not the WSDL) from org.apache.soap.SOAPException (the old Apache SOAP package name) to javax.xml.soap.SOAPException (the Axis2 location). The code compiles and works, once I can access it, but I can’t access it without generating a client. Any thoughts as to why changing the namespace of an object would keep the generated WSDLs from having the proper namespace references?
Let me be the first to say I have no idea WHY any of this is the case, but my guess is the exact content of the namespace may not matter so long as they’re all the same. We’re not even using any special features of SOAPException, because it only blindly extends the regular Exception. Anyhow, I was able to get SoapUI to build clients from the XML by doing three things.
First, I added a section to represent the SOAPException itself, as so:
Second, I added the following namespace to the wsdl:definitions block:
Third, I changed the namespace referenced to the SOAPException base type (fron
nstoimhere) wherever it was previously referenced:The XML file still doesn’t validate cleanly in XMLSpy, but only because of a more esoteric reason that doesn’t affect me directly (the operations, which have faults defined for the Soap11 and Soap12 bindings, don’t have faults defined for the raw HTTP bindings).
Even though it works, I’m still a bit confused about the following:
type (and it did, because it
mentioned it as the base class of the
other exceptions), why didn’t it
define it in an
xs:schemablock?reference the class from an incorrect
namespace when using it as the base
class for another type?
this type as
DEPARTMENT.COMPANY.comand not either an Axis2 package or
the package of the service object that uses it?