Taggar |
Create your webservice on BEA Weblogic, Part oneI´m currently working for a telecommunication company, building a Virtual PBX for a large telco. The current task for my team is to create a provisioning interface for the outside world to access our system. This interface will be implemented as a set of webservices running on BEA Weblogic with the webservices backed by stateless sessionbeans. Searching the web I haven´t really found any good tutorial on how to do this, so why not post my findings here? (The mainreason for writing this down is for me to remember the drill for my next project. I wrote down some notes when I implemented webservices for sending/receiving sms and mms over ParlayX but those notes were not enough...) My environment is Eclipse as IDE on windows, the server is BEA Weblogic and we use Oracle Real Application Clusters as database. Since we use Weblogic 8.1 we´re stuck with Java 1.4.2 (which has began it´s end-of-life process :-)). The build tool is Apache ANT spiced up with some BEA specific tasks. A lot of the information come from this document, the BEA bible on how to write webservices, only 500 pages... Ok, let´s get started. I assume you have your project set up, ANT installed and all other libraries needed (right now I can only think of webservices.jar and weblogic.jar from the Weblogic installation). The first thing you need is to get your hands on the wsdl file describing your webservice interface. Let´s call it 'myWebservice.wsdl'. With this file as input you use the BEA ant task autotype to generate serialization support classes, data type mapping information and more. You need to define the task in your buildfile: The JavaSchema class is located in the webservices.jar file.
In order to run the ant task you need to add the Weblogic-jarfiles mentioned above to your ant configuration in Eclipse. If you manage to run this task you should have the generated java representions of your types, the serialization classes and type mapping information (in a file called types.xml). My greatest problem at this point use to be how to add external jar-files to the ant configuration. I usually try the preferences/ant/runtime page in eclipse, then continue to add it as a pathelement or something like that in the build.xml file but normally end up at the run configuration. Well, as long as it works... This seem to be a good time for a break, there is always something weird with those pesky wsdl and xsd-files messing things up so when the first ant task runs as it should you just feel great :-)
|
Användarinloggning |