REST Service with textual output

lylec's picture
Hello all, I wish to create a WSO2 Mashup REST service that publishes a textual response. To this end I have looked at the RESTSample from WSO2MS v2.1.0. Here is an example of the response when this service is invoked through the HTTP endpoint: - <ws:getWeatherResponse xmlns:ws="http://services.mashup.wso2.org/RESTSample?xsd"> <return>Silvery Sunshine</return> </ws:getWeatherResponse> My question is, How do I get WSO2MS to not wrap the response in XML tags, in other words, I would like the response as following plain text: Silvery Sunshine Thanks in advance for your assistance, Lyle "Punchee".
ruchira's picture

Hi, Axis2 Web Service engine

Hi, Axis2 Web Service engine is used as the backend of Mashup Server. As Axis2 is a soap engine, you always get an xml as the response. So you will have to parse the xml and get the result. There are many ways to parse an xml, you could easily find an xml parser for your environment. regards, Ruchira
lylec's picture

Integrating WSO2 with Semantic MediaWIki

I am looking to integrate WSO2 Mashup Server (WSO2MS) with Semantic MediaWiki (SMW) to create a Mashup based Personal Learning Environment and as such require that the WS response be suitable for use as the src="xx" parameter in an IFRAME element. Here is an example of the page that uses dynamically constructed Ajax enabled window widgets based on IFRAMEs: http://chamarette.podzone.net/mediawiki/index.php?title=Movies-WSO2_Mashup Using the innerHTML property to dynamically set the content of the IFRAME is prone to problems related to handling quotes and apostrophe characters, so is not an elegant/viable option. Is it possible that you can point me to the source package that constructs the response so that I can strip the XML to create a truly RESTful service response? When the RESTSample service is invoked in a non RESTful manner, the response does not include the XML tags. Using an external XML parser will nullify the utility of WSO2MS. I may as well use JSP from an external Tomcat server to service the IFRAME src="xx" requirements. Alternatively, I suppose I could persist the (non-XML) HTML fragment to disk using WSO2MS FILE object, and point the IFRAME src to that URL.
library project main code
Learn Cloud
Learn
Cloud

The WSO2 Application Server is a reliable application server that can host your enterprise web applications. The WSO2 Application Server as a Service is offered in StratosLive, the WSO2 Platform as a Service. This article explains how a simple web application can be developed and deployed from Carbon Studio to the WSO2 Application Server...

Latest Webinar
KeellsSuper is a leading supermarket chain with 50-plus outlets in Sri Lanka, and it offers the only online supermarket in the country. In 2005, JKH implemented SAP ERP across it’s 70 subsidiaries...
Thursday, February 16th 2012, 09.00 AM (PST)

Thursday, February 16th 2012, 10.00 AM (GMT)