• Post Reply Bookmark Topic Watch Topic
  • New Topic

Web Service  RSS feed

 
Tome Wagese
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I am a beginner in this area but have an urgent need
to fulfill client request.I have some data stored in
SQL table and client wants access to that data in the form of
Web Service instead of ODBC connection. Any step in the right direction would be much appreciated.
Thanks
[ January 27, 2007: Message edited by: Bear Bibeault ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66144
144
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Everyone's questions are urgent. Yours are no more and no less important than anyone else's.

Please read this to see why labelling your posts as "Urgent" is a really bad idea.

I have removed it from your title for you.
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, which parts are you having problems with - developing web services, accessing a database from Java code, or something else?
 
Tome Wagese
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
To be honest, I need help with both creating and consuming Web Services.
I spent all weekend learning about JAX-WS but have not been able to find any real example except simple add and subtract methods.
I implemented those simple Web Services in NetBean 5.5 but I need DB related Web Services example.

Thanks again.
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't see a big difference in how you'd go about developing the WS, if it does some JDBC stuff instead of just adding two numbers.

If you have the samples running, tell us in detail where you are stuck extending those to a "real" WS.
 
Tome Wagese
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Dittmer,
Thanks for the replies. Firstly I admit that I am new in this area
Below is what I have tested so far even though my requirement is little complex.I need to make Web Service method that return data stored in SQL table when client usages that service (Client program is supposed to make CSV file out it) but I am just testing it with simple servlet (in servlet I am getting javax.xml.ws.soap.SOAPFaultException: Internal server error)(IDE used NetBean 5.5, Web Server Tomcat 6.x)

Test Web Method

Test servelet client


Thanks for looking into it.
 
Tome Wagese
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got the exception figured out. I was missing jar files.
Now how do I make it so that the method return xml wrapped columns instead of returning simple string.....
Thanks
 
Dhananjayan Karnam
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI, You need to create the XML by your self by iterating through the loop.
Create tags and embed values in that and return that as a string value. ( This is just suggestion : If the returning XML is very big use XSL to get the values into the xml format and return that.)
 
Tome Wagese
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Karnam,
Thanks for the reply.
I googled a lot looking for simple example I could start working off of and so far no luck.
Is there any reference material/link that you can suggest?
Thanks.
 
Jigar Naik
Ranch Hand
Posts: 762
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

I'm getting the same error.

can you tell me which jar you missed ?

Regards,
 
ramu prabakaran
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use any ORM framework, so that you can get the database result as java Object.
And use Jax-ws or axis for creating the WS. When the client invoke the service,you internally call the database and get the java object and return to the client.
 
NarendraBabu Bandaru
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is -- creating xml response instead of a string. If you are creating the WSDL, then you would be having an XSD for the request or response.

Use JAXB to create the java objects from the XSD's. With that easily you can map your response to java object and you can send directly as an XML itself.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!