You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Jürgen Bockhorn <Ju...@heuboe.de> on 2010/06/30 14:20:00 UTC

Unable to implement two endpoints with one implementor class.

Hello,

we've tried to implement to endpoints in one implentor class. The endpoint interfaces are generated from two different WSDLl-files.

The implementor class implements both interfaces:

                               public class DODAll implements Datex2MSTInterface, ClientPullInterface { ....

Endpoint definition in the beans.xml is like this:

  <bean id="dodallservice" class="de.heuboe.simtd.dod.DODAll"/>

  <jaxws:endpoint xmlns:tns="http://simtd.heuboe.de/dod/datex2MST"
    id="datex2MSTService" implementor="#dodallservice" wsdlLocation="wsdl/Datex2MST.wsdl"
    endpointName="tns:datex2MSTSoapEndPoint" serviceName="tns:datex2MSTService" address="/DODMST">
    <jaxws:features>
      <bean class="org.apache.cxf.feature.LoggingFeature" />
    </jaxws:features>
    <jaxws:properties>
      <entry key="mtom-enabled" value="true" />
    </jaxws:properties>
  </jaxws:endpoint>

  <jaxws:endpoint xmlns:tns="http://datex2.eu/wsdl/clientPull/1_0"
    id="clientPullService" implementor="#dodallservice" wsdlLocation="wsdl/Pull_v1_0.wsdl"
    endpointName="tns:clientPullSoapEndPoint" serviceName="tns:clientPullService" address="/DOD">
    <jaxws:features>
      <bean class="org.apache.cxf.feature.LoggingFeature" />
    </jaxws:features>
    <jaxws:properties>
      <entry key="mtom-enabled" value="true" />
    </jaxws:properties>
  </jaxws:endpoint>

Everthing works fine until we try to deploy this to a tomcat. Now only the methods of the first interface are found. You can retrieve the WSDL of both endpoints, but call only methods of the first one. CXF generates the following warning on startup of the tomcat.

30.06.2010 13:42:16 org.apache.cxf.service.factory.ReflectionServiceFactoryBean initializeWSDLOperations
***=> WARNUNG: Could not find a matching method for operation {http://datex2.eu/wsdl/clientPull/1_0}getDatex2Data. Operation will be unavailable.

We worked around this problem by using two implementor classes which are delegating work to one 'worker' object.

But, is there any reason for this behaviour ?

Thanks in advance,

Jürgen

Re: Unable to implement two endpoints with one implementor class.

Posted by Daniel Kulp <dk...@apache.org>.
You probably need to add an implementorClass="...Datex2MSTInterface" or 
similar to each of the jaxws:endpoint things to tell it which interface to use 
to map the methods.  By default, CXF will look for the first @WebService 
annotation and uses that, which would be the Datex2MSTInterface one.    The 
methods in the client pull endpoint wouldn't map onto there and thus the 
error.


Dan


On Wednesday 30 June 2010 8:20:00 am Jürgen Bockhorn wrote:
> Hello,
> 
> we've tried to implement to endpoints in one implentor class. The endpoint
> interfaces are generated from two different WSDLl-files.
> 
> The implementor class implements both interfaces:
> 
>                                public class DODAll implements
> Datex2MSTInterface, ClientPullInterface { ....
> 
> Endpoint definition in the beans.xml is like this:
> 
>   <bean id="dodallservice" class="de.heuboe.simtd.dod.DODAll"/>
> 
>   <jaxws:endpoint xmlns:tns="http://simtd.heuboe.de/dod/datex2MST"
>     id="datex2MSTService" implementor="#dodallservice"
> wsdlLocation="wsdl/Datex2MST.wsdl"
> endpointName="tns:datex2MSTSoapEndPoint"
> serviceName="tns:datex2MSTService" address="/DODMST"> <jaxws:features>
>       <bean class="org.apache.cxf.feature.LoggingFeature" />
>     </jaxws:features>
>     <jaxws:properties>
>       <entry key="mtom-enabled" value="true" />
>     </jaxws:properties>
>   </jaxws:endpoint>
> 
>   <jaxws:endpoint xmlns:tns="http://datex2.eu/wsdl/clientPull/1_0"
>     id="clientPullService" implementor="#dodallservice"
> wsdlLocation="wsdl/Pull_v1_0.wsdl"
> endpointName="tns:clientPullSoapEndPoint"
> serviceName="tns:clientPullService" address="/DOD"> <jaxws:features>
>       <bean class="org.apache.cxf.feature.LoggingFeature" />
>     </jaxws:features>
>     <jaxws:properties>
>       <entry key="mtom-enabled" value="true" />
>     </jaxws:properties>
>   </jaxws:endpoint>
> 
> Everthing works fine until we try to deploy this to a tomcat. Now only the
> methods of the first interface are found. You can retrieve the WSDL of
> both endpoints, but call only methods of the first one. CXF generates the
> following warning on startup of the tomcat.
> 
> 30.06.2010 13:42:16
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean
> initializeWSDLOperations ***=> WARNUNG: Could not find a matching method
> for operation {http://datex2.eu/wsdl/clientPull/1_0}getDatex2Data.
> Operation will be unavailable.
> 
> We worked around this problem by using two implementor classes which are
> delegating work to one 'worker' object.
> 
> But, is there any reason for this behaviour ?
> 
> Thanks in advance,
> 
> Jürgen

-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog