Marcos,

I'm not sure if you can simple host the DWRServlet in ServiceMix as it is now. I know there is an open issue for deploying WAR files, but I have no idea what the story is for a plain servlet.

You probably want to take a look at the new ServiceMix 3.2 <http:consumer/> endpoints and the corresponding HttpConsumerMarshaler. This basically allows you to send/receive HTTP requests/responses in a format that you like (e.g. JSON) and transform them into an XML NormalizedMessage yourself for sending them into the NMR. When the message has been normalized and is sent into the ESB, you can use every other component for actually handling the MessageExchange.

The JSR-181 component is specifically geared towards building web services. For you, it might be more interesting to look at the servicemix-bean component, which allows you to write simple Java code to handle a MessageExchange.


Does this clarify things for you?

Gert

marcosscriven wrote:
Hi there

A little background - I'm working for a company that uses ServiceMix, and
has written a few of its own Service Engines (although at this point it
looks like things have not been done properly, and don't take SAs - but just
sort of work on their own config)

At the moment, I am trying to come up with an AJAX/JSON/DWR solution, BUT
integrated into servicemix.

Now, so far as I understand the terminology so far, I think what I need is:

1) servicemix-http component...
2) ...into which I place my own service unit (SU), created using the
http-consumer maven archetype...
3) ... generic service assembly (SA), targeted to the sm-http component (ie
basically a POM file, as generated by the sa maven archetype)

Is that about right? What I want to be able to do at the end is make HTTP
requests, using the AJAX/DWR. That basically means I need to host a servlet
(ie the DWR servlet) in the Jetty web container.

If I'm right, all that kind of makes sense (so far). If I'm wrong - please
tell me!

So - what is still confusing me are two things:

1) Endpoints - I kind of get what they are (ie points where messages are
sent to), but I am unclear on how to define them, and what the various
attributes do

2) SOAP - Do I have to use it? I will be using DWR, and am specifically
trying to avoid SOAP in this instance.
Looking at the first-wsdl example, it looks to me that its using xfire to
create a service from simple annotations in the code, dumping out a WSDL
that describe it, and linking it all together.

What I don't understand from that example is how to get rid of the SOAP
part.

As you can see, generally I'm a little confused, so any general pointers
would be welcome, as well as specific ones. I've searched Google endlessly,
and I've not found any examples of people do quite the same thing.

Oh, one thing, *examples*/*snippets* MUCH appreciated :)

Marcos



Reply via email to