0

I just want to write a simple web service using Axis2 which can show a html page when accessed.

So here’s what I’ve done so far... I wrote trying to write a web service in Axis2 with a java class file, which will print with a html output, the problem here is - Axis 2 is embedding the html output within the WSDL Tags. Is it really possible to achieve a html response with Axis2 Web Service.?

In service.xml:

<service name="TestService">
        <description>
            This is a sample Web service with two operations, echo and ping.
        </description>
        <parameter name="serviceClass">com.xxx.xxxx.MyService</parameter>
        <operation name="getString">
..................
.......
</service>

And the MyService.Java :

public class MyService {
     public void getString() {
         System.out.println("<html><body><h1>Hello</h1></body></html>");
        }

}
dt542
  • 9
  • 5
  • Can you please add what you tried ? – Rabea Dec 08 '15 at 20:35
  • @RabeeAbdelWahab I updated the Question – dt542 Dec 08 '15 at 21:12
  • Display web service (backend) in HTML (front-end) should follow another way like this, see tutorial: http://www.w3schools.com/WebServices/ws_use.asp – Vy Do Dec 24 '15 at 14:35
  • @dovy Have you ever used Axis 2? The Axis 2 will wrap your HTML result inside WSDL Tags. So It will displayed as a XML result. – dt542 Dec 24 '15 at 16:03
  • read these stuff: http://stackoverflow.com/a/2784294/3728901 and http://www.w3.org/TR/wsdl (quote: WSDL is an XML format for describing network services as a set of endpoints operating on messages containing either document-oriented or procedure-oriented information.) Don't put HTML mark up inside WSDL, put it into input/output XML only. – Vy Do Dec 24 '15 at 16:13
  • @dovy We don't put the HTML inside the WSDL, the Axis2 does that by itself. That is reason why I posted this question, if is there a way to control its behavior. – dt542 Dec 24 '15 at 18:42
  • I did lot of research but couldn't find anything which clearly shows/states a way by which we can display/print HTML page/content directly without letting Axis2 to wrap the response. – dt542 Dec 24 '15 at 18:44

0 Answers0