Contract details in JAXRS/Spring/CXF Endpoint Configuration -- Namespace, PublishedUrl, etc

Go To StackoverFlow.com

1

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?

2012-04-04 01:01
by ingyhere
I'm trying to test whether something Spring-wise can be adapted from the jaxws configuration in item (5) here: http://cxf.547215.n5.nabble.com/Usage-of-JaxWsServerFactoryBean-td571428.html - ingyhere 2012-04-04 06:10
did you got something on it - Kulbhushan Singh 2018-01-29 08:35


1

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> 

2018-01-29 08:43
by Kulbhushan Singh
Ads