How do I flesh out my context configuration with Endpoint details in JAXRS?
Here is what I have for JAXWS:
<jaxws:endpoint id="s-myService" implementor="#myService"
serviceName="s2:MyService"
endpointName="e2:MyServiceEndpoint"
address="/my-service/soap/base"
publishedEndpointUrl="http://localhost:8080/my-service/soap/base"
xmlns:s2="http://localhost:8080/example-service/ns"
xmlns:e2="http://localhost:8080/example-service/ns"
/>
How do I make the following JAXRS Endpoint implement the same details?
<jaxrs:server id="r-myService"
address="/my-service/rest/base">
<jaxrs:serviceBeans>
<ref bean="myRestService" />
</jaxrs:serviceBeans>
<jaxrs:providers>
<bean class="org.codehaus.jackson.jaxrs.JacksonJsonProvider" />
<ref bean="SomethingGives"/>
</jaxrs:providers>
<jaxrs:extensionMappings>
<entry key="json" value="application/json" />
<entry key="xml" value="application/xml" />
</jaxrs:extensionMappings>
</jaxrs:server>
I'd really like to see publishedEndpointUrl fleshed out in the REST service. The API for JAXRSServerFactoryBean implies it can be done through an inherited field. How should the context configuration be implemented?
You can use the publishedEndpointUrl as part of your jaxrs attribute.
<jaxrs:server id="r-myService"
address="/my-service/rest/base" publishedEndpointUrl="http://localhost">
<jaxrs:serviceBeans>
<ref bean="myRestService" />
</jaxrs:serviceBeans>
<jaxrs:providers>
<bean class="org.codehaus.jackson.jaxrs.JacksonJsonProvider" />
<ref bean="SomethingGives"/>
</jaxrs:providers>
<jaxrs:extensionMappings>
<entry key="json" value="application/json" />
<entry key="xml" value="application/xml" />
</jaxrs:extensionMappings>