国产成人精品久久免费动漫-国产成人精品天堂-国产成人精品区在线观看-国产成人精品日本-a级毛片无码免费真人-a级毛片毛片免费观看久潮喷

您的位置:首頁技術文章
文章詳情頁

消耗SOAP Web服務錯誤(未注冊封送處理程序請檢查WebServiceTemplate的配置)

瀏覽:95日期:2024-05-12 08:12:03
(adsbygoogle = window.adsbygoogle || []).push({}); 如何解決消耗SOAP Web服務錯誤(未注冊封送處理程序請檢查WebServiceTemplate的配置)?

在這種情況下,我無法像我一樣在Controller中實例化一個新對象:

ProcuraPMPorREClient pm = new ProcuraPMPorREClient();

代替此,我需要創建一個@Autowired對象,如下所示:

@Autowired ProcuraPMPorREClient pm;

之后,我只調用相同的例程:

ProcuraPMPorREResponse response = pm.getPMPorRE(123456); System.out.println(response.getProcuraPMPorREResult().getNomePM());

這很好。

解決方法

我遵循了入門-使用SOAP Web服務(https://spring.io/guides/gs/consumption-web-service/)來使用特定的Web服務,并且一切正常:

我做了配置類:

@Configurationpublic class PMConfiguration { @Bean public Jaxb2Marshaller marshaller() {Jaxb2Marshaller marshaller = new Jaxb2Marshaller();// this package must match the package in the <generatePackage> specified in// pom.xmlmarshaller.setContextPath('com.inteligenciaweb.wsdl');return marshaller; } @Bean public ProcuraPMPorREClient procuraPMPorREClient(Jaxb2Marshaller marshaller) {ProcuraPMPorREClient client = new ProcuraPMPorREClient();client.setDefaultUri('http://tempuri.org/procuraPMPorRE');client.setMarshaller(marshaller);client.setUnmarshaller(marshaller);return client; }

}

客戶:

public class ProcuraPMPorREClient extends WebServiceGatewaySupport { private static final Logger log = LoggerFactory.getLogger(ProcuraPMPorRE.class); public ProcuraPMPorREResponse getPMPorRE(Integer RE) {ProcuraPMPorRE request = new ProcuraPMPorRE();request.setPMRENum(RE);log.info('Requesting PM for ' + RE);ProcuraPMPorREResponse response = (ProcuraPMPorREResponse) getWebServiceTemplate().marshalSendAndReceive('http://webservices.externo.policiamilitar.sp.gov.br:8071/router/wsscpm/basic',request,new SoapActionCallback('http://tempuri.org/procuraPMPorRE'));return response; }}

在課堂上申請:

@SpringBootApplicationpublic class InteligenciawebApplication { public static void main(String[] args) {SpringApplication.run(InteligenciawebApplication.class,args); } @Bean CommandLineRunner lookup(ProcuraPMPorREClient pm) {return args -> { Integer re = 123456; ProcuraPMPorREResponse response = pm.getPMPorRE(re); System.err.println(response.getProcuraPMPorREResult().getNomeBancoPM());}; }}

啟動應用程序時,weservice調用工作正常,因此可以在控制臺上查看結果。我嘗試使用相同的邏輯在其他類中調用此Web服務,但無法正常工作。例如,我已經在ControllerClass上進行了測試:

@RequestMapping(value = '/soap',method = RequestMethod.GET)public String testeSoap() { ProcuraPMPorREClient pm = new ProcuraPMPorREClient(); ProcuraPMPorREResponse response = pm.getPMPorRE(123456); System.out.println(response.getProcuraPMPorREResult().getNomePM()); return null;}

在這種情況下,Web服務將無法運行,并且系統將顯示以下錯誤消息:java.lang.IllegalStateException:沒有注冊編組。檢查WebServiceTemplate的配置。我不知道為什么,但是Web服務只能在特定的地方工作,而不能在其他地方工作。如果有人知道會發生什么,我將不勝感激!謝謝!

標簽: web
相關文章:
主站蜘蛛池模板: 看日本真人一一级特黄毛片 | 久久国产精品高清一区二区三区 | 久久99九九99九九精品 | 欧美日韩精品一区二区在线线 | 最近中文字幕在线 | 中文 | 国产成人精品视频午夜 | 亚洲精品一区二区在线播放 | 免费观看毛片视频 | 老妇激情毛片 | 爽死你个放荡粗暴小淫货双女视频 | 亚洲经典在线中文字幕 | 国产精品久久久久一区二区 | 自拍小视频在线观看 | 欧美日韩一区二区三区在线播放 | 舔操| 欧美高清在线精品一区二区不卡 | aaa毛片免费观看 | 国产精品亲子乱子伦xxxx裸 | 香蕉久久a毛片 | 欧美久久亚洲精品 | 厕拍精品 | 欧美国产视频 | 日韩一级黄色 | 国产成人香蕉在线视频网站 | 亚洲国产成人久久午夜 | 免费一级毛片在线播放视频 | 一级毛片aaaaaa免费看 | 国产精品午夜免费观看网站 | 久久亚洲精品无码观看不卡 | 久久手机精品视频 | 一级毛片免费视频网站 | 国产一级二级三级毛片 | 亚洲三及片 | 国产精品亚洲精品日韩已方 | 亚洲毛片免费观看 | 国产边打电话边做对白刺激 | 国产中文久久精品 | 久久这里有精品视频 | 日韩在线欧美 | 亚洲高清国产品国语在线观看 | 亚洲毛片在线免费观看 |