How to port WCF RESTful web service to Axis 2/C (or WSO C++) -
We use some web service applications (currently in the prototype phase) from WCF / C # to the C ++ cross-platform web service Looking back to starting the framework Therefore, I am looking at Axis 2 / C or WSO2WSF / C ++ possible frameworks. I really want to stop the functionality already written in the other service framework in the WCF service.
The functionality here is:
- The web receive call returns to JSON - supported Axis 2 / Java (not yet fixed for C / C ++ versions )
- Can refund arbitrary content (such as generated images or pages) too.
In WCF, you can return JSON by decorating the service operation in this way:
[OperationContract] [WebGet (UriTemplate = "/ calltimings ", Bodystyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json] TimingInfo [] Calltimes ();
Where TimingInfo is a simple data contract that serializes JSON. How do I do this in Axis 2 (Java version anyway)
Other My Phone service supports:
[WebGet (UriTemplate = "/ping.htm")] Stream Ping (HTML);
Where the html page is dynamically generated There are other similar calls that return a stream
in which the contents of the images are created, the WCF framework magically conducts and the content directly puts the HTTP response in the body. This is very good for images, because I can write web client code like this:
So, my question is: How can I write an Axis 2 / C service operation which will return image content directly to the caller?
How can I write it to a web client?
& lt; Img id = "viewportX" src = "http://www.myservice.com/axis2/some_service/getimage?rotation=93" />
What do I do?
Comments
Post a Comment