Hi John,

In the case of WSDL 1.1 we set a custom resolver to WSDL4J. I managed to
tweak this custom resolver to work for the WSDL 2.0 case too. It seems to be
working now. Thanks for looking into it and pointing this out.

Thanks,
Keith.

On Jan 3, 2008 12:08 AM, John Kaputin < [EMAIL PROTECTED]> wrote:

> Keith,
> the SchemaResolverAdapter in Woden is based on the
> DefaultURIResolver.resolveEntity() method in XmlSchema. It just adds some
> calls to Woden's SimpleURIResolver which check if the baseURI or
> schemaLocation are mapped to other URIs in a catalog file.  This code will
>
> work with WSDL and XSD files packaged in jar files provided that the
> catalog file and catalog system properties have been configured correctly,
> as described in the Woden User Guide [1].
>
> For example, by creating a catalog file called test.catalog containing the
> entry:
> genelist.xsd=META-INF/genelist.xsd
>
> and then:
> System.setProperty("org.apache.woden.resolver.simpleresolver.catalog
> ","file:///c:/temp2/test.catalog");
> System.setProperty("org.apache.woden.resolver.simpleresolver.baseURIs
> ","jar:file:///C:/temp2/test.jar!/");
> WSDLReader reader = factory.newWSDLReader();
>
> But setting Woden properties in this way is not that convenient for an
> Axis2 user - we have a JIRA open to address this.
>
> However, I can get URIs to work in Woden with jar files without setting up
> a catalog by changing the way SchemaResolverAdapter resolves the baseURI
> and the schemaLocation. Instead of using the File object, I use the URL
> constructor URL(contextURL, schemaLocString).  contextURL is created from
> the baseURI string. I use this ctor via the StringUtils.getURL() method
> which also handles the case where schemaLocation is a file path such as
> "C:\temp\genelist.xsd", which would cause a MalformedURLException with
> this URL ctor.
>
> So:
> if baseURI = "jar:file:///C:/temp2/test.jar!/META-INF/lgws.wsdl"
> and schemaLocation = " genelist.xsd"
> the resolved uri = "jar:file:///C:/temp2/test.jar!/META-INF/genelist.xsd"
> ...without the need to setup any catalog.
>
> I can commit this change to Woden's SchemaResolverAdapter, but it seems to
>
> me that this type of behaviour (using the URL ctor instead of the File
> object) should also be the behaviour of XmlSchema's
> DefaultURLResolver.resolveEntity() method. If XmlSchema is use mainly by
> Axis2 and Axis2 deploys WSDL and XSD files packaged inside .aar files,
> then why not have default behaviour that handles jar file paths as well as
> ordinary file and web URIs. What do you think? Do you have the same
> problem with WSDL 1.1 and WSDL4J in Axis2 or do you use the schema DOM
> tree exposed by WSDL4J to traverse those schemas?
>
> [1] http://ws.apache.org/woden/userguide.html#Woden+URI+Resolver
>
>
>
> regards,
> John Kaputin
>
>
> "keith chapman" <[EMAIL PROTECTED]> wrote on 27/12/2007 03:48:26:
>
> > Hi Woden Devs,
> >
> > There seems to be a problem in the schema resolver
> > (SchemaResolverAdapter) when the jar URL scheme is used. As most of
> > you know Axis2 packs all service specific files in a .aar file with
> > the WSDL and the associated schema files in the META-INF directory.
> > The following is an example of this senario and woden fails to
> > resolve the URI. I tried debugging through this, line 145 of the
> > SchemaResolverAdapter class resolves the URL as return new
> > URI(baseUri).resolve(new URI(schemaLocation)); Debugging the
> > scenario below had the baseUri as jar:file://file:/opt/apache-
> > tomcat-6.0.10 /webapps/axis2/WEB-INF/services/lgws.aar!/META-
> > INF/lgws.wsdl and schemaLocation as genelist.xsd. But this resolves
> > to /opt/apache-tomcat-6.0.10/webapps/axis2/WEB-
> > INF/services/genelist.xsd. Is this an issue with the resolver class
> > when the jar URL scheme is used?
> >
> > Thanks,
> > Keith.
>
> > ---------- Forwarded message ----------
> > From: Hans-Ulrich Klein <[EMAIL PROTECTED] >
> > Date: Dec 24, 2007 10:34 PM
> > Subject: [axis2] wsdl2 and inline schema
> > To: [EMAIL PROTECTED]
> >
> >
> > Hi List,
> >
> > I have some path problems when deploying my service. My attached
> > wsdl2-File (lgws.wsdl) includes a schema (genelist.xsd). Both are
> > located in the same local folder. I tried the following:
> >
> > $  /opt/axis2-SNAPSHOT/bin/wsdl2java.sh -uri src/META-INF/lgws.wsdl -p
> > de.wwu.imib.lgws.service -d adb -s -ss -sd -wv 2.0 -ns2p
> > http://imib.uni-muenster.de/lgws/xml=de.wwu.imib.lgws.service.xml
> >
> > and
> >
> > $  ant jar.server
> >
> > This works fine so far. Though, copying the resulting lgws.aar to the
> > axis2 services folder to deploy it leads to this error message:
> >
> > Woden[Error],0:0,WSDL521,Could not parse an inline schema in the WSDL at
>
> > URL
> > "jar:file://file:/opt/apache-tomcat-6.0.10/webapps/axis2/WEB-
> > INF/services/lgws.aar!/META-INF/lgws.wsdl"., java.lang.
> > RuntimeException:org.apache.ws.commons.schema.XmlSchemaException:
> >
> > /opt/apache- tomcat-6.0.10/webapps/axis2/WEB-INF/services/genelist.xsd
> > (No such file or directory)
> > Woden[Error],0:0,Endpoint-1061,The address 'lgws' specified for this
> > endpoint is not an absolute IRI. The address must be absolute.
> > [INFO] Trouble processing wsdl file :null
> > [INFO] Deploying Web service: lgws.aar -
> > file:/opt/apache-tomcat-6.0.10/webapps/axis2/WEB-INF/services/lgws.aar
> >
> > Obviously, the path to the genelist.xsd is wrong. What is the right path
>
> > and where can I change it? The xsd-file is packed in the lgws.aar:
> >
> > $  unzip lgws.aar
> > ...
> >  inflating: META-INF/genelist.xsd
> >  inflating: META-INF/lgws.wsdl
> >  inflating: META-INF/services.xml
> > ...
> >
> > I spend a whole day for this problem without success :( I tried it with
> > axis2-1.4 and also with a nightly build.
> >
> > Thank you very much in advance,
> > Hans-Ulrich
> >
> >
> > <schema xmlns=" http://www.w3.org/2001/XMLSchema";
> >        xmlns:lgs="http://imib.uni-muenster.de/lgws/xml "
> >        targetNamespace=" http://imib.uni-muenster.de/lgws/xml";
> >        elementFormDefault="qualified"
> >        attributeFormDefault="qualified">
> >
> >        <element name="genelist" type="lgs:GenelistType"/>
> >
> >        <complexType name="GenelistType">
> >        <sequence>
> >                <element name="id" type="int"/>
> >                <element name="name" type="string"/>
> >                <element name="description" type="string"/>
> >                <element name="pubmed" type="int"/>
> >
> >                <element name="group" type="lgs:GroupType"
> > minOccurs="1" maxOccurs="unbounded"/>
> >                <element name="microarray" type="lgs:MicroarrayType"/>
> >                <element name="listEntry" type="lgs:ListEntryType"
> > minOccurs="1" maxOccurs="unbounded"/>
> >        </sequence>
> >        </complexType>
> >
> >    <complexType name="GroupType">
> >        <sequence>
> >                <element name="id" type="int"/>
> >                <element name="name" type="string"/>
> >                <element name="description" type="string"/>
> >                <element name="ageGroup" type="string"/>
> >                <element name="material" type="string"/>
> >                <element name="leukemia" type="string"/>
> >                <element name="size" type="int"/>
> >        </sequence>
> >    </complexType>
> >
> >    <complexType name="MicroarrayType">
> >        <sequence>
> >                <element name="name" type="string"/>
> >                <element name="description" type="string"/>
> >                <element name="manufacturer" type="string"/>
> >                <element name="numberFeatures" type="int"/>
> >        </sequence>
> >    </complexType>
> >
> >    <complexType name="ListEntryType">
> >        <sequence>
> >                <element name="accessionNumber" type="string"
> > minOccurs="1" maxOccurs="1"/>
> >                <element name="geneSymbol" type="string"
> > nillable="true" minOccurs="1" maxOccurs="1"/>
> >                <element name="rank" type="int" minOccurs="0"
> maxOccurs="1"/>
> >                <element name="upregulatedGroup" type="int"
> > minOccurs="0" maxOccurs="1"/>
> >                <element name="featureId" type="string" minOccurs="0"
> > maxOccurs="1"/>
> >        </sequence>
> >    </complexType>
> >
> > </schema>
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
> > --
> > Keith Chapman
> > WSO2 Inc.
> > Oxygen for Web Services Developers.
> > http://wso2.org/ [attachment "lgws.wsdl" deleted by John Kaputin/UK/IBM]
>
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>
>
> Unless stated otherwise above:
> IBM United Kingdom Limited - Registered in England and Wales with number
> 741598.
> Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
>
>
>
>
>
>
> ---------------------------------------------------------------------
> 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