You are viewing a plain text version of this content. The canonical link for it is here.
Posted to woden-dev@ws.apache.org by "John Kaputin (JIRA)" <ji...@apache.org> on 2008/04/05 17:43:25 UTC

[jira] Commented: (WODEN-204) Schema resolving issue in Axis2

    [ https://issues.apache.org/jira/browse/WODEN-204?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12586014#action_12586014 ] 

John Kaputin commented on WODEN-204:
------------------------------------

Keith,
your original email had the wsdl attached, but not the imported xsd file. Could you please post the XSD too or attach it to the jira.  

The schema import is:

<xsd:import namespace="http://charitha.org/" schemaLocation="calculatorImportSchema?xsd=xsd0.xsd"/>

Woden will register your 'customWSDLResolver' with XmlSchemaCollection prior to calling its read() method on the inlined schema element. Are you sure your 'customWSDLResolver' is written to correctly resolve the schemaLocation URI "calculatorImportSchema?xsd=xsd0.xsd"?


> Schema resolving issue in Axis2
> -------------------------------
>
>                 Key: WODEN-204
>                 URL: https://issues.apache.org/jira/browse/WODEN-204
>             Project: Woden
>          Issue Type: Test
>            Reporter: Keith Godwin Chapman
>
> 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) {
>                InterfaceMessageReferenceElement messageReferenceElement =
>                        messageReference.toElement();
>                QName qName =
> messageReferenceElement.getElement().getQName();
>                throw new AxisFault("Unable to find element " +
> qName.toString() + " reffered to by operation " +
> axisOperation.getName().getLocalPart());
>            }
>            elementQName = elementDeclaration.getName();
>        } else if
> (WSDL2Constants.NMTOKEN_ANY.equals(messageContentModelName)) {
>            elementQName = Constants.XSD_ANY;
>        }
> 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 {http://charitha.org/}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) {
>            reader.setURIResolver(customWSDLResolver);
>        }
>        // 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 {
>                wsdlSource.setBaseURI(new URI(getBaseUri()));
>            } catch (URISyntaxException e) {
>                AxisFault.makeFault(e);
>            }
>        }
>        if (log.isDebugEnabled()) {
>            log.debug("Reading 2.0 WSDL with wsdl uri = " + wsdlURI);
>            log.debug("  the stack at this point is: " + stackToString());
>        }
>        return reader.readWSDL(wsdlSource);
>    }
> Your help in this regard is appreciated.
> Thanks,
> Keith.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: woden-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: woden-dev-help@ws.apache.org