-
1. Re: http service access binary content
jorgemoralespou_2 Aug 13, 2014 11:55 AM (in response to mlybarger)Hi,
I'm not an expert, but some suggestions.
- Use a camel route, it is much easier for this use case. (composite service binding: http, and composite reference binding: file), So your route could be:
from("switchyard://YourHttpService").to("switchyard://YourFileReference")
- Use ESB interface (as you do not need an java contract) --> inbound: java.lang.Object
- Enable message tracing to see what is getting there, and where is the first point of error
Hope that with this 3 tips, you can do it.
Cheers,
-
2. Re: http service access binary content
mlybarger Aug 18, 2014 2:35 PM (in response to jorgemoralespou_2)Thank you for responding Jorge. I did get a sample from JBoss support showing me to use a rest binding that took as input a InputStream. That seemed to work.
As far as storing the bits to a file, that was just for an example, I needed to be able to process binary data posted to a url. My end service wll transform the binary data (protobuf) to xml and post it to a queue.
-
3. Re: http service access binary content
jorgemoralespou_2 Aug 20, 2014 5:08 PM (in response to mlybarger)HI Mark,
Im glad if you have it working. It would be nice if you could explain your problem hand solution here in the community, as people may face similar problems but might not have support.
cheers,
-
4. Re: http service access binary content
mlybarger Aug 29, 2014 12:57 AM (in response to jorgemoralespou_2)You can checkout the http-binding project under branch 1.1.0.Final-ML on my fork of the switchyard quickstarts at: https://github.com/mlybarger/quickstarts.git
I used a rest binding to my service and took as input an HttpServletRequest object. see the FileEchoServiceBean.java. I also needed to use an http session to maintain state between client interactions. You can notice the request.getSession interaction in the code. To test the service, I used curl as my client program:
curl -b foo -c foo -H MSG:bar -X POST -d HI http://localhost:8080/rest/b/d
My example is just reading text, but as you can see, it has access to the request inputStream so, any data posted can be read.
This was developed on JBDS 7.1.1.GA using jboss fsw 6.0.0.GA,
HTH