Details
-
Test
-
Status: Resolved
-
Major
-
Resolution: Invalid
-
M7b
-
None
-
None
Description
Hi all,
This is regarding http://issues.apache.org/jira/browse/AXIS2-3379. I
have attached both the WSDL and the schema for this scenario. The WSDL
is available at
http://localhost:8080/axis2/services/calculatorImportSchema?wsdl2 and
the schema is available at
http://localhost:8080/axis2/services/calculatorImportSchema?xsd=xsd0.xsd.
It looks like a problems occurs because the schema import. I set
http://localhost:8080/axis2/services/calculatorImportSchema?wsdl2 as the
baseURI hence this should resolve to the correct schemaLocation where
the schema is located at. However I do get an error when I try to
perform the following operation, here messageReference is an
InterfaceMessageReference.
String messageContentModelName = messageReference.getMessageCont
entModel();
QName elementQName = null;
if
(WSDL2Constants.NMTOKEN_ELEMENT.equals(messageContentModelName)) {
ElementDeclaration elementDeclaration =
messageReference.getElementDeclaration();
if (elementDeclaration == null)
elementQName = elementDeclaration.getName();
} else if
(WSDL2Constants.NMTOKEN_ANY.equals(messageContentModelName))
When the above is performed I get a AxisFault because the
elementDeclaration is null. And Axis2 fails saying
org.apache.axis2.AxisFault: org.apache.axis2.AxisFault: Unable to find
element
addition reffered to by operation addition
This is clearly a problem with schema resolving. I'm not sure weather
this is a woden bug or an issue in the way axis2 reads the WSDL. Here is
the code we use to read the WSDL,
private Description readInTheWSDLFile(String wsdlURI) throws
WSDLException, AxisFault {
DocumentBuilderFactory documentBuilderFactory =
DocumentBuilderFactory
.newInstance();
documentBuilderFactory.setNamespaceAware(true);
DocumentBuilder documentBuilder;
Document document;
try
{ documentBuilder = documentBuilderFactory.newDocumentBuilder(); document = documentBuilder.parse(wsdlURI); }catch (ParserConfigurationException e)
{ throw AxisFault.makeFault(e); } catch (IOException e) { throw AxisFault.makeFault(e); }catch (SAXException e)
{ throw AxisFault.makeFault(e); } return readInTheWSDLFile(document);
}
private Description readInTheWSDLFile(Document document) throws
WSDLException {
WSDLReader reader = DOMWSDLFactory.newInstance().newWSDLReader();
if (customWSDLResolver != null)
// This turns on WSDL validation which is set off by default.
reader.setFeature(WSDLReader.FEATURE_VALIDATION, true);
WSDLSource wsdlSource = reader.createWSDLSource();
wsdlSource.setSource(document.getDocumentElement());
if (getBaseUri() != null && !"".equals(getBaseUri())) {
try
catch (URISyntaxException e)
{ AxisFault.makeFault(e); } }
if (log.isDebugEnabled())
return reader.readWSDL(wsdlSource);
}
Your help in this regard is appreciated.
Thanks,
Keith.