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 Tim Thorpe <ti...@criticalpath.net> on 2003/06/23 10:09:47 UTC

Generating an XML Schema from WSDL

Hello !

Could anyone tell me if/how I can generate a W3C XML Schema from a WSDL that
I have produced ?

I want to put everying from the messages down into the types/schema (not the
port, binding or service stuff).

I use XML Spy as my XML editor, into which I have loaded the my WSDL without
error, & tried to use the 'Generate DTD/Schema' facility therein; many
errors ensue, requiring the removal of the namespace prefixes within the
WSDL, ultimitely leading to a 'nonsense' looking schema.

Thanks,
Tim


Re: Generating an XML Schema from WSDL

Posted by remko de knikker <re...@yale.edu>.
I am using the <WsdlInputSchema> tag in the wsdd file:
eg.
<parameter name="wsdlInputSchema" value="your_url/your_schema.xsd"/>

This will include the schema in the generated wsdl from the ?wsdl-query. 
I just haven't figured out how to include both input and output schema's.

Does anyone know?

remko

Anne Thomas Manes wrote:

>If you're using document/literal, then all of your elements should be
>defined in the <types> section already, which is defined using XML Schema.
>You can simply extract the <schema> section.
>
>If you're using rpc/encoded or rpc/literal, then either you've defined the
>type information in the <message> structure, or you've defined the type
>information in the <types> section. If the former, then you need to take
>that type information from the <part> definition and recontruct it as an XML
>Schema <simpleType> or <complexType> definition. In either case you haven't
>defined the element structure, so you also need to define that.
>
>I don't know of a tool that will automatically generate an XML Schema from a
>WSDL description.
>
>I do suggest using Systinet WASP's java2wsdl tool (included with WASP Server
>or WASP Developer -- both free for development purposes) to generate
>doc/literal WSDL files from your Java code -- you can specify that you want
>it to generate a full schema for you.
>
>Regards,
>Anne
>
>----- Original Message -----
>From: "Tim Thorpe" <ti...@criticalpath.net>
>To: <ax...@ws.apache.org>
>Sent: Monday, June 23, 2003 4:09 AM
>Subject: Generating an XML Schema from WSDL
>
>
>  
>
>>Hello !
>>
>>Could anyone tell me if/how I can generate a W3C XML Schema from a WSDL
>>    
>>
>that
>  
>
>>I have produced ?
>>
>>I want to put everying from the messages down into the types/schema (not
>>    
>>
>the
>  
>
>>port, binding or service stuff).
>>
>>I use XML Spy as my XML editor, into which I have loaded the my WSDL
>>    
>>
>without
>  
>
>>error, & tried to use the 'Generate DTD/Schema' facility therein; many
>>errors ensue, requiring the removal of the namespace prefixes within the
>>WSDL, ultimitely leading to a 'nonsense' looking schema.
>>
>>Thanks,
>>Tim
>>
>>    
>>
>
>
>  
>


Re: Generating an XML Schema from WSDL

Posted by Anne Thomas Manes <an...@manes.net>.
Make sure you're using the latest build. (but I suspect you can't download
that either...)

Axis's ability to generate complex Schema definitions is somewhat limited.
That's why I recommend using WASP.

Anne

----- Original Message -----
From: "Tim Thorpe" <ti...@criticalpath.net>
To: <ax...@ws.apache.org>
Sent: Monday, June 23, 2003 10:19 AM
Subject: RE: Generating an XML Schema from WSDL


> Anne
>
> Thank you for your response.
>
> I am in fact using rpc, my WSDL reflects that & I have been doing as you
> suggest, ie "take
> that type information from the <part> definition and recontruct it as an
XML
> Schema <simpleType> or <complexType> definition".
>
> I guess I had been hoping for a more automated method of producing the
> schema.
>
> I am currently on an internet link that will not take a download of WASP,
> but taking a hint from you I thought I might re-do the AXIS 'javaToWSDL',
> but this time use the '-y' option (ie: "-y document") to try to produce a
> 'document' flavoured WSDL with everything I need defined within the
<schema>
> section.
> This however appears to produce the exact same wsdl as when I supply "-y
> rpc".
>
> The full command:
> java org.apache.axis.wsdl.Java2WSDL -y document -o
>
C:\Telia\jakarta-tomcat-4.0.1\webapps\axis\WEB-INF\classes\net\cp\applicatio
> n\memum\MeMUMSubscriptionChangeServiceDoc.wsdl  -l
> "http://localhost:9249/axis/services/MeMUMSubscriptionChangeService" -n
> "urn:MeMUMSubscriptionChangeService" -p"net.cp.application.memum"
> "urn:MeMUMSubscriptionChangeService"
> net.cp.application.memum.MeMUMSubscriptionChange
>
> Any view on my use of this '-y' option ?
>
> Thanks,
> Tim
>
> -----Original Message-----
> From: Anne Thomas Manes [mailto:anne@manes.net]
> Sent: 23 June 2003 12:38
> To: axis-user@ws.apache.org
> Subject: Re: Generating an XML Schema from WSDL
>
>
> If you're using document/literal, then all of your elements should be
> defined in the <types> section already, which is defined using XML Schema.
> You can simply extract the <schema> section.
>
> If you're using rpc/encoded or rpc/literal, then either you've defined the
> type information in the <message> structure, or you've defined the type
> information in the <types> section. If the former, then you need to take
> that type information from the <part> definition and recontruct it as an
XML
> Schema <simpleType> or <complexType> definition. In either case you
haven't
> defined the element structure, so you also need to define that.
>
> I don't know of a tool that will automatically generate an XML Schema from
a
> WSDL description.
>
> I do suggest using Systinet WASP's java2wsdl tool (included with WASP
Server
> or WASP Developer -- both free for development purposes) to generate
> doc/literal WSDL files from your Java code -- you can specify that you
want
> it to generate a full schema for you.
>
> Regards,
> Anne
>
> ----- Original Message -----
> From: "Tim Thorpe" <ti...@criticalpath.net>
> To: <ax...@ws.apache.org>
> Sent: Monday, June 23, 2003 4:09 AM
> Subject: Generating an XML Schema from WSDL
>
>
> > Hello !
> >
> > Could anyone tell me if/how I can generate a W3C XML Schema from a WSDL
> that
> > I have produced ?
> >
> > I want to put everying from the messages down into the types/schema (not
> the
> > port, binding or service stuff).
> >
> > I use XML Spy as my XML editor, into which I have loaded the my WSDL
> without
> > error, & tried to use the 'Generate DTD/Schema' facility therein; many
> > errors ensue, requiring the removal of the namespace prefixes within the
> > WSDL, ultimitely leading to a 'nonsense' looking schema.
> >
> > Thanks,
> > Tim
> >
>


RE: Generating an XML Schema from WSDL

Posted by Tim Thorpe <ti...@criticalpath.net>.
Anne

Thank you for your response.

I am in fact using rpc, my WSDL reflects that & I have been doing as you
suggest, ie "take
that type information from the <part> definition and recontruct it as an XML
Schema <simpleType> or <complexType> definition".

I guess I had been hoping for a more automated method of producing the
schema.

I am currently on an internet link that will not take a download of WASP,
but taking a hint from you I thought I might re-do the AXIS 'javaToWSDL',
but this time use the '-y' option (ie: "-y document") to try to produce a
'document' flavoured WSDL with everything I need defined within the <schema>
section.
This however appears to produce the exact same wsdl as when I supply "-y
rpc".

The full command:
java org.apache.axis.wsdl.Java2WSDL -y document -o
C:\Telia\jakarta-tomcat-4.0.1\webapps\axis\WEB-INF\classes\net\cp\applicatio
n\memum\MeMUMSubscriptionChangeServiceDoc.wsdl  -l
"http://localhost:9249/axis/services/MeMUMSubscriptionChangeService" -n
"urn:MeMUMSubscriptionChangeService" -p"net.cp.application.memum"
"urn:MeMUMSubscriptionChangeService"
net.cp.application.memum.MeMUMSubscriptionChange

Any view on my use of this '-y' option ?

Thanks,
Tim

-----Original Message-----
From: Anne Thomas Manes [mailto:anne@manes.net]
Sent: 23 June 2003 12:38
To: axis-user@ws.apache.org
Subject: Re: Generating an XML Schema from WSDL


If you're using document/literal, then all of your elements should be
defined in the <types> section already, which is defined using XML Schema.
You can simply extract the <schema> section.

If you're using rpc/encoded or rpc/literal, then either you've defined the
type information in the <message> structure, or you've defined the type
information in the <types> section. If the former, then you need to take
that type information from the <part> definition and recontruct it as an XML
Schema <simpleType> or <complexType> definition. In either case you haven't
defined the element structure, so you also need to define that.

I don't know of a tool that will automatically generate an XML Schema from a
WSDL description.

I do suggest using Systinet WASP's java2wsdl tool (included with WASP Server
or WASP Developer -- both free for development purposes) to generate
doc/literal WSDL files from your Java code -- you can specify that you want
it to generate a full schema for you.

Regards,
Anne

----- Original Message -----
From: "Tim Thorpe" <ti...@criticalpath.net>
To: <ax...@ws.apache.org>
Sent: Monday, June 23, 2003 4:09 AM
Subject: Generating an XML Schema from WSDL


> Hello !
>
> Could anyone tell me if/how I can generate a W3C XML Schema from a WSDL
that
> I have produced ?
>
> I want to put everying from the messages down into the types/schema (not
the
> port, binding or service stuff).
>
> I use XML Spy as my XML editor, into which I have loaded the my WSDL
without
> error, & tried to use the 'Generate DTD/Schema' facility therein; many
> errors ensue, requiring the removal of the namespace prefixes within the
> WSDL, ultimitely leading to a 'nonsense' looking schema.
>
> Thanks,
> Tim
>


Re: Generating an XML Schema from WSDL

Posted by Anne Thomas Manes <an...@manes.net>.
If you're using document/literal, then all of your elements should be
defined in the <types> section already, which is defined using XML Schema.
You can simply extract the <schema> section.

If you're using rpc/encoded or rpc/literal, then either you've defined the
type information in the <message> structure, or you've defined the type
information in the <types> section. If the former, then you need to take
that type information from the <part> definition and recontruct it as an XML
Schema <simpleType> or <complexType> definition. In either case you haven't
defined the element structure, so you also need to define that.

I don't know of a tool that will automatically generate an XML Schema from a
WSDL description.

I do suggest using Systinet WASP's java2wsdl tool (included with WASP Server
or WASP Developer -- both free for development purposes) to generate
doc/literal WSDL files from your Java code -- you can specify that you want
it to generate a full schema for you.

Regards,
Anne

----- Original Message -----
From: "Tim Thorpe" <ti...@criticalpath.net>
To: <ax...@ws.apache.org>
Sent: Monday, June 23, 2003 4:09 AM
Subject: Generating an XML Schema from WSDL


> Hello !
>
> Could anyone tell me if/how I can generate a W3C XML Schema from a WSDL
that
> I have produced ?
>
> I want to put everying from the messages down into the types/schema (not
the
> port, binding or service stuff).
>
> I use XML Spy as my XML editor, into which I have loaded the my WSDL
without
> error, & tried to use the 'Generate DTD/Schema' facility therein; many
> errors ensue, requiring the removal of the namespace prefixes within the
> WSDL, ultimitely leading to a 'nonsense' looking schema.
>
> Thanks,
> Tim
>