5 Replies Latest reply on Aug 25, 2013 8:04 PM by Demian Calcaprina

    REST switchyard.xml configuration

    Anton Nikulin Newbie

      I tried to define a service binding via REST, created a promote service and binded it with REST binding in SwitchYard Visual Editor in Eclipse. But after saving a have an error in this xml file.
      My switchyard.xml is like this:

       

      <?xml version="1.0" encoding="UTF-8"?>

      <switchyard xmlns="urn:switchyard-config:switchyard:1.0" xmlns:bean="urn:switchyard-component-bean:config:1.0" xmlns:rest="urn:switchyard-component-resteasy:config:1.0" xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912">

        <sca:composite name="trade-service" targetNamespace="urn:com.magick:trade-service:0.0.1-SNAPSHOT">

          <sca:component name="OrderServiceBean">

            <bean:implementation.bean class="com.magick.trade_service.service.OrderServiceBean"/>

            <sca:service name="OrderService">

              <sca:interface.java interface="com.magick.trade_service.service.OrderService"/>

            </sca:service>

          </sca:component>

          <sca:service name="OrderService" promote="OrderServiceBean/OrderService">

            <sca:interface.java interface="com.magick.trade_service.service.OrderService"/>

            <rest:binding.rest>

              <rest:interfaces>com.magick.trade_service.service.OrderService</rest:interfaces>

              <rest:contextPath>order-service</rest:contextPath>

            </rest:binding.rest>

          </sca:service>

        </sca:composite>

      </switchyard>

       

      And I have such error:

      cvc-complex-type.2.4.a: Invalid content was found starting with element 'rest:binding.rest'. One of '{"http://docs.oasis-open.org/ns/opencsa/sca/200912":binding, "http://docs.oasis-open.org/ns/opencsa/sca/200912":callback, "http://docs.oasis-open.org/ns/opencsa/sca/200912":requires, "http://docs.oasis-open.org/ns/opencsa/sca/200912":policySetAttachment, "http://docs.oasis-open.org/ns/opencsa/sca/200912":extensions}' is expected.


      I've compared this xml with SwitchYard rest-binding quickstart, it is almost the same.

       

      Can you help me to solve this problem?

       

      thanks.