在标准的 eclipse java 项目中,cxf.xml 配置文件的正确位置在哪里?我正在尝试启用在独立 jar 格式客户端 ws 消费者上记录的肥皂消息。使用 wsdltojava 实用程序生成的工件并使用自动生成的起点测试客户端,它工作得非常好。我根据文档创建了配置文件,但在我的控制台中我没有看到任何事情发生。这是我的 cxf.xml 文件内容:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:cxf="http://cxf.apache.org/core"
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">
<bean id="abstractLoggingInterceptor" abstract="true">
<property name="prettyLogging" value="true"/>
</bean>
<bean id="loggingInInterceptor" class="org.apache.cxf.interceptor.LoggingInInterceptor" parent="abstractLoggingInterceptor"/>
<bean id="loggingOutInterceptor" class="org.apache.cxf.interceptor.LoggingOutInterceptor" parent="abstractLoggingInterceptor"/>
<cxf:bus>
<cxf:inInterceptors>
<ref bean="loggingInInterceptor"/>
</cxf:inInterceptors>
<cxf:outInterceptors>
<ref bean="loggingOutInterceptor"/>
</cxf:outInterceptors>
<cxf:outFaultInterceptors>
<ref bean="loggingOutInterceptor"/>
</cxf:outFaultInterceptors>
<cxf:inFaultInterceptors>
<ref bean="loggingInInterceptor"/>
</cxf:inFaultInterceptors>
</cxf:bus>
</beans>
我试图把它放在项目根目录和 src 下,但没有。我错过了什么?
我的客户端代码是这样的:
公共最终类 ClientMHttps {
private static final QName SERVICE_NAME = new QName("http://thecompany/service-b", "myendpoint-v1");
private myendpointPortType port ;
public ClientMHttps() throws java.lang.Exception {
URL wsdlURL = myendpointV1.WSDL_LOCATION;
myendpointV1 ss = new myendpointV1(wsdlURL, SERVICE_NAME);
port = ss.getmyendpointPortTypeEndpointHttpsM();
}
public DeleteMarkedStatusResponse do_DeleteMarkedStatus(DeleteMarkedStatusRequest _deleteMarkedStatus_body) throws java.lang.Exception
{
System.out.println("Invoking deleteMarkedStatus...");
javax.xml.ws.Holder<HeaderType> _header = this.HeaderFarm();
DeleteMarkedStatusResponse _deleteMarkedStatus__return = port.deleteMarkedStatus(_deleteMarkedStatus_body, _header);
System.out.println("deleteMarkedStatus.result=" + _deleteMarkedStatus__return);
return _deleteMarkedStatus__return;
}