2017-08-17 39 views
0

我有一個位於src \ main \ resources \ wsdl \文件夾下的WSDL文件,它有多個在其中定義的操作。我的應用程序在Weblogic 12C服務器上運行。我試圖揭露使用Apache Cammel(版本:2.18.3)的SOAP Web服務與Java DSL -使用apache公開SOAP服務駱駝和WSDL

CxfComponent cxfComponent = new CxfComponent(getContext()); 
     CxfEndpoint serviceEndpoint = new CxfEndpoint("/soap/Manage_Order", cxfComponent); 
     serviceEndpoint.setAddress("http://<IP>:<PORT>/myproject/soap/ManageOrder_Details"); 
     serviceEndpoint.setServiceClass(
       "Fully qualified service interface name generated from WSDL file using maven with @WebService annotation"); 
     serviceEndpoint.setEndpointName(<end point name defined in the service class with @WebEndpoint annotation>); 
     serviceEndpoint.setDataFormat(DataFormat.MESSAGE); 
     serviceEndpoint.setDefaultOperationName("manageOrder"); 
     getContext().addEndpoint("myServiceEndPoint1", serviceEndpoint); 

from("cxf:myServiceEndPoint1").log("Hi, I am here").end(); 

雖然 -

我已經在我的RouteBuilder類的構造方法,下面寫代碼我在部署應用程序,它拋出異常如下 -

weblogic.application.ModuleException: java.lang.IllegalArgumentException: serviceClass must be specified 
     at weblogic.application.internal.ExtensibleModuleWrapper.start(ExtensibleModuleWrapper.java:140) 
     at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:124) 
     at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:233) 
     at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:228) 
     at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:45) 
     Truncated. see log file for complete stacktrace 
    Caused By: java.lang.IllegalArgumentException: serviceClass must be specified 
     at org.apache.camel.util.ObjectHelper.notNull(ObjectHelper.java:311) 
     at org.apache.camel.component.cxf.CxfEndpoint.createServerFactoryBean(CxfEndpoint.java:663) 
     at org.apache.camel.component.cxf.CxfConsumer.createServer(CxfConsumer.java:70) 
     at org.apache.camel.component.cxf.CxfConsumer.<init>(CxfConsumer.java:66) 
     at org.apache.camel.component.cxf.CxfEndpoint.createConsumer(CxfEndpoint.java:252) 
     Truncated. see log file for complete stacktrace 

的pom.xml

<dependency> 
    <groupId>org.apache.camel</groupId> 
    <artifactId>camel-soap</artifactId> 
    <version>2.18.3</version> 
</dependency> 
<dependency> 
    <groupId>org.apache.camel</groupId> 
    <artifactId>camel-cxf</artifactId> 
    <version>2.18.3</version> 
    <!-- use the same version as your Camel core version --> 
</dependency> 

回答

0

如錯誤所述,您沒有提及服務類和端點名稱。
serviceEndpoint.setServiceClass("Fully qualified service interface name generated from WSDL file using maven with @WebService annotation"); serviceEndpoint.setEndpointName(<end point name defined in the service class with @WebEndpoint annotation>); 第1步:使用wsdl2java命令或您選擇的IDE從您的wsdl生成服務。 步驟2:在您的代碼類路徑中有 步驟3:在上面的代碼段中提及類名和端點名稱