Gennady wrote:
Hello,
Sorry for asking a dumb questions, but:
1) How do you write an event producer service from scratch
(what interfaces, classes do i have to write for the
'WsnWsdl2JavaTask' compiler)?
Gennady,
There's no such thing as dumb questions, especially when there are no docs
yet! To write a producer service from scratch, you should always start
first by writing a WSDL. The easiest way to do this is to start from the
template WSDL included in the Hermes distribution at
docs/tutorial/_TEMPLATE_.wsdl. Make a copy of this file and then edit
that. You'll want to uncomment the properties, portType operations, and
binding operations that are part of the NotificationProducer portType.
Also uncomment the properties and operations for any WSRP/WSRL portTypes
you wish to support. Finally, add any custom properties or operations you
want to provide. Then update the port name and soap:address location to
reflect the name you'd like the service to have.
Now you're ready to run the WsnWsdl2Java Ant task on your WSDL. This will
produce all the artifacts you'll need to deploy the service to Hermes.
You'll want to edit two methods in these classes before compiling and
deploying - the init() method in YourResource.java (in here you should add
code for initializing the resource's ResourcePropertySet and
TopicSpaceSet) and the getInstance() method in YourResourceHome.java (in
here you should add code for retrieving/creating an instance of
YourResource). Use the WSDM interop WeatherStation resource in the Muse
project as an example.
Once you've updated your Resource and ResourceHome, you're ready to
compile and deploy your service. To do this, you can use the 'compile' and
'deploy' targets in the build.xml that was generated by WsnWsdl2Java.
2) Also how do i write a client, i.e. which files do i
need to generate create for the compiler (as i have noticed
that there are alot of auto generated files in muse client
folder
C:\ws\muse-bin\docs\interop\src\test\org\apache\ws\muws\interop\client)?
The following steps i did so far:
1) installed:
java 1.4.2_08-b03
ant 1.6.2
Tomcat 5.0.30 (C:\apps\Tomcat5.0\webapps)
2) extracted hermes binary (C:\ws\hermes-bin)
3) copied: C:\ws\hermes-bin\webapps\hermes
-> C:\apps\Tomcat5.0\webapps\hermes
4) modefied
C:\ws\hermes-bin\docs\tutorial\build.properties
hermes.webapp.dir=C:/apps/Tomcat5.0/webapps/hermes
5) ran the build script
C:\ws\hermes-bin\docs\tutorial>ant generate
i was able to varify that tomcat runs by going to the:
http://localhost:8080/hermes/services
there were 3 wsdl files available: AdminService, Version,
and SubscriptionManager.
WsnWsdl2Java does not currently generate any client classes; this is on
our roadmap. In the meantime, there are a few ways you could go about
creating a client:
1) use the org.apache.ws.util.soap.SoapClient utility class or the
org.apache.ws.util.soap.SoapClientTask Ant task to send the request. This
utility basically takes an endpoint URL and a File or InputStream
containing the SOAP request envelope. See the soapclient.xml Ant script in
the Hermes tutorial directory for an example of using SoapClientTask, and
see the *.soap files in the requests/ subdir for examples of Subscribe,
GetCurrentMessage, etc. requests.
2) use the org.apache.axis.message.addressing.tools.wsdl.Wsdl2Java utility
class that comes w/ Apache Addressing to generate client stubs; this class
extends Axis' Wsdl2Java to add support for including WSA headers in requests.
3) build up the requests as XmlBeans and then use SoapClient, JAX-RPC
SoapConnection, or some other way to send the request. The interop test
clients provide examples of using this method; in particular, look at the
ResourceStub class.
> Any information would be greatly appreciated,
> Sincerely,
> Gennady
Hope this helps. Docs are coming soon! In the meantime, if you get stuck,
just ask us for help.
Ian
__________________________________
Do you Yahoo!?
Make Yahoo! your home page
http://www.yahoo.com/r/hs
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]