You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Matthew Fadoul <ma...@my3d.com> on 2007/10/27 03:57:09 UTC
RE: Problems with Schemas and WSDL in Axis2 (Fixed)
Hello all,
Thank you for the help. A couple comments on the solution:
1) Although the wsdl2java converter placed my schema in the resources
directory, the Axis2 Service Archiver did not add the schema into the
archive web service file (*.aar). I resorted to manually copying the schema
into the AAR file (the AAR file is just a ZIP file) each time I ran the
archiver wizard.
2) I played around with the various schemaLocation and namespace attributes
in my WSDL, but I don't know if this caused any problems in the end.
Despite its appearance, the simple namespace "HW" is a valid URI; it's just
a relative one, not absolute.
Regards,
Matt
_____
From: Amila Suriarachchi [mailto:amilasuriarachchi@gmail.com]
Sent: Friday, October 19, 2007 4:57 AM
To: axis-user@ws.apache.org
Subject: Re: Problems with Schemas and WSDL in Axis2
Can you have a look at with a nighly build.
when generating the code with wsdl2java there is a folder created named as
resources.
under this folder you should have your wsdl and xsd file.
wsdl file should referto the xsd file there.
i.e it should have and entry like
<xs:import namespace="HW" schemaLocation="HelloWorldSimple.xsd"/>
Amila.
On 10/19/07, Matthew Fadoul <ma...@my3d.com> wrote:
Hello all,
I'm having trouble using my own schemas in WSDL. Part of it may be related
to the Axis2 code generation.
So, I've made my own "HelloWorld" example. Here's my process:
1) Make WSDL file (attached)
2) Process with Axis2 code generation to build client/server code. Fill in
a little of the skeleton code.
3) Build inside Eclipse using Ant
4) Package with the Axis2 Service Archiver.
I've attached my WSDL and Schema. The schema has little more than a type
definition based on "xs:string".
I've placed my XSD file on a local server. This is reflected in the
attached WSDL here:
< xs:import namespace=" HW" schemaLocation="
http://strawberry/schema/HelloWorldSimple.xsd
<http://strawberry/schema/HelloWorldSimple.xsd> " />
By the time the service gets placed on the Axis server, the reference to the
schema in "HelloWorldExternalSchemaService?wsdl" becomes:
< xs:import namespace=" HW"
schemaLocation="HelloWorldExternalSchemaService?xsd=
http://strawberry/schema/HelloWorldSimple.xsd" />
Unfortunately, Axis can't seem to resolve my schema with the "xsd" option.
Because of this, the schema and all of its types are unresolved.
As a side note, I've also toyed with locale schema (i.e. the XSD file is in
the same directory as the WSDL file), though I haven't had much success with
that route either.
Questions. Are there:
Any ideas or advice for integrating schemas with WSDL?
Any ideas why the code generator is changing the schema location?
Any glaring mistakes (e.g. namespace problems or DOC/RPC stuff) in my
WSDL/XSD?
Thank you!
Matt
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
--
Amila Suriarachchi,
WSO2 Inc.
Re: Problems with Schemas and WSDL in Axis2 (Fixed)
Posted by Lahiru Sandakith <sa...@gmail.com>.
On 10/27/07, Matthew Fadoul <ma...@my3d.com> wrote:
>
> Hello all,
>
>
>
> Thank you for the help. A couple comments on the solution:
>
>
>
> 1) Although the wsdl2java converter placed my schema in the resources
> directory, the Axis2 Service Archiver did not add the schema into the
> archive web service file (*.aar). I resorted to manually copying the schema
> into the AAR file (the AAR file is just a ZIP file) each time I ran the
> archiver wizard.
>
If adding another option in the custom wsdl attachment page of the service
archiver wizard (
http://ws.apache.org/axis2/tools/1_3/eclipse/servicearchiver-plugin.html)
to add related schemas ad a list to add it to the service will solve the
problem, I ll add that feature. You can request a feature improvement in
https://issues.apache.org/jira/browse/AXIS2/component/12310180
thanks
Lahiru
2) I played around with the various schemaLocation and namespace attributes
> in my WSDL, but I don't know if this caused any problems in the end.
> Despite its appearance, the simple namespace "HW" is a valid URI; it's just
> a relative one, not absolute.
>
>
>
> Regards,
>
>
>
> Matt
>
>
> ------------------------------
>
> *From:* Amila Suriarachchi [mailto:amilasuriarachchi@gmail.com]
> *Sent:* Friday, October 19, 2007 4:57 AM
> *To:* axis-user@ws.apache.org
> *Subject:* Re: Problems with Schemas and WSDL in Axis2
>
>
>
> Can you have a look at with a nighly build.
>
> when generating the code with wsdl2java there is a folder created named as
> resources.
>
> under this folder you should have your wsdl and xsd file.
>
> wsdl file should referto the xsd file there.
>
> i.e it should have and entry like
>
> <xs:import namespace="HW" schemaLocation="HelloWorldSimple.xsd"/>
>
> Amila.
>
> On 10/19/07, *Matthew Fadoul* <ma...@my3d.com> wrote:
>
> Hello all,
>
>
>
> I'm having trouble using my own schemas in WSDL. Part of it may be
> related to the Axis2 code generation.
>
>
>
> So, I've made my own "HelloWorld" example. Here's my process:
>
>
>
> 1) Make WSDL file (attached)
>
> 2) Process with Axis2 code generation to build client/server code. Fill
> in a little of the skeleton code.
>
> 3) Build inside Eclipse using Ant
>
> 4) Package with the Axis2 Service Archiver.
>
>
>
> I've attached my WSDL and Schema. The schema has little more than a type
> definition based on "xs:string".
>
>
>
> I've placed my XSD file on a local server. This is reflected in the
> attached WSDL here:
>
>
>
> < xs:import namespace="* HW*" schemaLocation="*http://strawberry/schema/HelloWorldSimple.xsd
> *" />
>
>
>
> By the time the service gets placed on the Axis server, the reference to
> the schema in "HelloWorldExternalSchemaService?wsdl" becomes:
>
>
>
> < xs:import namespace="* HW*" schemaLocation="*HelloWorldExternalSchemaService?xsd=
> http://strawberry/schema/HelloWorldSimple.xsd*" />
>
>
>
> Unfortunately, Axis can't seem to resolve my schema with the "xsd"
> option. Because of this, the schema and all of its types are unresolved.
>
>
>
> As a side note, I've also toyed with locale schema (i.e. the XSD file is
> in the same directory as the WSDL file), though I haven't had much success
> with that route either.
>
>
>
> Questions. Are there:
>
> Any ideas or advice for integrating schemas with WSDL?
>
> Any ideas why the code generator is changing the schema location?
>
> Any glaring mistakes (e.g. namespace problems or DOC/RPC stuff) in my
> WSDL/XSD?
>
>
>
>
>
> Thank you!
>
>
>
> Matt
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
>
>
> --
> Amila Suriarachchi,
> WSO2 Inc.
>
--
Thanks
Lahiru Sandakith
http://sandakith.wordpress.com/
GPG Key Fingerprint : 8CD8 68E0 4CBC 75CB 25BC 1AB1 FE5E 7464 1F01 9A0F