【问题标题】:Why is camel-cxf throwing Could not find portType ServiceConstructionException?为什么camel-cxf抛出找不到portType ServiceConstructionException?
【发布时间】:2022-11-03 02:54:44
【问题描述】:

我有一条骆驼路线,它试图通过使用 apache-cxf 的 informatica Web 服务登录。 这是路线的样子:

    String WS_URL = "cxf://http://infIntegration?serviceClass=com.inf.dsh.InfIntegrationService&wsdlURL=/wsdl/InfService.wsdl&dataFormat=RAW";
    JaxbDataFormat soapDF = new JaxbDataFormat();
    JAXBContext context = JAXBContext.newInstance(InfLoginRequest.class);
    soapDF.setContext(context);

      from("timer://simpleTimer?period=2000") .setBody()
      .simple("This is a test message") .to("direct:customerServiceClient");

      from("direct:customerServiceClient") .log(">>> Getting Logged...........")
            .process(exchange -> {
                exchange.getIn().setHeader(Exchange.CONTENT_TYPE, "application/xml");
                exchange.getIn().setBody(new ObjectFactory().createInfLogin(getInfLoginDetail()),
                        InfLoginRequest.class);
            })
            .marshal(soapDF)
            .to(WS_URL)
            .unmarshal(soapDF) 
            .process(exchange -> { 
                exchange.getMessage().getBody();
                log.info("Response : " + exchange.getIn().getBody()); 
            });

当我运行它时,我不断在下面收到此错误(Could not find portType named {http://www.inf.com/dsh}InfIntegrationServicePortType):

    Caused by: org.apache.cxf.service.factory.ServiceConstructionException: Could not find portType named {http://www.inf.com/dsh}InfIntegrationServicePortType
        at org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.getInterfaceInfo(ReflectionServiceFactoryBean.java:633) ~[cxf-rt-wsdl-3.4.4.jar:3.4.4]
        at org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.initializeWSDLOperations(ReflectionServiceFactoryBean.java:641) ~[cxf-rt-wsdl-3.4.4.jar:3.4.4]
        at org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(ReflectionServiceFactoryBean.java:417) ~[cxf-rt-wsdl-3.4.4.jar:3.4.4]
        at org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:527) ~[cxf-rt-wsdl-3.4.4.jar:3.4.4]
        at org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:262) ~[cxf-rt-wsdl-3.4.4.jar:3.4.4]
        at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:103) ~[cxf-rt-frontend-simple-3.4.4.jar:3.4.4]
        at org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:91) ~[cxf-rt-frontend-simple-3.4.4.jar:3.4.4]
        at org.apache.camel.component.cxf.CxfEndpoint.createClient(CxfEndpoint.java:635) ~[camel-cxf-3.11.2.jar:3.11.2]
        at org.apache.camel.component.cxf.CxfProducer.doStart(CxfProducer.java:79) ~[camel-cxf-3.11.2.jar:3.11.2]
        at org.apache.camel.support.service.BaseService.start(BaseService.java:119) ~[camel-api-3.11.2.jar:3.11.2]
        at org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:113) ~[camel-api-3.11.2.jar:3.11.2]
        at org.apache.camel.impl.engine.AbstractCamelContext.internalAddService(AbstractCamelContext.java:1462) ~[camel-base-engine-3.11.2.jar:3.11.2]
        at org.apache.camel.impl.engine.AbstractCamelContext.addService(AbstractCamelContext.java:1383) ~[camel-base-engine-3.11.2.jar:3.11.2]
        at org.apache.camel.processor.SendProcessor.doStart(SendProcessor.java:247) ~[camel-core-processor-3.11.2.jar:3.11.2]
        at org.apache.camel.support.service.BaseService.start(BaseService.java:119) ~[camel-api-3.11.2.jar:3.11.2]

我已经尝试了几乎所有东西,但我无法弄清楚我在这里缺少什么。非常感谢任何帮助。

【问题讨论】:

    标签: web-services soap cxf-codegen-plugin camel-cxf


    【解决方案1】:

    检查您是否正在使用接口类。从 .Wsdl 文件中,您将找到用于 serviceClass 的服务 {name}。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-07-31
      • 2017-11-15
      相关资源
      最近更新 更多