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 "Keith Godwin Chapman (JIRA)" <ji...@apache.org> on 2008/04/03 05:12:24 UTC
[jira] Created: (WODEN-204) Schema resolving issue in Axis2
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
[jira] Updated: (WODEN-204) Schema resolving issue in Axis2
Posted by "Lawrence Mandel (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WODEN-204?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Lawrence Mandel updated WODEN-204:
----------------------------------
Attachment: Test.java
Test class
> 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
> Assignee: Lawrence Mandel
> Attachments: calculatorImportSchema.wsdl, calculatorImportSchema.xsd, Test.java
>
>
> 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
[jira] Assigned: (WODEN-204) Schema resolving issue in Axis2
Posted by "Lawrence Mandel (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WODEN-204?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Lawrence Mandel reassigned WODEN-204:
-------------------------------------
Assignee: Lawrence Mandel (was: John Kaputin)
> 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
> Assignee: Lawrence Mandel
> Attachments: calculatorImportSchema.wsdl, calculatorImportSchema.xsd
>
>
> 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
[jira] Updated: (WODEN-204) Schema resolving issue in Axis2
Posted by "Lawrence Mandel (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WODEN-204?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Lawrence Mandel updated WODEN-204:
----------------------------------
Component/s: Parser
Affects Version/s: M7b
> Schema resolving issue in Axis2
> -------------------------------
>
> Key: WODEN-204
> URL: https://issues.apache.org/jira/browse/WODEN-204
> Project: Woden
> Issue Type: Test
> Components: Parser
> Affects Versions: M7b
> Reporter: Keith Godwin Chapman
> Assignee: Lawrence Mandel
> Attachments: calculatorImportSchema.wsdl, calculatorImportSchema.xsd, Test.java
>
>
> 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
[jira] Updated: (WODEN-204) Schema resolving issue in Axis2
Posted by "Keith Godwin Chapman (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WODEN-204?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Keith Godwin Chapman updated WODEN-204:
---------------------------------------
Attachment: calculatorImportSchema.xsd
Attaching the schema file.
> 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
> Attachments: calculatorImportSchema.wsdl, calculatorImportSchema.xsd
>
>
> 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
[jira] Commented: (WODEN-204) Schema resolving issue in Axis2
Posted by "Lawrence Mandel (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WODEN-204?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12586953#action_12586953 ]
Lawrence Mandel commented on WODEN-204:
---------------------------------------
Keith, I started digging a little deeper for AXIS2-3717 and think I realized what your actual problem is. You cannot access the schema elements in the WSDL model produced by using Woden. The reason for this is your WSDL violates schema access rules. Woden doesn't produce an error because the relevant WSDL assertion hasn't been implemented yet.
The problem lies in the way in which you're importing the schema.
<xsd:schema attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://charitha.org">
<xsd:import namespace="http://charitha.org/" schemaLocation="calculatorImportSchema?xsd=xsd0.xsd"/>
</xsd:schema>
Although this is the WS-I recommended way to import a schema into WSDL 1.1 schemas imported within inline schemas are not visible to the WSDL document. To import a schema in a WSDL 2.0 document a schema import element must appear as a child of the WSDL types as element [1] as follows:
<wsdl2:types>
<xsd:import namespace="http://charitha.org/" schemaLocation="calculatorImportSchema?xsd=xsd0.xsd" />
</wsdl2:types>
[1] http://www.w3.org/TR/2007/REC-wsdl20-20070626/#xsd-types
> Schema resolving issue in Axis2
> -------------------------------
>
> Key: WODEN-204
> URL: https://issues.apache.org/jira/browse/WODEN-204
> Project: Woden
> Issue Type: Test
> Components: Parser
> Affects Versions: M7b
> Reporter: Keith Godwin Chapman
> Assignee: Lawrence Mandel
> Attachments: calculatorImportSchema.wsdl, calculatorImportSchema.xsd, Test.java
>
>
> 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
[jira] Commented: (WODEN-204) Schema resolving issue in Axis2
Posted by "Keith Godwin Chapman (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WODEN-204?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12586018#action_12586018 ]
Keith Godwin Chapman commented on WODEN-204:
--------------------------------------------
John,
In this case that I'm refering to I do not set a resolver explicitly hence it is null and therefore does not get set. It uses wodens default resolvers.
> 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
> Attachments: calculatorImportSchema.wsdl, calculatorImportSchema.xsd
>
>
> 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
[jira] Assigned: (WODEN-204) Schema resolving issue in Axis2
Posted by "Lawrence Mandel (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WODEN-204?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Lawrence Mandel reassigned WODEN-204:
-------------------------------------
Assignee: John Kaputin
John, thanks for jumping in here. I've assigned the issue to you. If you can't handle this ASAP please assign it to me. We need to cut Woden M8 Monday with a vote to be concluded by Wed.
> 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
> Assignee: John Kaputin
> Attachments: calculatorImportSchema.wsdl, calculatorImportSchema.xsd
>
>
> 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
[jira] Commented: (WODEN-204) Schema resolving issue in Axis2
Posted by "Lawrence Mandel (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WODEN-204?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12586940#action_12586940 ]
Lawrence Mandel commented on WODEN-204:
---------------------------------------
Keith,
After running some tests this doesn't seem to be a Woden problem.
I created the class below (I will attach the class as well) which uses the same logic as the methods you provided above. I removed the Axis2 specific calls to get this to compile. I also removed the call to getBaseUri as I don't know how this is set and instead set the base URI explicitly. With this configuration I see one Woden warning
Woden[Warning],0:0,Description-1001,The targetNamespace 'http://charitha.org/' is not dereferencable.
which is expected and can be ignored.
I also tested without setting the base URI on the wsdlSource. If I do not set the base URI on the wsdlSource I get the following error:
Woden[Error],0:0,WSDL521,Could not parse an inline schema in the WSDL at URL "null".,java.lang.RuntimeException:java.lang.NullPointerException
This error may be the same error you are getting only in your case the error is wrapped by Axis2. Is is possible that that getBaseUri() method is returning null or "" in this case causing the base URI not to be set on the wsdlSource?
package org.apache.woden;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.apache.woden.internal.DOMWSDLFactory;
import org.w3c.dom.Document;
import org.xml.sax.SAXException;
public class Test {
public static void main(String[] args) throws WSDLException {
DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory
.newInstance();
documentBuilderFactory.setNamespaceAware(true);
DocumentBuilder documentBuilder;
Document document = null;
try {
documentBuilder = documentBuilderFactory.newDocumentBuilder();
document = documentBuilder
.parse("http://localhost:8080/testResolution/calculatorImportSchema?wsdl");
} catch (ParserConfigurationException e) {
System.out.println(e);
} catch (IOException e) {
System.out.println(e);
} catch (SAXException e) {
System.out.println(e);
}
WSDLReader reader = DOMWSDLFactory.newInstance().newWSDLReader();
// 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(
"http://localhost:8080/testResolution/calculatorImportSchema?wsdl"));
} catch (URISyntaxException e) {
System.out.println(e);
}
// }
reader.readWSDL(wsdlSource);
}
}
> 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
> Assignee: Lawrence Mandel
> Attachments: calculatorImportSchema.wsdl, calculatorImportSchema.xsd, Test.java
>
>
> 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
[jira] Resolved: (WODEN-204) Schema resolving issue in Axis2
Posted by "Lawrence Mandel (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WODEN-204?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Lawrence Mandel resolved WODEN-204.
-----------------------------------
Resolution: Invalid
I'm resolving this issue as invalid because as far as I can tell this is not a Woden issue. An issue should likely be created against Axis2. Feel free to reopen if you have more information.
> Schema resolving issue in Axis2
> -------------------------------
>
> Key: WODEN-204
> URL: https://issues.apache.org/jira/browse/WODEN-204
> Project: Woden
> Issue Type: Test
> Components: Parser
> Affects Versions: M7b
> Reporter: Keith Godwin Chapman
> Assignee: Lawrence Mandel
> Attachments: calculatorImportSchema.wsdl, calculatorImportSchema.xsd, Test.java
>
>
> 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
[jira] Updated: (WODEN-204) Schema resolving issue in Axis2
Posted by "Keith Godwin Chapman (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WODEN-204?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Keith Godwin Chapman updated WODEN-204:
---------------------------------------
Attachment: calculatorImportSchema.wsdl
Attaching the WSDL
> 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
> Attachments: calculatorImportSchema.wsdl
>
>
> 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
[jira] Commented: (WODEN-204) Schema resolving issue in Axis2
Posted by "John Kaputin (JIRA)" <ji...@apache.org>.
[ 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