title: Convert SOAP to a virtual Restful service?
body: <p>Is there a way to use my SOAP web service(spring-ws, java) as a XML based RESTful service virtually?</p>
  
  <p>I don't want to re-write whole my SOAP web service into RESTful from scratch in java, but I need to access it through iphone using REST, which they already have easy native support.</p>
  
  <p>XMLGateway, Proxys..? or some extra java code? since my SOAP request and response is simply an XML file why can't I modify it to be used by a REST service?</p>
  
  <p>Or without changing changing any logic and xml parsing in my application is that easy to add jax-rs annotations and create a rest request xml?</p>
  
  <p>my config spring file is like this:</p>
  
  
  
  <pre class="lang-xml prettyprint-override"><code>&lt;bean id="webServicePluginDescriptor"
      class="com.mysite.ws.configuration.MyWebservicePluginDescriptor" /&gt;
  
  &lt;bean id="payloadMapping"
      class="org.springframework.ws.server.endpoint.mapping.PayloadRootQNameEndpointMapping"&gt;
      &lt;property name="defaultEndpoint" ref="inferenceEndPoint" /&gt;
      &lt;property name="interceptors"&gt;
          &lt;list&gt;
              &lt;ref local="validatingInterceptor" /&gt;
              &lt;ref local="payLoadInterceptor" /&gt;
          &lt;/list&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  
  &lt;bean id="payLoadInterceptor"
      class="org.springframework.ws.server.endpoint.interceptor.PayloadLoggingInterceptor" /&gt;
  
  &lt;bean id="validatingInterceptor"
      class="org.springframework.ws.soap.server.endpoint.interceptor.PayloadValidatingInterceptor"&gt;
      &lt;property name="schema"
          value="classpath:/wsdl/Request.xsd" /&gt;
      &lt;property name="validateRequest" value="true" /&gt;
      &lt;property name="validateResponse" value="false" /&gt;
  &lt;/bean&gt;
  
  &lt;bean id="PropertyResource" class="com.mysite.ws.im.PropertyResource"&gt;
      &lt;property name="resource"
          value="/WEB-INF/client-specific/InferenceMachine.properties" /&gt;
  &lt;/bean&gt;
  
  &lt;bean id="inferenceEndPoint" class="com.mysite.ws.web.InferenceEndPoint"&gt;
      &lt;property name="messageWebService" ref="messageWebService" /&gt;
  &lt;/bean&gt;
  &lt;bean id="messageWebService" class="com.mysite.ws.service.MessageWebService"
      scope="request"&gt;
      &lt;aop:scoped-proxy /&gt;
      &lt;property name="inferenceService" ref="inferenceService" /&gt;
  &lt;/bean&gt;
  
  &lt;bean id="Request" class="org.springframework.xml.xsd.SimpleXsdSchema"&gt;
      &lt;property name="xsd" value="classpath:/wsdl/Request.xsd" /&gt;
  &lt;/bean&gt;
  
  &lt;bean id="Response" class="org.springframework.xml.xsd.SimpleXsdSchema"&gt;
      &lt;property name="xsd" value="classpath:/wsdl/Response.xsd" /&gt;
  &lt;/bean&gt;
  
  &lt;bean id="Error" class="org.springframework.xml.xsd.SimpleXsdSchema"&gt;
      &lt;property name="xsd" value="classpath:/wsdl/Error.xsd" /&gt;
  &lt;/bean&gt;
  
  &lt;bean id="mwsid"
      class="org.springframework.ws.wsdl.wsdl11.SimpleWsdl11Definition"&gt;
      &lt;constructor-arg value="classpath:/wsdl/mtchwsdl.wsdl" /&gt;
  &lt;/bean&gt;
  
  &lt;bean id="inferenceService" class="com.mysite.ws.im.InferenceService"
      scope="request"&gt;
      &lt;aop:scoped-proxy /&gt;
      &lt;property name="webServiceConfiguration" ref="wsPlayerConfiguration" /&gt;
  
      &lt;property name="properties"&gt;
          &lt;bean class="com.mysite.ws.im.PropertyResource"&gt;
              &lt;property name="resource"
                  value="/WEB-INF/client-specific/InferenceMachine.properties" /&gt;
          &lt;/bean&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  
  &lt;!-- ~~~~~~~ Application beans ~~~~~~~ --&gt;
  &lt;bean id="wsPlayerConfiguration"
      class="com.mysite.ws.configuration.WebServiceConfiguration"
      scope="request"&gt;
      &lt;aop:scoped-proxy /&gt;
      &lt;property name="playerConfiguration" ref="playerConfiguration"&gt;&lt;/property&gt;
      &lt;property name="configurationSetup" ref="configurationSetup"&gt;&lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>and this is my endpoint class:</p>
  
  
  
  <pre class="lang-java prettyprint-override"><code>/**
   * The EndPoint of the Web Service Application. This class gets the raw
   * SOAP-body message from the Spring Payload Dispatcher and sends the message to
   * the @see MessageService class. After it has gotten the response XML message
   * it returns this back to the Spring Payload Dispatcher.
   */
  public class InferenceEndPoint extends AbstractJDomPayloadEndpoint {
  
      private MessageWebService messageWebService;
      public InferenceEndPoint() {
      }
  
      @Override
      protected Element invokeInternal(Element inferenceRequest) throws Exception {
          Element ret = messageWebService.handleRequest(inferenceRequest);
          return ret;
      }
  
      /**
       * @param messageWebService
       */
      public void setMessageWebService(MessageWebService messageWebService) {
          this.messageWebService = messageWebService;
      }
  }
  </code></pre>
  
  <p>any ideas?</p>