You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Christopher Cheng <ch...@gmail.com> on 2009/12/12 08:31:32 UTC

Can't find the request for http://webservices.mycompany.com/websvc's Observer

 Hi,

I've got the following in my server log
Can't find the request for http://webservices.mycompany.com/websvc'sObserver

What am I missing so that the Observer cannot find it's endpoints?
I am using cxf2.2, it has been working in cxf2.1, it seems that CXFServlet
cannot find the endpoints. It's running on jdk1.6.0_11 and resin-3.1.6

The following is web.xml

<web-app>
    <servlet>
        <servlet-name>CXFServlet</servlet-name>
        <display-name>CXF Servlet</display-name>

<servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
        <init-param>
            <param-name>config-location</param-name>
            <param-value>cxf.xml</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>CXFServlet</servlet-name>
        <url-pattern>/*</url-pattern>
    </servlet-mapping>
</web-app>


The following is cxf.xml in WEB-INF/classes

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:jaxws="http://cxf.apache.org/jaxws"
       xmlns:cxf="http://cxf.apache.org/core"
       xmlns:jaxrs="http://cxf.apache.org/jaxrs"
       xsi:schemaLocation="
        http://cxf.apache.org/core
        http://cxf.apache.org/schemas/core.xsd
        http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
        http://cxf.apache.org/jaxrs
        http://cxf.apache.org/schemas/jaxrs.xsd
        http://cxf.apache.org/jaxws
        http://cxf.apache.org/schemas/jaxws.xsd">
    <import resource="classpath:META-INF/cxf/cxf.xml"/>
    <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml"/>
    <import resource="classpath:META-INF/cxf/cxf-servlet.xml"/>
    <jaxws:client name="{
http://webservices.mycompany.com/websvc}FarePortType"
                  createdFromAPI="true">
        <jaxws:dataBinding>
            <bean class="org.apache.cxf.xmlbeans.XmlBeansDataBinding"/>
        </jaxws:dataBinding>
    </jaxws:client>
    <jaxws:endpoint name="{
http://webservices.mycompany.com/websvc}FarePortType"
                    address="/websvc"

wsdlLocation="classpath:com/mycompany/webservices/wsdl/OTA_AirFareDisplayRQ.wsdl"
                    createdFromAPI="true"
                    >
        <jaxws:properties>
            <entry key="schema-validation-enabled" value="true"/>
        </jaxws:properties>
        <jaxws:dataBinding>
            <bean class="org.apache.cxf.xmlbeans.XmlBeansDataBinding"/>
        </jaxws:dataBinding>
    </jaxws:endpoint>

    <bean id="logInbound"
class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
    <bean id="logOutbound"
class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
    <bean id="cxf" class="org.apache.cxf.bus.CXFBusImpl">
        <property name="inInterceptors">
            <list>
                <ref bean="logInbound"/>
            </list>
        </property>
        <property name="outInterceptors">
            <list>
                <ref bean="logOutbound"/>
            </list>
        </property>
        <property name="outFaultInterceptors">
            <list>
                <ref bean="logOutbound"/>
            </list>
        </property>
    </bean>
    <bean id="fastinfoset"
class="org.apache.cxf.feature.FastInfosetFeature"/>
    <cxf:bus>
        <cxf:features>
            <cxf:logging/>
            <ref bean="fastinfoset"/>
        </cxf:features>
    </cxf:bus>
</beans>

The following is the definition of Interface

 WebService(targetNamespace = "http://webservices.mycompany.com/websvc",
name = "FarePortType")
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
public interface FarePortType {
    @WebResult(name = "OTA_AirFareDisplayRS", targetNamespace = "
http://www.opentravel.org/OTA/2003/05", partName = "body")
    @WebMethod(operationName = "FareRQ", action = "OTA")
    public org.opentravel.ota.x2003.x05.OTAAirFareDisplayRSDocument fareRQ(
        @WebParam(partName = "body", name = "OTA_AirFareDisplayRQ",
targetNamespace = "http://www.opentravel.org/OTA/2003/05")
        org.opentravel.ota.x2003.x05.OTAAirFareDisplayRQDocument body
    );
}

Finally the following is the header of the class

@javax.jws.WebService(
                      serviceName = "FareService",
                      portName = "FarePortType",
                      targetNamespace = "
http://webservices.mycompany.com/websvc",
                      wsdlLocation =
"classpath:com/mycompany/webservices/wsdl/OTA_AirFareDisplayRQ.wsdl",
                      endpointInterface =
"com.mycompany.webservices.websvc.FarePortType")

public class FarePortTypeImpl implements FarePortType {
....
}

Re: Can't find the request for http://webservices.mycompany.com/websvc's Observer

Posted by Daniel Kulp <dk...@apache.org>.
Remove the createdFromAPI="true"  flag from jaxws:endpoint.    With that set, 
at some point, you need to call Endpoint.publish or similar to cause it to be 
published.   If it's not set, CXF/Spring will create and publish the object.

Dan


On Sat December 12 2009 2:31:32 am Christopher Cheng wrote:
>  Hi,
> 
> I've got the following in my server log
> Can't find the request for
>  http://webservices.mycompany.com/websvc'sObserver
> 
> What am I missing so that the Observer cannot find it's endpoints?
> I am using cxf2.2, it has been working in cxf2.1, it seems that CXFServlet
> cannot find the endpoints. It's running on jdk1.6.0_11 and resin-3.1.6
> 
> The following is web.xml
> 
> <web-app>
>     <servlet>
>         <servlet-name>CXFServlet</servlet-name>
>         <display-name>CXF Servlet</display-name>
> 
> <servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
>         <init-param>
>             <param-name>config-location</param-name>
>             <param-value>cxf.xml</param-value>
>         </init-param>
>         <load-on-startup>1</load-on-startup>
>     </servlet>
>     <servlet-mapping>
>         <servlet-name>CXFServlet</servlet-name>
>         <url-pattern>/*</url-pattern>
>     </servlet-mapping>
> </web-app>
> 
> 
> The following is cxf.xml in WEB-INF/classes
> 
> <beans xmlns="http://www.springframework.org/schema/beans"
>        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>        xmlns:jaxws="http://cxf.apache.org/jaxws"
>        xmlns:cxf="http://cxf.apache.org/core"
>        xmlns:jaxrs="http://cxf.apache.org/jaxrs"
>        xsi:schemaLocation="
>         http://cxf.apache.org/core
>         http://cxf.apache.org/schemas/core.xsd
>         http://www.springframework.org/schema/beans
>         http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
>         http://cxf.apache.org/jaxrs
>         http://cxf.apache.org/schemas/jaxrs.xsd
>         http://cxf.apache.org/jaxws
>         http://cxf.apache.org/schemas/jaxws.xsd">
>     <import resource="classpath:META-INF/cxf/cxf.xml"/>
>     <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml"/>
>     <import resource="classpath:META-INF/cxf/cxf-servlet.xml"/>
>     <jaxws:client name="{
> http://webservices.mycompany.com/websvc}FarePortType"
>                   createdFromAPI="true">
>         <jaxws:dataBinding>
>             <bean class="org.apache.cxf.xmlbeans.XmlBeansDataBinding"/>
>         </jaxws:dataBinding>
>     </jaxws:client>
>     <jaxws:endpoint name="{
> http://webservices.mycompany.com/websvc}FarePortType"
>                     address="/websvc"
> 
> wsdlLocation="classpath:com/mycompany/webservices/wsdl/OTA_AirFareDisplayRQ
> .wsdl" createdFromAPI="true"
> 
>         <jaxws:properties>
>             <entry key="schema-validation-enabled" value="true"/>
>         </jaxws:properties>
>         <jaxws:dataBinding>
>             <bean class="org.apache.cxf.xmlbeans.XmlBeansDataBinding"/>
>         </jaxws:dataBinding>
>     </jaxws:endpoint>
> 
>     <bean id="logInbound"
> class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
>     <bean id="logOutbound"
> class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
>     <bean id="cxf" class="org.apache.cxf.bus.CXFBusImpl">
>         <property name="inInterceptors">
>             <list>
>                 <ref bean="logInbound"/>
>             </list>
>         </property>
>         <property name="outInterceptors">
>             <list>
>                 <ref bean="logOutbound"/>
>             </list>
>         </property>
>         <property name="outFaultInterceptors">
>             <list>
>                 <ref bean="logOutbound"/>
>             </list>
>         </property>
>     </bean>
>     <bean id="fastinfoset"
> class="org.apache.cxf.feature.FastInfosetFeature"/>
>     <cxf:bus>
>         <cxf:features>
>             <cxf:logging/>
>             <ref bean="fastinfoset"/>
>         </cxf:features>
>     </cxf:bus>
> </beans>
> 
> The following is the definition of Interface
> 
>  WebService(targetNamespace = "http://webservices.mycompany.com/websvc",
> name = "FarePortType")
> @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
> public interface FarePortType {
>     @WebResult(name = "OTA_AirFareDisplayRS", targetNamespace = "
> http://www.opentravel.org/OTA/2003/05", partName = "body")
>     @WebMethod(operationName = "FareRQ", action = "OTA")
>     public org.opentravel.ota.x2003.x05.OTAAirFareDisplayRSDocument fareRQ(
>         @WebParam(partName = "body", name = "OTA_AirFareDisplayRQ",
> targetNamespace = "http://www.opentravel.org/OTA/2003/05")
>         org.opentravel.ota.x2003.x05.OTAAirFareDisplayRQDocument body
>     );
> }
> 
> Finally the following is the header of the class
> 
> @javax.jws.WebService(
>                       serviceName = "FareService",
>                       portName = "FarePortType",
>                       targetNamespace = "
> http://webservices.mycompany.com/websvc",
>                       wsdlLocation =
> "classpath:com/mycompany/webservices/wsdl/OTA_AirFareDisplayRQ.wsdl",
>                       endpointInterface =
> "com.mycompany.webservices.websvc.FarePortType")
> 
> public class FarePortTypeImpl implements FarePortType {
> ....
> }
> 

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