首页 > 代码库 > WS调用的时候报错

WS调用的时候报错

报错内容
技术分享javax.xml.ws.WebServiceException: Method recognizeIdentityCardByFilePath is exposed as WebMethod, but there is no corresponding wsdl operation with name {技术分享http://tempuri.org/}RecognizeIdentityCardByFilePath in the wsdl:portType{技术分享http://tempuri.org/}OCRServiceSoap
at 技术分享com.sun.xml.internal.ws.model.JavaMethodImpl.freeze(JavaMethodImpl.java:367)
at 技术分享com.sun.xml.internal.ws.model.AbstractSEIModelImpl.freeze(AbstractSEIModelImpl.java:105)
at 技术分享com.sun.xml.internal.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:320)
at 技术分享com.sun.xml.internal.ws.db.DatabindingImpl.<init>(DatabindingImpl.java:85)
at 技术分享com.sun.xml.internal.ws.db.DatabindingProviderImpl.create(DatabindingProviderImpl.java:59)
at 技术分享com.sun.xml.internal.ws.db.DatabindingProviderImpl.create(DatabindingProviderImpl.java:43)
at 技术分享com.sun.xml.internal.ws.db.DatabindingFactoryImpl.createRuntime(DatabindingFactoryImpl.java:105)
at 技术分享com.sun.xml.internal.ws.client.WSServiceDelegate.buildRuntimeModel(WSServiceDelegate.java:875)
at 技术分享com.sun.xml.internal.ws.client.WSServiceDelegate.createSEIPortInfo(WSServiceDelegate.java:892)
at 技术分享com.sun.xml.internal.ws.client.WSServiceDelegate.addSEI(WSServiceDelegate.java:855)
at 技术分享com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:435)
at 技术分享com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:404)
at 技术分享com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:386)
at 技术分享javax.xml.ws.Service.getPort(Service.java:119)
at org.tempuri.OCRService.getOCRServiceSoap(OCRService.java:100)
at com.vcredit.ddcash.monitor.client.IdentityRecognizeClient.recognize(IdentityRecognizeClient.java:39)
at com.vcredit.ddcash.monitor.service.IdentityRecognizeService.newRecognizeIdentityCard(IdentityRecognizeService.java:63)
at com.vcredit.ddcash.monitor.schedule.IdentityRecognizeMonitorJob.getIdentityRecognizeData(IdentityRecognizeMonitorJob.java:57)
 
调用内容 

OCRService recong = new OCRService(new URL(baseUrl));
OCRServiceSoap soap = recong.getOCRServiceSoap();
IdentityCard idCard = soap.recognizeIdentityCardByBytes(content);

 

解决办法:pom文件缺少包:

<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>${cxf.version}</version>
</dependency>

 

WS调用的时候报错