Hi Lawrence,

Here is the code that is used to read a WSDL.

private Description readInTheWSDLFile(String wsdlURI) throws WSDLException {
        DocumentBuilderFactory documentBuilderFactory =
DocumentBuilderFactory
                .newInstance();
        documentBuilderFactory.setNamespaceAware(true);
        DocumentBuilder documentBuilder;
        Document document = null;
        try {
            documentBuilder = documentBuilderFactory.newDocumentBuilder();
            document = documentBuilder.parse(wsdlURI);
        } catch (ParserConfigurationException e) {
            AxisFault.makeFault(e);
        } catch (IOException e) {
            AxisFault.makeFault(e);
        } catch (SAXException e) {
            AxisFault.makeFault(e);
        }
        return readInTheWSDLFile(document);
    }

    private Description readInTheWSDLFile(InputStream inputStream) throws
WSDLException {

       DocumentBuilderFactory documentBuilderFactory =
DocumentBuilderFactory
                .newInstance();
        documentBuilderFactory.setNamespaceAware(true);
        DocumentBuilder documentBuilder;
        Document document = null;
        try {
            documentBuilder = documentBuilderFactory.newDocumentBuilder();
            document = documentBuilder.parse(inputStream);
        } catch (ParserConfigurationException e) {
            AxisFault.makeFault(e);
        } catch (IOException e) {
            AxisFault.makeFault(e);
        } catch (SAXException e) {
            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, false);
        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);
    }

With validation set to true it fails. It works fine if I set it to false.

Thanks,
Keith.


On Wed, Apr 2, 2008 at 12:20 AM, Lawrence Mandel <[EMAIL PROTECTED]> wrote:

> Hi Keith,
>
> Can you pass along the code that instantiates a Woden reader and reads a
> WSDL file? I want to make sure I'm performing the same steps as you
> because I'm not seeing this failure.
>
> Thanks,
>
> Lawrence
>
>
>
>
>
> "keith chapman" <[EMAIL PROTECTED]>
> 04/01/2008 09:56 AM
> Please respond to
> axis-dev@ws.apache.org
>
>
> To
> axis-dev@ws.apache.org
> cc
> [EMAIL PROTECTED]
> Subject
> Re: WSDL 2.0 codegeration fails due to Woden assertion
>
>
>
>
>
>
> Hi Lawrence,
>
> I found the problem after some investigation. The problem was that I have
> set
>
> reader.setFeature(WSDLReader.FEATURE_VALIDATION, true);
>
> Is it possible to perform validation while continuing on error. I tried
> setting
>
> reader.setFeature(WSDLReader.FEATURE_VALIDATION, true);
> reader.setFeature(WSDLReader.FEATURE_CONTINUE_ON_ERROR, true);
>
> but then I got the following error
>
> Caused by: java.lang.IllegalArgumentException: The feature name "
> http://ws.apache.org/woden/features/continue_on_error"; is not recognized.
>
> Thanks,
> Keith.
>
> On Tue, Apr 1, 2008 at 10:20 AM, Lawrence Mandel <[EMAIL PROTECTED]>
> wrote:
> Hi Keith,
>
> What failure are you experiencing and what are you expecting? I tested the
> target namespace http://services.mashup.wso2.org/version and Woden does
> not produce an exception. Woden does report a warning but this is the
> expected behaviour.
>
> Lawrence
>
>
>
>
>
> "keith chapman" <[EMAIL PROTECTED]>
> 03/31/2008 10:20 PM
> Please respond to
> axis-dev@ws.apache.org
>
>
> To
> [EMAIL PROTECTED], axis-dev@ws.apache.org
> cc
>
> Subject
> Re: WSDL 2.0 codegeration fails due to Woden assertion
>
>
>
>
>
>
> Hi Lawrence,
>
> I took an update of woden, build it localy and tested with axis2 and the
> issue still prevails. I tested it for other WSDLs too, it fails for
> http://mooshup.com/services/system/version?wsdl2 as well. Here the
> targetNamespace is http://services.mashup.wso2.org/version
>
> Thanks,
> Keith.
>
> On Sun, Mar 30, 2008 at 12:15 AM, Lawrence Mandel <[EMAIL PROTECTED]>
> wrote:
> Fixed.
>
> Lawrence
>
>
>
>
> "keith chapman" <[EMAIL PROTECTED]>
> 03/27/2008 11:50 AM
> Please respond to
> axis-dev@ws.apache.org
>
>
> To
> [EMAIL PROTECTED]
> cc
> axis-dev@ws.apache.org
> Subject
> Re: WSDL 2.0 codegeration fails due to Woden assertion
>
>
>
>
>
>
> Thanks for looking into it Lawrence. I created a jira issue.
> https://issues.apache.org/jira/browse/WODEN-203
>
> Thanks,
> Keith.
>
> On Thu, Mar 27, 2008 at 8:28 PM, Lawrence Mandel <[EMAIL PROTECTED]>
> wrote:
> Hi Keith,
>
> Description1001 should report a warning in this case. Looks like we'll
> have to dig into this ASAP.
>
> Can you please open a Jira and include any other relevant environmental
> factors such as OS, connectivity, and JRE provider and version?
>
> Thanks,
>
> Lawrence
>
>
>
>
>
> "keith chapman" <[EMAIL PROTECTED]>
> 03/27/2008 07:31 AM
> Please respond to
> [EMAIL PROTECTED]
>
>
> To
> [EMAIL PROTECTED], axis-dev@ws.apache.org
> cc
>
> Subject
> WSDL 2.0 codegeration fails due to Woden assertion
>
>
>
>
>
>
> Hi Devs,
>
> We are having a bit of a problem in Axis2 (codegeration) due to an
> assertion woden has made. I have attached the wsdl2 of the version service
>  hearwith.  As you will note the target namespace of the wsdl is
> http://axisversion.sample and woden tries to resolve this and failes cause
> its not a resource that exist.  The complete stack trace is given below
>
> Exception in thread "main"
> org.apache.axis2.wsdl.codegen.CodeGenerationException: Error parsing WSDL
>  at
> org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(
> CodeGenerationEngine.java:159)
>  at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)
>  at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24)
>  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>  at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java
> :39)
>  at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:25)
>  at java.lang.reflect.Method.invoke(Method.java:585)
>  at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
> Caused by: WSDLException: faultCode=OTHER_ERROR: Fatal error.:
> axisversion.sample: java.net.UnknownHostException: axisversion.sample
>  at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
>  at java.net.Socket.connect(Socket.java:507)
>  at java.net.Socket.connect(Socket.java:457)
>  at sun.net.NetworkClient.doConnect(NetworkClient.java:157)
>  at sun.net.www.http.HttpClient.openServer(HttpClient.java:365)
>  at sun.net.www.http.HttpClient.openServer(HttpClient.java:477)
>  at sun.net.www.http.HttpClient.<init>(HttpClient.java:214)
>  at sun.net.www.http.HttpClient.New(HttpClient.java:287)
>  at sun.net.www.http.HttpClient.New(HttpClient.java:299)
>  at
> sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(
> HttpURLConnection.java:792)
>  at
> sun.net.www.protocol.http.HttpURLConnection.plainConnect(
> HttpURLConnection.java:744)
>  at
> sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java
> :669)
>  at
> sun.net.www.protocol.http.HttpURLConnection.getInputStream(
> HttpURLConnection.java:913)
>  at java.net.URLConnection.getContent(URLConnection.java:682)
>  at java.net.URL.getContent(URL.java:1021)
>  at
> org.apache.woden.internal.wsdl20.assertions.Description1001.validate(
> Description1001.java:28)
>  at
> org.apache.woden.internal.wsdl20.validation.WSDLValidator.checkAssertions(
> WSDLValidator.java:109)
>  at
> org.apache.woden.internal.wsdl20.validation.WSDLValidator.validate(
> WSDLValidator.java:77)
>  at
> org.apache.woden.internal.DOMWSDLReader.readWSDL(DOMWSDLReader.java:207)
>  at
> org.apache.woden.internal.DOMWSDLReader.readWSDL(DOMWSDLReader.java:233)
>  at
> org.apache.woden.internal.DOMWSDLReader.readWSDL(DOMWSDLReader.java:268)
>  at
> org.apache.woden.internal.DOMWSDLReader.readWSDL(DOMWSDLReader.java:127)
>  at
> org.apache.axis2.description.WSDL20ToAxisServiceBuilder.readInTheWSDLFile(
> WSDL20ToAxisServiceBuilder.java:1181)
>  at
> org.apache.axis2.description.WSDL20ToAxisServiceBuilder.<init>(
> WSDL20ToAxisServiceBuilder.java:151)
>  at
> org.apache.axis2.description.WSDL20ToAllAxisServicesBuilder.<init>(
> WSDL20ToAllAxisServicesBuilder.java:53)
>  at
> org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(
> CodeGenerationEngine.java:102)
>  at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)
>  at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24)
>  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>  at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java
> :39)
>  at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:25)
>  at java.lang.reflect.Method.invoke(Method.java:585)
>  at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
>
>  at
> org.apache.woden.internal.wsdl20.assertions.Description1001.validate(
> Description1001.java:42)
>  at
> org.apache.woden.internal.wsdl20.validation.WSDLValidator.checkAssertions(
> WSDLValidator.java:109)
>  at
> org.apache.woden.internal.wsdl20.validation.WSDLValidator.validate(
> WSDLValidator.java:77)
>  at
> org.apache.woden.internal.DOMWSDLReader.readWSDL(DOMWSDLReader.java:207)
>  at
> org.apache.woden.internal.DOMWSDLReader.readWSDL(DOMWSDLReader.java:233)
>  at
> org.apache.woden.internal.DOMWSDLReader.readWSDL(DOMWSDLReader.java:268)
>  at
> org.apache.woden.internal.DOMWSDLReader.readWSDL(DOMWSDLReader.java:127)
>  at
> org.apache.axis2.description.WSDL20ToAxisServiceBuilder.readInTheWSDLFile(
> WSDL20ToAxisServiceBuilder.java:1181)
>  at
> org.apache.axis2.description.WSDL20ToAxisServiceBuilder.<init>(
> WSDL20ToAxisServiceBuilder.java:151)
>  at
> org.apache.axis2.description.WSDL20ToAllAxisServicesBuilder.<init>(
> WSDL20ToAllAxisServicesBuilder.java:53)
>  at
> org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(
> CodeGenerationEngine.java:102)
>  ... 7 more
>
>
> Thanks,
> Keith.
> --
> Keith Chapman
> Software Engineer
> WSO2 Inc.
> Oxygenating the Web Service Platform.
> http://wso2.org/
>
> blog: http://www.keith-chapman.org
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
> --
> Keith Chapman
> Software Engineer
> WSO2 Inc.
> Oxygenating the Web Service Platform.
> http://wso2.org/
>
> blog: http://www.keith-chapman.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>
> --
> Keith Chapman
> Software Engineer
> WSO2 Inc.
> Oxygenating the Web Service Platform.
> http://wso2.org/
>
> blog: http://www.keith-chapman.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>
> --
> Keith Chapman
> Software Engineer
> WSO2 Inc.
> Oxygenating the Web Service Platform.
> http://wso2.org/
>
> blog: http://www.keith-chapman.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Keith Chapman
Software Engineer
WSO2 Inc.
Oxygenating the Web Service Platform.
http://wso2.org/

blog: http://www.keith-chapman.org

Reply via email to