Publishing a Service on the Kuali Service Bus

Service Messages

Request

<ServiceRequest xmlns="http://sampleservice.ucdavis.du/ws/schemas">
    <criteria>
        <Service>Sample Service</Service>
        <Location>Kuali Service Bus</Location>
    </criteria>
</ServiceRequest>

Response

<ServiceResponse xmlns="http://sampleservice.ucdavis.du/ws/schemas">
    <Hello>Sample Service</Hello>
    <World>Kuali Service Bus</World>
</ServiceResponse>

End Point

{http://sampleservice.ucdavis.edu/sampleService}ServiceRequest
Spring Configuration

Given you have some service:

<bean id="myParticularService" class="edu.ucdavis.myapp.service.impl.MyParticularServiceImpl" />

Declare the Service Definition

<bean id="sampleService" class="org.kuali.rice.ksb.messaging.JavaServiceDefinition" abstract="true">
    <property name="serviceNameSpaceURI" value="SAMPLEKSBSVC" />
    <property name="retryAttempts" value="0" />
</bean>

Inject the Service Definition into the KSB Exporter

<bean class="org.kuali.rice.ksb.messaging.KSBExporter">
    <property name="remotedServiceRegistry" ref="enServiceInvoker"/>
    <property name="serviceDefinition">
        <bean parent="sampleService"
            p:service-ref="myParticularService"
            p:localServiceName="myParticularService" />
    </property>
</bean>

Optionally, you can expose the service as a SOAP service

<bean id="sampleSoapService" class="org.kuali.rice.ksb.messaging.SOAPServiceDefinition" abstract="true">
    <property name="serviceNameSpaceURI" value="SAMPLEKSBSVC"/>
    <property name="jaxWsService" value="false"/>
    <property name="priority" value="3" />
    <property name="retryAttempts" value="0" />
    <property name="busSecurity" value="true"/>
</bean>

<bean class="org.kuali.rice.ksb.messaging.PropertyConditionalKSBExporter">
    <property name="remotedServiceRegistry" ref="enServiceInvoker"/>
    <property name="serviceDefinition">
      <bean parent="sampleSoapService"
        p:service-ref="myParticularService"
        p:localServiceName="myParticularServiceSOAP" />
    </property>
    <property name="propertyName" value="myParticularServiceSOAP.expose"/>
</bean>