I am using a SOAP service / client ( which is .NET) that sends XML envelopes to a SOAP UI service (Java I am guessing) however, we are getting a 405 saying method is not allowed, looking into fiddler, the error is actually HTTP method POST is not supported by this URL
however this confuses me when using SOAP, I thought it uses POST by default as using a GET would put the XML inside the URL which is crazy. Does anyone know if I can change something in the client or in the service?
答案 0 :(得分:0)
我在SoapUi 5.2.1中遇到过类似的问题。我在Jboss EAP 7上通过Java公开了30多种Web服务方法。最初我只在我的SoapUi项目中暴露了4种。当我重新更新/使用更新的WSDL时,SoapUi中显示了26种新方法。我用所需的参数填写了所有的示例请求。然后我创建了一个"测试套件"由每个新方法的测试用例组成,其中包括"继承"我在默认请求中填充的参数(节省时间!)。
我执行了测试套件。一切都以绿色传递,但看着由此产生的Web服务响应几乎所有人都有:
<html>
<head>
<title>Error</title>
</head>
<body>HTTP method POST is not supported by this URL</body>
</html>
作为SOAP响应。我挖了一下,结果只是我添加的新方法,四个原版工作得很好。看一下SOAP端点,我意识到我已经稍微修改了Web服务而不是端点: http://localhost:8080/MyServicesR20/AdvancedBusinessService
现在是: http://localhost:8080/MyServicesR20/AdvancedBusiness
由于某种原因,当SoapUi更新定义时,它并没有使用原始端点来处理所有新请求,而是使用较旧的请求。我手动将每个更改为正确的端点,现在所有Web服务请求都按预期工作。
注意事后,如果您有大量请求和/或测试用例并最终更改端点,只需备份SoapUi用于项目的XML文档,然后执行搜索并替换旧端点新的端点为自己省去了很多麻烦!