简体   繁体   English

HTTP状态405-此URL不支持HTTP方法POST-SOAP

[英]HTTP Status 405 - HTTP method POST is not supported by this URL - SOAP

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. 我正在使用将XML信封发送到SOAP UI服务(我猜是Java)的SOAP服务/客户端(即.NET),但是,我们得到405表示不允许该方法,调查提琴手,错误实际上是HTTP method POST is not supported by this URL但是这使我在使用SOAP时感到困惑,我认为它默认情况下使用POST,因为使用GET会将XML放入URL内是很疯狂的。 Does anyone know if I can change something in the client or in the service? 有人知道我是否可以在客户端或服务中进行更改吗?

I just had a similar issue in SoapUi 5.2.1. 我在SoapUi 5.2.1中有一个类似的问题。 I've exposed 30+ web service methods through Java on Jboss EAP 7. Originally I had 4 only exposed in my SoapUi project. 我已经在Jboss EAP 7上通过Java公开了30多种Web服务方法。最初,我在SoapUi项目中仅公开了4种方法。 When I re-updated/consumed the updated WSDL, the 26 new methods showed in SoapUi. 当我重新更新/使用更新的WSDL时,SoapUi中显示了26种新方法。 I filled in all the sample requests with the needed arguments. 我用所需的参数填写了所有示例请求。 I then created a "Test Suite" consisting of test cases for each of the new methods which "inherited" the arguments I had populated in the default requests (time saver!). 然后,我为每个新方法创建了一个由测试用例组成的“测试套件”,这些方法“继承”了我在默认请求(省时!)中填充的参数。

I executed the test suite. 我执行了测试套件。 Everything passed as green, but looking at the resulting web service responses almost all of them had: 一切都以绿色显示,但查看生成的Web服务响应,几乎所有人都具有:

<html>
    <head>
        <title>Error</title>
    </head>
    <body>HTTP method POST is not supported by this URL</body>
</html>

As the SOAP response. 作为SOAP响应。 I dug around a bit, it turned out to be only the new methods I had added, the four original worked fine. 我仔细研究了一下,结果发现这只是我添加的新方法,而原始的四个方法效果很好。 Looking at the SOAP endpoint, I realized I had modified the web service slightly and instead of the endpoint being: http://localhost:8080/MyServicesR20/AdvancedBusinessService 查看SOAP端点,我意识到我已经稍微修改了Web服务,而不是端点: http:// localhost:8080 / MyServicesR20 / AdvancedBusinessService

It was now: http://localhost:8080/MyServicesR20/AdvancedBusiness 现在是: http:// localhost:8080 / MyServicesR20 / AdvancedBusiness

For some reason when SoapUi updated the definition it didnt use the original endpoint for all the new requests and instead an older one. 由于某种原因,当SoapUi更新定义时,它并未将原始端点用于所有新请求,而是使用了旧端点。 I manually went and changed each to be the correct endpoint and now all the web service requests work as expected. 我手动将其更改为正确的端点,现在所有Web服务请求均按预期工作。

Note and hindsight, if you have a large number of requests and or test cases and end up changing the endpoint, just back up the XML document that SoapUi uses for the project, then perform a search and replace of the old endpoint with the new endpoint to save yourself a lot of trouble! 请注意,事后看来,如果您有大量的请求和/或测试用例,而最终更改了端点,则只需备份SoapUi用于项目的XML文档,然后执行搜索并将旧的端点替换为新的端点为自己省去很多麻烦!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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