
August 23rd, 2007, 08:55 PM
| | | How to create virtual webservices?
Hi
I want to create a servlet or something similar by which im able to create
virtual webservices.
Lets say i would like to create a webservice with a method called 'getDate'
which returnes the current date.
This could be done by making a wsdl file (or whatever the name is) and via a
wizard in some java tool make a real webservice. This webservice would be
static since it creates a class in which i can make my code to return the
date. The servlet should be published to a server and the behaviour cant be
changed without compiling the class again and publish again. In that way it
is static.
I would like to implement the same thing, but in af dynamic manner. By this
i mean that i will create the wsdl file dynamically, when a client requests
for that and i would dynamically construct the soap response, when the
client makes a request on my method.
So to the client it should seem exact as a static normal webservice but the
implementation on the server is totally dynamic, and any xml returned from
calls to my 'webservice' should be created dynamically.
Can anyone guide me in how to implement this?
Which .jar files do i need, where do i get them from, which classes can help
create wsdl files and soap webservice responses?
Can it be implementet in a normal servlet or do i have to code my own http
server?
Links to guides would be appreciatet.
Thanks in advance, Benny | 
August 24th, 2007, 05:15 AM
| | | Re: How to create virtual webservices?
On Thu, 23 Aug 2007 21:40:37 +0200, "Benny Dein" <nospam@nospam.dk>
wrote: Quote:
>Hi
>
>I want to create a servlet or something similar by which im able to create
>virtual webservices.
>
>Lets say i would like to create a webservice with a method called 'getDate'
>which returnes the current date.
>This could be done by making a wsdl file (or whatever the name is) and via a
>wizard in some java tool make a real webservice. This webservice would be
>static since it creates a class in which i can make my code to return the
>date. The servlet should be published to a server and the behaviour cant be
>changed without compiling the class again and publish again. In that way it
>is static.
>
>I would like to implement the same thing, but in af dynamic manner. By this
>i mean that i will create the wsdl file dynamically, when a client requests
>for that and i would dynamically construct the soap response, when the
>client makes a request on my method.
>
>So to the client it should seem exact as a static normal webservice but the
>implementation on the server is totally dynamic, and any xml returned from
>calls to my 'webservice' should be created dynamically.
>
>Can anyone guide me in how to implement this?
>
>Which .jar files do i need, where do i get them from, which classes can help
>create wsdl files and soap webservice responses?
>Can it be implementet in a normal servlet or do i have to code my own http
>server?
>
>Links to guides would be appreciatet.
>
>Thanks in advance, Benny
>
>
|
That would defeat the purpose of web services. WSDL is meant to be a
binding contract. You think through them and plan them carefully, and
do not alter them without careful planning.
The whole point to interoperability is that someone calling your web
services needs to be able to validate the data going in and coming
back against some kind of schema. If that schema changes often,
you've got problems that won't be solved by implementing web services.
If you really want to make SOA folks cringe, just receive and return a
single string that is just one big wad of XML.. Who knows what they
will pass in... anyone's guess what comes out... good luck with that.
This is why I don't do Java anymore, these kind of solutions folks
pull out of their arse. | 
August 24th, 2007, 05:15 AM
| | | Re: How to create virtual webservices?
On Fri, 24 Aug 2007 00:06:05 -0400, Howard <none@none.comwrote: Quote:
>On Thu, 23 Aug 2007 21:40:37 +0200, "Benny Dein" <nospam@nospam.dk>
>wrote:
> Quote:
>>Hi
>>
>>I want to create a servlet or something similar by which im able to create
>>virtual webservices.
>>
>>Lets say i would like to create a webservice with a method called 'getDate'
>>which returnes the current date.
>>This could be done by making a wsdl file (or whatever the name is) and via a
>>wizard in some java tool make a real webservice. This webservice would be
>>static since it creates a class in which i can make my code to return the
>>date. The servlet should be published to a server and the behaviour cant be
>>changed without compiling the class again and publish again. In that way it
>>is static.
>>
>>I would like to implement the same thing, but in af dynamic manner. By this
>>i mean that i will create the wsdl file dynamically, when a client requests
>>for that and i would dynamically construct the soap response, when the
>>client makes a request on my method.
>>
>>So to the client it should seem exact as a static normal webservice but the
>>implementation on the server is totally dynamic, and any xml returned from
>>calls to my 'webservice' should be created dynamically.
>>
>>Can anyone guide me in how to implement this?
>>
>>Which .jar files do i need, where do i get them from, which classes can help
>>create wsdl files and soap webservice responses?
>>Can it be implementet in a normal servlet or do i have to code my own http
>>server?
>>
>>Links to guides would be appreciatet.
>>
>>Thanks in advance, Benny
>>
>>
| >
>
>That would defeat the purpose of web services. WSDL is meant to be a
>binding contract. You think through them and plan them carefully, and
>do not alter them without careful planning.
>The whole point to interoperability is that someone calling your web
>services needs to be able to validate the data going in and coming
>back against some kind of schema. If that schema changes often,
>you've got problems that won't be solved by implementing web services.
>
>If you really want to make SOA folks cringe, just receive and return a
>single string that is just one big wad of XML.. Who knows what they
>will pass in... anyone's guess what comes out... good luck with that.
>
>This is why I don't do Java anymore, these kind of solutions folks
>pull out of their arse.
|
I realize that is somewhat insulting so let me say that last line was
not intended for you specifically.
But don't try to combine polymorphism with web services. Web service
calls are stateless, and conceptually should be separated as far as
possible from generall OOP theory as possible. Yes you use classes,
but regarding your web service contract you shouldn't be thinking
about inheritance or polymorphic solutions to problems. | 
August 24th, 2007, 10:45 AM
| | | Re: How to create virtual webservices?
Howard wrote: Quote:
On Thu, 23 Aug 2007 21:40:37 +0200, "Benny Dein" <nospam@nospam.dk>
wrote:
> Quote:
>Hi
>>
>I want to create a servlet or something similar by which im able to create
>virtual webservices.
>>
>Lets say i would like to create a webservice with a method called 'getDate'
>which returnes the current date.
>This could be done by making a wsdl file (or whatever the name is) and via a
>wizard in some java tool make a real webservice. This webservice would be
>static since it creates a class in which i can make my code to return the
>date. The servlet should be published to a server and the behaviour cant be
>changed without compiling the class again and publish again. In that way it
>is static.
>>
>I would like to implement the same thing, but in af dynamic manner. By this
>i mean that i will create the wsdl file dynamically, when a client requests
>for that and i would dynamically construct the soap response, when the
>client makes a request on my method.
>>
>So to the client it should seem exact as a static normal webservice but the
>implementation on the server is totally dynamic, and any xml returned from
>calls to my 'webservice' should be created dynamically.
>>
>Can anyone guide me in how to implement this?
>>
>Which .jar files do i need, where do i get them from, which classes can help
>create wsdl files and soap webservice responses?
>Can it be implementet in a normal servlet or do i have to code my own http
>server?
>>
>Links to guides would be appreciatet.
>>
>Thanks in advance, Benny
>>
>>
| >
>
That would defeat the purpose of web services. WSDL is meant to be a
binding contract. You think through them and plan them carefully, and
do not alter them without careful planning.
The whole point to interoperability is that someone calling your web
services needs to be able to validate the data going in and coming
back against some kind of schema. If that schema changes often,
you've got problems that won't be solved by implementing web services.
>
If you really want to make SOA folks cringe, just receive and return a
single string that is just one big wad of XML.. Who knows what they
will pass in... anyone's guess what comes out... good luck with that.
>
This is why I don't do Java anymore, these kind of solutions folks
pull out of their arse.
| While I agree that making the contract dynamic defeats the purpose of a
web service I fail to see why this is in any way related to Java?
Silvio Bierman | 
August 24th, 2007, 10:45 PM
| | | Re: How to create virtual webservices?
All the Java developers I ever worked with seemed to get mired down
into bizarre approaches to solutions without ever putting forth effort
to explore the simplest thing that works. Those who abandoned Java in
favor of C# or other languages seem to have a lot less headupthearse
syndrome. |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | | | | What is Bytes?
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over network members.
|