如何在Apache CXF中执行soap操作

时间:2018-06-20 15:06:10

标签: java soap wsdl apache-camel cxf

我正在尝试公开肥皂网络服务。我的Soap服务已被公开。 WSDL即将发布,但

  

from(“ fulFillmentSoapEndPoint”)。process(fulfillmentSOAPRequestProcessor);

这是我使用APache CXF公开Web服务的方式。

final CdiCamelContext context = cdiCamelContextProvider.getContext();
        CxfComponent cxfComponent = new CxfComponent(context); 
        CxfEndpoint serviceEndpoint = new CxfEndpoint("http://127.0.0.1:8980/cisBusiness/services/fulFillment",cxfComponent);
        serviceEndpoint.setDataFormat(DataFormat.PAYLOAD);
        serviceEndpoint.setServiceClass(com.cp.mp.fulfillment.SOAP.FulfillmentService.class);
        HashMap<String,Object> properties = new HashMap<>();
        properties.put("faultStackTraceEnabled", true);
        properties.put("exceptionMessageCauseEnabled", true);
        serviceEndpoint.configureProperties(properties);
        serviceEndpoint.setLoggingFeatureEnabled(true);
        //serviceEndpoint.setServiceNameString("{commandService}fulFillmentService");
        //serviceEndpoint.setEndpointNameString("{commandService}fulfillmentServicePort");
        context.addEndpoint("fulFillmentSoapEndPoint", serviceEndpoint);

我的网络服务界面

@WebService
public interface FulfillmentService {

    public FulfillmentResponse buyProduct(String input,String userName, String password,String msisdn,String iname);
}

我的Web服务实现类

@WebService(endpointInterface = "com.fp.mp.fulfillment.SOAP.FulfillmentService")
@InInterceptors(interceptors = "org.apache.cxf.interceptor.LoggingInInterceptor")
@OutInterceptors(interceptors = "org.apache.cxf.interceptor.LoggingOutInterceptor")
public class FulfillmentServiceImpl implements FulfillmentService {

    public FulfillmentResponse buyProduct(String input, String userName, String password, String msisdn, String iname) {

        Map<String, Object> queryMap = new HashMap<>();
        queryMap.put("input", input);
        queryMap.put("password", password);
        queryMap.put("msisdn", msisdn);
        queryMap.put("iname", iname);
        //TODO
        return null;
    }

}

这是一条路线

from("fulFillmentSoapEndPoint").process(fulfillmentSOAPRequestProcessor);

没有创建路由,我的WSDL并未创建,但是当我创建这样的路由并尝试通过SOAP UI进行buyProduct操作时。 我的SOAP操作未执行。我的请求被直接传递给处理器。我的SOAP操作将如何执行?

0 个答案:

没有答案