Hi
But When Sync Service uses PolicyService using the Client API, I am getting
the following error even though I am registering reader within the sync
service.
SEVERE: .No message body reader found for class : class
biz.neustar.panjika.policy.dto.ProfilePolicy, ContentType : {1}.
I'll fiix the issue with {1}...(it might've been fixed in 2.2.4 though).
The client which is created inside "syncService" does not get the providers
which have been registered for
the syncService itself...I didn't want to do it to avoid some unexpected clashes, ex, syncService is using a customized JAXBProvider
which makes sense in the scope of interactions between "syncService" clients and the "syncService" itself but which would break the
outbound XML requests "syncService" might be doing while processing some calls...
I think I might add a jaxrs property to jaxrs:server, something like 'inheritProviders' which will let clients just to use providers
utilized by the endpoint itself...
In meantime, please use jaxrs:client, ex :
<jaxrs:client id="policyClient"
address=http://localhost:9092/policy
serviceClass="MobilePhonePolicyQueryService">
<jaxrs:providers>
<ref bean="profilePolicyReaderProvider"/>
</jaxrs:providers>
<jaxrs:client>
and have this code in the syncService impl :
@Resource(name = "policyClient")
private MobilePhonePolicyQueryService webClient;
Unfortunately, this requires you to know the MobilePhonePolicyQueryService address in advance, if it's feasible then it will work,
otherwise a createdFromAPI = true attribute which actually works for jaxws:client(s) would be the best fit, but I haven't even tried
it with jaxrs:client yet. So I have two more tasks now to deal with (inheritProviders property, createdFromAPI = true support)
let me know how it goes please
Sergey
I have two services registered.
<jaxrs:server id="syncService" address="/sync">
<jaxrs:serviceBeans>
<ref bean="syncServiceBean" />
</jaxrs:serviceBeans>
<jaxrs:providers>
<ref bean="syncRequestReader"/>
<ref bean="downloadWriter"/>
<ref bean="profilePolicyReaderProvider"/>
</jaxrs:providers>
</jaxrs:server>
<jaxrs:server id="policyService" address="/policy">
<jaxrs:serviceBeans>
<ref bean="mobilePhonePolicyQueryService"/>
</jaxrs:serviceBeans>
<jaxrs:providers>
<ref bean="profilePolicyReaderProvider"/>
<ref bean="profilePolicyWriterProvider"/>
</jaxrs:providers>
</jaxrs:server>
<bean id="syncRequestReader"
class="biz.neustar.panjika.server.dto.SyncRequestReaderProvider"/>
<bean id="downloadWriter"
class="biz.neustar.panjika.server.dto.DownloadWriterProvider"/>
<bean id="profilePolicyReaderProvider"
class="biz.neustar.panjika.policy.dto.ProfilePolicyReaderProvider"/>
<bean id="profilePolicyWriterProvider"
class="biz.neustar.panjika.policy.dto.ProfilePolicyWriterProvider"/>
Sync Service is using a reader/writer provider and while PolicyService has
its own two providers. Both work independently fine.
But When Sync Service uses PolicyService using the Client API, I am getting
the following error even though I am registering reader within the sync
service.
SEVERE: .No message body reader found for class : class
biz.neustar.panjika.policy.dto.ProfilePolicy, ContentType : {1}.
javax.ws.rs.WebApplicationException
at
org.apache.cxf.jaxrs.client.AbstractClient.reportNoMessageHandler(AbstractClient.java:450)
at
org.apache.cxf.jaxrs.client.AbstractClient.readBody(AbstractClient.java:410)
at
org.apache.cxf.jaxrs.client.ClientProxyImpl.handleResponse(ClientProxyImpl.java:422)
at
org.apache.cxf.jaxrs.client.ClientProxyImpl.doChainedInvocation(ClientProxyImpl.java:404)
at
org.apache.cxf.jaxrs.client.ClientProxyImpl.invoke(ClientProxyImpl.java:163)
at
org.apache.cxf.common.util.CglibProxyHelper$1.intercept(CglibProxyHelper.java:66)
at
biz.neustar.panjika.policy.MobilePhonePolicyQueryService$$EnhancerByCGLIB$$ad5a408f.isPublished(<generated>)
Any help is greatly appreciated.
Thanks
rkam
--
View this message in context:
http://www.nabble.com/Multiple-Custom-Providers-tp25916823p25916823.html
Sent from the cxf-user mailing list archive at Nabble.com.