• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 304
  • Last Modified:

Creating a web service

Hello,

I would like to create a java web service on apache web server. I never did such thing before. I have some  general knowledge of java, but I think it would go faster if I ask an expert. I will create client my self in PHP.
What I generaly need is make apache FOP available as web service so I can create reports.
If anyone has done this before I would like to ask for some guidelines "what goes where" so I can make this work. In my web project only reports are missing and I thought it would be nice and clean solution to have a web service like this to accept transofmration requests to proces.

Thanks,
Pet
0
hpet
Asked:
hpet
  • 10
  • 6
  • 4
  • +2
1 Solution
 
somasekharCommented:
Hello

Axis is the tool available from apache. you can use that for creating webservice. it is very easy to create web service using axis.
you can download axis from

http://ws.apache.org/axis/


there is an article regarding this in onjava.com
http://www.onjava.com/pub/a/onjava/2002/06/05/axis.html


hope this will help

somasekhar
0
 
hpetAuthor Commented:
Hi,

I noticed this axis poping up while I was browsing internet. I will follow your link and see more.
In few words, what is axis?

Pet
0
 
somasekharCommented:
Apache Axis is an implementation of the SOAP ("Simple Object Access Protocol")

Axis is essentially a SOAP engine -- a framework for constructing SOAP processors such as clients, servers, gateways, etc. The current version of Axis is written in Java, but a C++ implementation of the client side of Axis is being developed.

But Axis isn't just a SOAP engine -- it also includes:

a simple stand-alone server,
a server which plugs into servlet engines such as Tomcat,
extensive support for the Web Service Description Language (WSDL),
emitter tooling that generates Java classes from WSDL.
some sample programs, and
a tool for monitoring TCP/IP packets.



for more information visit Apache axis user guide at
http://ws.apache.org/axis/java/user-guide.html


I copied the above comments from thjat link only.

Thanks and Regards
SomaSekharaReddy.K
.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
suprapto45Commented:
Hi,

Did you use any IDE such as WSAD or Bea WebLogic? If so, you can easily create the web services in one click. If you have these tools, please let me know, I will direct you to the best sites.

Regards
Dave
0
 
hpetAuthor Commented:
I must admit that till recently I more or less used MS environment and tools, but lately I took path into web applications using PHP as front end and now Java for some tasks like FOP (it seems more apropriate for similar tasks since it is not scripting language. I get object persistency which leads to greater performance on repeating similar tasks).
I have some general knowledge of Java from before but never worked with webservices therefore never used Axis, Bea or any IDE.

In a mean time I did some quick reading on Axis and it seems quite straighforward and easy task to create webservice. What advantage Bea offers over Axis? Any general difference between two?

I am looking for some solution that is most simple and requires less dependencies.
What all do I need for Bea Weblogic.
Are those only IDE's that work on Axis?

Pet
0
 
suprapto45Commented:
Hi Pet,

Well, I am not really sure about that but I think that your assessment on Bea and WSAD is correct that those are the IDE that work on Axis or some sort of that.

Regards
Dave
0
 
somasekharCommented:
Axis does not has face or IDE so far. Same time it is free open source and can be pluggable with any app servers or webservers like BEA WEblogic, IBM WebSphere, Tomcat...etc


you can create webservices with the IDE's provided by BEA work shop. and WSAD( IBM's) . you need to deploy on those servers.or those IDE's are more specific to their respective appserver. i did not mean to say they did not support others ..


when you have same performance and flexibility why to go for Appservers or IDE cost you some $$$$

Apache has very best tools to use

I love to use Axis to expose webservice.. same time Apache has another tool for invoking webservice (WSIF)
http://ws.apache.org/wsif/.. not sure what BEA and IBM provides


this is my thoughts

somasekhar
0
 
suprapto45Commented:
Yes,

Somasekhar is right. IDE will cost you some money.

You should find out whether Eclipse has the Axis plugin as Eclipse is a free Java IDE. You can freely download it from their websites.

Regards
Dave
0
 
somasekharCommented:
you can use axis with eclipse.. all you need to do is create a java project in eclipse and configure axis libraries are in its class path... you can configure tomcat also with eclipse.

tomcat plug in avaialble. axis is an api so you can integrate
.. i am using axis with eclipse
so i feel i don't need any plugin.

somasekhar
0
 
CodingExpertsCommented:
Just a thought , Webmethods glue is pretty simple to work on. You can download it from .. the standalone edition is free

http://www.webmethods.com/meta/default/folder/0000007014

-CE
0
 
hpetAuthor Commented:
Oh, guys I am learning alot now!
Don't feed me too many information at once :)
I will need couple of days to read all this carefully.

Pet
0
 
somasekharCommented:
Good luck
0
 
drjustinCommented:
Yep, just concuring with CodingExperts, WebMethods GLUE is probably the easiest way to go - tried it my self. Posting WS is as simple as writting XML, interface and its implementation.
Invoking service is also very plane - WSDL2Java + interface.
0
 
hpetAuthor Commented:
Hi,

I need a little help so I can continue with my reading of all you said above.
Because I am new to all this other non-MS world please be patient with me.
I am confused with all this servers.

I need to get clear picture of concept before I move on.
If I understand corectly:

1. I need web server (i.e. Apache)
2. I need TOMCAT (for AXIS to run because TOMACAT gives web server additinal functionality to run applications - servlets, etc.)
3. I need AXIS (to be able to expose webservices)

Is this a corect way? Is all of this a MUST?
What is acceptable minumum to be able to serve: html, php, webservice
Can I exclude Apache web server or is TOMCAT "extended functionality"

Thanks for help,
Pet
0
 
CodingExpertsCommented:
All you need is TOMCAT +AXIS/Glue to expose your webservice and for your web-application.
You need not have an Apache Http Server for TOMACAT will serve that purpose for you.

For any more doubts feel free to ask ... this is what this forum is primarily meant for ;-)

-CE
0
 
hpetAuthor Commented:
But in TOMCAT I can only run PHP as a servlet, right?
I searched the internet and I can't see any other way of running PHP on TOMCAT.

-Pet
0
 
CodingExpertsCommented:
For running php in tomcat see

http://wiki.apache.org/jakarta-tomcat/UsingPhp

-CE
0
 
hpetAuthor Commented:
Hi all,

I end up using servlet.
Which is better now? webservice or servlet? I need this only for my own usage so I assume servlet would be ok?

I ran on different problem now which is probably in FOP usage it self.
No mather if I use UTF-8 encoding in XML/XSL when it is being processed by Xerces XSLT procesor some characters are not displayed corectly.

Does any of you know how to influence on this?
I realy need central european characters.

Thanks Pet
0
 
hpetAuthor Commented:
It seems to me that transformation is correct.
If I transform XML to XSL-FO It is still using correct characters.
When XSL-FO is rendered to PDF they are not rendered properly.
All "unknown" characters become #

Pet
0
 
CodingExpertsCommented:
Try this

<?xml version="1.0" encoding="ISO-8859-2"?>

-CE
0
 
hpetAuthor Commented:
I will try this too, but actualy I think problem is in font.
Base PDF fonts don't include special character glyps. There is a tool to add fonts so I will try this.
If all transformations come correct but rendering skips unknown characters then I assume this is the case.

Thanks,
Pet
0
 
somasekharCommented:
I belive you need to use some third party jars
0
 
hpetAuthor Commented:
Alright! I managed to make it work.
It works like a charm.

But now I am using servlet and not web service as my first intention was. I somehow found it simplier. What I am missing now is that using it as a servlet I need to create files and then call servlet to pick files up before processing. I would like to avoid this file creations. Is it somehow possible to pass (in my case xml) string to servlet from PHP engine? Perhaps through some server variables...

Pet
0
 
hpetAuthor Commented:
I am going to close this topic, thank you all for your help.
If you have time I would like to ask your oppinion on this one:
Currently I am passing file pointers to FOP servlet.

I also have alternative solution where I could transfer XML files to be processed over socket.
Which solution do you think is better? I don't have much experience with it and I can't do extended testing. Is file "manipulation" better, faster, solution or do you think transfering xml through socket would be better?

Thank you for your help.
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

  • 10
  • 6
  • 4
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now