Hi Gert

Thanks for the response - unfortunately I still have some questions. I think
the problem is I've just been dumped in the deep end! 

Essentially, what I want to know is how to map my experience simply hosting
a servlet (in this case the DWRServlet) in a standalone Jetty server, to
doing the very same thing in Jetty wrapped up in a component (ie the
servicemix-http component). 

So I've a few questions:

1) Are you saying that the servicemix-http component, even though it
contains Jetty, cannot host servlets?

2) Re your point about HTTP Endpoints - that might help. I already have
something to convert from a the XML data I am trying to display to the JSON
format. Would I therefore just need to wrap this class in an
'HttpConsumerMarshaler' class?

3) You mention the servicemix-jsr component - did you realise it was the
http component and not the JSR component I was talking about? I only
mentioned the JSR component as that's what I saw in the first-wsdl example

4) Even if I use servicemix-bean, would I still not need some code to
actually handle taking in HTTP requests?

5) Overall, I am still a little confused about the terminology, so I'll
re-describe what I want:

I want to go to a browser and call a page, hosted by any old webserver,
which then makes AJAX calls to something like
http://myhost:1234/getLatestData?paramN=valueN....

That request goes to Jetty in the servicemix-http component. In there
somewhere is a cache that will hold data that is constantly being sent to it
by another component. IE The servicemix-http component is simply configured
to serve out the contents (part or whole) as JSON objects of a cache that's
constantly updated by message from another component.

So how do you describe that in servicemix/JBI terms? I *think* that I am
writing a service assembly, that contains only one service unit. That
service unit contains configuration that defines how the http request is
dealt with. Or do I need to write my own JSON binding component?

Still somewhat in the dark, any help appreciated.

Thanks

Marcos


Gert Vanthienen wrote:
> 
> 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
>>
>>
>>   
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Read-the-docs%2C-and-I%27m-still-a-little-confused-tf4857246s12049.html#a13911047
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Reply via email to