You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by "Shaw, Richard A" <ri...@atkinsglobal.com> on 2007/05/11 15:22:05 UTC
client for rest
Is it possible to create a wsdl file which describes a legacy REST service so that I can auto generate code from it to create my clients in the same way I would do with a SOAP/HTTP wsdl file.
The following URLs returns a list of public transport services -
http://www.travelineeastanglia.co.uk/scripts/triplanner.dll?getroutelist&format=3&modes=2
http://www.travelineeastanglia.co.uk/scripts/triplanner.dll?getroutelist&format=3&modes=8
2 are rail routes, 8 are ferry routes
NOTE: Please use the above URLs sparingly - they are part of a live service - thanks.
I have an xsd that describes the responses that I can get. Being legacy it uses a null namespace, but that another issue.
I want to auto generate code so that I can do the following -
private static int XML_FORMAT = 3;
private static int RAIL = 2;
private static int FERRY = 8;
response = triplannerService.getroutelist(XML_FORMAT, RAIL);
I'm assuming the benefit of CXF is that I can define anything using WSDL as long as there are the appropriate bindings and transports available. This then means that my developers can easily create client code for any legacy service as long as 'some clever person' has created the WSDL file.
Richard Shaw
This email and any attached files are confidential and copyright protected. If you are not the addressee, any dissemination of this communication is strictly prohibited. Unless otherwise expressly agreed in writing, nothing stated in this communication shall be legally binding.
The ultimate parent company of the Atkins Group is WS Atkins plc. Registered in England No. 1885586. Registered Office Woodcote Grove, Ashley Road, Epsom, Surrey KT18 5BW.
Consider the environment. Please don't print this e-mail unless you really need to.
RE: client for rest
Posted by "Shaw, Richard A" <ri...@atkinsglobal.com>.
Thanks James that does answer my question, even if it wasn't the answer I wanted !
Richard Shaw
¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤
Richard Shaw
Technical Design Authority - Information Solutions Consultancy
Intelligent Transport Systems
Atkins Highways and Transportation
Woodcote Grove, Ashley Road, Epsom, Surrey, KT18 5BW
Tel: +44 (0) 1372 756407
Fax: +44 (0) 1372 740055
Mob: 07740 817586
E-mail: richard.shaw@atkinsglobal.com
www.atkinsglobal.com/its
-----Original Message-----
From: James Mao [mailto:james.mao@iona.com]
Sent: 14 May 2007 08:08
To: cxf-user@incubator.apache.org
Subject: Re: client for rest
I just answered how you can create the wsdl from xsds you had.
About the GET parameters, It's more likely a configuration.
probably you should take a look at [1] , it has some RESTful annotation, include @GET maybe not, there's no tools to add those annotations automatically.
I guess what you want is add something in the wsdl(or the generated annotation in the classes), so the client will notice it should use GET to interact with service.
And what the binding do is just convert the parameters into a url just as you described.
So it require a mapping mechanism to map wsdl element (or the information stored in the generated annotation) to the url query parameter name/value pair.
We've implement the server side GET support, in sample/soap12, you can see the cxf server support the client use GET to invoke the service. (it map the query name/value pair to service parameters) But we don't have implemented the client side support yet.
Is this answer your question?
James
[1] http://cwiki.apache.org/CXF20DOC/http-binding.html
> What I wanted to know was - can I create a wsdl file which will cause the client to generate RESTful requests like the examples I have given.
>
> I haven't noticed a binding that converts my operation parameters into get parameters instead of post data.
>
> Is that a clearer question ?
>
>
> Probably not !
>
> Richard Shaw
>
> ________________________________
>
> From: James Mao [mailto:james.mao@iona.com]
> Sent: Mon 5/14/2007 4:59 AM
> To: cxf-user@incubator.apache.org
> Subject: Re: client for rest
>
>
>
> Hi Rechard,
>
> Do you mean you have xsds, and you want to generate wsdl, and from
> wsdl you want generate the client code, and then invoke the services?
>
> We do have xsd2wsdl tools, it can help to generate the wsdl files but
> without bindings/transports, And we have wsdl2soap tool, it help to
> generate the soap bindings
> (soap11/soap12)
> And we have wsdl2service tool, it help to generate the services (you
> can specify the soap address etc.) And then you can use the wsdl2java
> to generate the service classes.
>
> A lot of steps indeed.
> I don't know if it can help you.
>
> James.
>
>
>> Is it possible to create a wsdl file which describes a legacy REST service so that I can auto generate code from it to create my clients in the same way I would do with a SOAP/HTTP wsdl file.
>>
>> The following URLs returns a list of public transport services -
>>
>> http://www.travelineeastanglia.co.uk/scripts/triplanner.dll?getroutel
>> ist&format=3&modes=2
>>
>> http://www.travelineeastanglia.co.uk/scripts/triplanner.dll?getroutel
>> ist&format=3&modes=8
>>
>> 2 are rail routes, 8 are ferry routes
>>
>> NOTE: Please use the above URLs sparingly - they are part of a live service - thanks.
>>
>> I have an xsd that describes the responses that I can get. Being legacy it uses a null namespace, but that another issue.
>>
>> I want to auto generate code so that I can do the following -
>>
>> private static int XML_FORMAT = 3;
>> private static int RAIL = 2;
>> private static int FERRY = 8;
>>
>> response = triplannerService.getroutelist(XML_FORMAT, RAIL);
>>
>> I'm assuming the benefit of CXF is that I can define anything using WSDL as long as there are the appropriate bindings and transports available. This then means that my developers can easily create client code for any legacy service as long as 'some clever person' has created the WSDL file.
>>
>> Richard Shaw
>>
>>
>> This email and any attached files are confidential and copyright protected. If you are not the addressee, any dissemination of this communication is strictly prohibited. Unless otherwise expressly agreed in writing, nothing stated in this communication shall be legally binding.
>>
>> The ultimate parent company of the Atkins Group is WS Atkins plc. Registered in England No. 1885586. Registered Office Woodcote Grove, Ashley Road, Epsom, Surrey KT18 5BW.
>>
>> Consider the environment. Please don't print this e-mail unless you really need to.
>>
>>
>>
>
>
>
> This message has been scanned for viruses by MailControl - (see
> http://bluepages.wsatkins.co.uk/?6875772)
>
>
>
Re: client for rest
Posted by James Mao <ja...@iona.com>.
I just answered how you can create the wsdl from xsds you had.
About the GET parameters, It's more likely a configuration.
probably you should take a look at [1] , it has some RESTful annotation,
include @GET
maybe not, there's no tools to add those annotations automatically.
I guess what you want is add something in the wsdl(or the generated
annotation in the classes), so the client will notice it should use GET
to interact with service.
And what the binding do is just convert the parameters into a url just
as you described.
So it require a mapping mechanism to map wsdl element (or the
information stored in the generated annotation) to the url query
parameter name/value pair.
We've implement the server side GET support, in sample/soap12, you can
see the cxf server support the client use GET to invoke the service. (it
map the query name/value pair to service parameters)
But we don't have implemented the client side support yet.
Is this answer your question?
James
[1] http://cwiki.apache.org/CXF20DOC/http-binding.html
> What I wanted to know was - can I create a wsdl file which will cause the client to generate RESTful requests like the examples I have given.
>
> I haven't noticed a binding that converts my operation parameters into get parameters instead of post data.
>
> Is that a clearer question ?
>
>
> Probably not !
>
> Richard Shaw
>
> ________________________________
>
> From: James Mao [mailto:james.mao@iona.com]
> Sent: Mon 5/14/2007 4:59 AM
> To: cxf-user@incubator.apache.org
> Subject: Re: client for rest
>
>
>
> Hi Rechard,
>
> Do you mean you have xsds, and you want to generate wsdl, and from wsdl
> you want generate the client code, and then invoke the services?
>
> We do have xsd2wsdl tools, it can help to generate the wsdl files but
> without bindings/transports,
> And we have wsdl2soap tool, it help to generate the soap bindings
> (soap11/soap12)
> And we have wsdl2service tool, it help to generate the services (you can
> specify the soap address etc.)
> And then you can use the wsdl2java to generate the service classes.
>
> A lot of steps indeed.
> I don't know if it can help you.
>
> James.
>
>
>> Is it possible to create a wsdl file which describes a legacy REST service so that I can auto generate code from it to create my clients in the same way I would do with a SOAP/HTTP wsdl file.
>>
>> The following URLs returns a list of public transport services -
>>
>> http://www.travelineeastanglia.co.uk/scripts/triplanner.dll?getroutelist&format=3&modes=2
>>
>> http://www.travelineeastanglia.co.uk/scripts/triplanner.dll?getroutelist&format=3&modes=8
>>
>> 2 are rail routes, 8 are ferry routes
>>
>> NOTE: Please use the above URLs sparingly - they are part of a live service - thanks.
>>
>> I have an xsd that describes the responses that I can get. Being legacy it uses a null namespace, but that another issue.
>>
>> I want to auto generate code so that I can do the following -
>>
>> private static int XML_FORMAT = 3;
>> private static int RAIL = 2;
>> private static int FERRY = 8;
>>
>> response = triplannerService.getroutelist(XML_FORMAT, RAIL);
>>
>> I'm assuming the benefit of CXF is that I can define anything using WSDL as long as there are the appropriate bindings and transports available. This then means that my developers can easily create client code for any legacy service as long as 'some clever person' has created the WSDL file.
>>
>> Richard Shaw
>>
>>
>> This email and any attached files are confidential and copyright protected. If you are not the addressee, any dissemination of this communication is strictly prohibited. Unless otherwise expressly agreed in writing, nothing stated in this communication shall be legally binding.
>>
>> The ultimate parent company of the Atkins Group is WS Atkins plc. Registered in England No. 1885586. Registered Office Woodcote Grove, Ashley Road, Epsom, Surrey KT18 5BW.
>>
>> Consider the environment. Please don't print this e-mail unless you really need to.
>>
>>
>>
>
>
>
> This message has been scanned for viruses by MailControl - (see http://bluepages.wsatkins.co.uk/?6875772)
>
>
>
RE: client for rest
Posted by "Shaw, Richard A" <ri...@atkinsglobal.com>.
What I wanted to know was - can I create a wsdl file which will cause the client to generate RESTful requests like the examples I have given.
I haven't noticed a binding that converts my operation parameters into get parameters instead of post data.
Is that a clearer question ?
Probably not !
Richard Shaw
________________________________
From: James Mao [mailto:james.mao@iona.com]
Sent: Mon 5/14/2007 4:59 AM
To: cxf-user@incubator.apache.org
Subject: Re: client for rest
Hi Rechard,
Do you mean you have xsds, and you want to generate wsdl, and from wsdl
you want generate the client code, and then invoke the services?
We do have xsd2wsdl tools, it can help to generate the wsdl files but
without bindings/transports,
And we have wsdl2soap tool, it help to generate the soap bindings
(soap11/soap12)
And we have wsdl2service tool, it help to generate the services (you can
specify the soap address etc.)
And then you can use the wsdl2java to generate the service classes.
A lot of steps indeed.
I don't know if it can help you.
James.
> Is it possible to create a wsdl file which describes a legacy REST service so that I can auto generate code from it to create my clients in the same way I would do with a SOAP/HTTP wsdl file.
>
> The following URLs returns a list of public transport services -
>
> http://www.travelineeastanglia.co.uk/scripts/triplanner.dll?getroutelist&format=3&modes=2
>
> http://www.travelineeastanglia.co.uk/scripts/triplanner.dll?getroutelist&format=3&modes=8
>
> 2 are rail routes, 8 are ferry routes
>
> NOTE: Please use the above URLs sparingly - they are part of a live service - thanks.
>
> I have an xsd that describes the responses that I can get. Being legacy it uses a null namespace, but that another issue.
>
> I want to auto generate code so that I can do the following -
>
> private static int XML_FORMAT = 3;
> private static int RAIL = 2;
> private static int FERRY = 8;
>
> response = triplannerService.getroutelist(XML_FORMAT, RAIL);
>
> I'm assuming the benefit of CXF is that I can define anything using WSDL as long as there are the appropriate bindings and transports available. This then means that my developers can easily create client code for any legacy service as long as 'some clever person' has created the WSDL file.
>
> Richard Shaw
>
>
> This email and any attached files are confidential and copyright protected. If you are not the addressee, any dissemination of this communication is strictly prohibited. Unless otherwise expressly agreed in writing, nothing stated in this communication shall be legally binding.
>
> The ultimate parent company of the Atkins Group is WS Atkins plc. Registered in England No. 1885586. Registered Office Woodcote Grove, Ashley Road, Epsom, Surrey KT18 5BW.
>
> Consider the environment. Please don't print this e-mail unless you really need to.
>
>
This message has been scanned for viruses by MailControl - (see http://bluepages.wsatkins.co.uk/?6875772)
Re: client for rest
Posted by James Mao <ja...@iona.com>.
Hi Rechard,
Do you mean you have xsds, and you want to generate wsdl, and from wsdl
you want generate the client code, and then invoke the services?
We do have xsd2wsdl tools, it can help to generate the wsdl files but
without bindings/transports,
And we have wsdl2soap tool, it help to generate the soap bindings
(soap11/soap12)
And we have wsdl2service tool, it help to generate the services (you can
specify the soap address etc.)
And then you can use the wsdl2java to generate the service classes.
A lot of steps indeed.
I don't know if it can help you.
James.
> Is it possible to create a wsdl file which describes a legacy REST service so that I can auto generate code from it to create my clients in the same way I would do with a SOAP/HTTP wsdl file.
>
> The following URLs returns a list of public transport services -
>
> http://www.travelineeastanglia.co.uk/scripts/triplanner.dll?getroutelist&format=3&modes=2
>
> http://www.travelineeastanglia.co.uk/scripts/triplanner.dll?getroutelist&format=3&modes=8
>
> 2 are rail routes, 8 are ferry routes
>
> NOTE: Please use the above URLs sparingly - they are part of a live service - thanks.
>
> I have an xsd that describes the responses that I can get. Being legacy it uses a null namespace, but that another issue.
>
> I want to auto generate code so that I can do the following -
>
> private static int XML_FORMAT = 3;
> private static int RAIL = 2;
> private static int FERRY = 8;
>
> response = triplannerService.getroutelist(XML_FORMAT, RAIL);
>
> I'm assuming the benefit of CXF is that I can define anything using WSDL as long as there are the appropriate bindings and transports available. This then means that my developers can easily create client code for any legacy service as long as 'some clever person' has created the WSDL file.
>
> Richard Shaw
>
>
> This email and any attached files are confidential and copyright protected. If you are not the addressee, any dissemination of this communication is strictly prohibited. Unless otherwise expressly agreed in writing, nothing stated in this communication shall be legally binding.
>
> The ultimate parent company of the Atkins Group is WS Atkins plc. Registered in England No. 1885586. Registered Office Woodcote Grove, Ashley Road, Epsom, Surrey KT18 5BW.
>
> Consider the environment. Please don't print this e-mail unless you really need to.
>
>