报错内容
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)
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>