简体   繁体   中英

Server returned HTTP response code: 405 for URL

When I create a new SOAP project in SoapUI 4.6.4, first I have to add initial WSDL url. My initial WSDL URL: http://l:xxxxxxxxxxxxxxx?wsdl .

But I'm getting this error:

Error loading http://lxxxxxxxx?wsdl : org.apache.xmlbeans.XmlException: java.io.IOException: Server returned HTTP response code: 405 for URL: http://lxxxxxxxx?wsdl

So how can I fix this?

响应代码 405:不允许方法 GET/POST 方法之一被禁止,并且您正在使用其中之一检查此

405 is method not allowed error, this mean you have method that causing problem when its being called. Check if you have duplicate path with method in your wsdl. If no duplicate path try open the h ttp://lxxxxxxxxxxxx?wsdl in your browser if you cant, that`s mean something wrong with your web configuration.

Most of the answers here are correct but difficult to get for those who are new in this like me. So in simple try changing your controller's request mapping.

@RequestMapping(path = RequestMappingURL.IVPS_CYCLE_DATE, method = { RequestMethod.POST }, produces = MediaType.APPLICATION_JSON_VALUE)

In above code I mapped request method as post but actually client was sending get request. As soon as I changed it to GET it worked. See below code

@RequestMapping(path = RequestMappingURL.IVPS_CYCLE_DATE, method = { RequestMethod.GET }, produces = MediaType.APPLICATION_JSON_VALUE)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM