简体   繁体   English

ClientTransportException:服务器发送了HTTP状态代码302:找到

[英]ClientTransportException: The server sent HTTP status code 302: Found

I am testing a webservice and it works fine in SOAP UI tool. 我正在测试一个Web服务,它在SOAP UI工具中可以正常工作。 Now I am writing a webservice client in java to test same. 现在,我正在用Java编写一个Web服务客户端以对其进行测试。 I executed the wsimport command and generated the required classes. 我执行了wsimport命令并生成了所需的类。 The issue is when I am calling the service it displays the following message in console. 问题是当我调用服务时,它在控制台中显示以下消息。 It seems the server is trying to redirect but redirection is failing. 似乎服务器正在尝试重定向,但重定向失败。 I am doubting there may be issue with http/https OR GET/POST methods but not sure how to fix. 我怀疑http / https或GET / POST方法可能存在问题,但不确定如何解决。

Exception in thread "main" com.sun.xml.internal.ws.client.ClientTransportException: The server sent HTTP status code 302: Found
at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.checkStatusCode(Unknown Source)
at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.createResponsePacket(Unknown Source)
at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(Unknown Source)
at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(Unknown Source)
at com.sun.xml.internal.ws.transport.DeferredTransportPipe.processRequest(Unknown Source)
at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Unknown Source)
at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Unknown Source)
at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Unknown Source)
at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Unknown Source)
at com.sun.xml.internal.ws.client.Stub.process(Unknown Source)
at com.sun.xml.internal.ws.client.sei.SEIStub.doProcess(Unknown Source)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(Unknown Source)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(Unknown Source)
at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(Unknown Source)

Please suggest. 请提出建议。

Regards, Arun 问候,阿伦

After more analysis and change I am able to fix this issue. 经过更多分析和更改,我能够解决此问题。 As I doubted the cause was redirection from http to https. 我怀疑原因是从http重定向到https。 This post helped: Calling web service that sits on a load balancer with jax-ws returns at http status of 302, but when I use SoapUI it works fine 这篇文章有帮助: 调用带有jax-ws的负载平衡器上的Web服务,返回的HTTP状态为302,但是当我使用SoapUI时,它工作正常

Regards, Arun 问候,阿伦

暂无
暂无

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

相关问题 Glassfish抛出com.sun.xml.ws.client.ClientTransportException:服务器发送了HTTP状态代码500:内部服务器错误 - Glassfish throws com.sun.xml.ws.client.ClientTransportException: The server sent HTTP status code 500: Internal Server Error 线程“ main” com.sun.xml.internal.ws.client.ClientTransportException中的异常:服务器发送了HTTP状态代码502:代理错误 - Exception in thread “main” com.sun.xml.internal.ws.client.ClientTransportException: The server sent HTTP status code 502: Proxy Error 连接到 web 服务导致 com.sun.xml.internal.ws.client.ClientTransportException:服务器发送 HTTP 状态码 200 - Connecting to webservice results in com.sun.xml.internal.ws.client.ClientTransportException: The server sent HTTP status code 200: OK 使用CXF从Java消耗Web服务会导致com.sun.xml.ws.client.ClientTransportException:服务器发送了HTTP状态代码200:确定 - Consuming webservice from java using CXF results in com.sun.xml.ws.client.ClientTransportException: The server sent HTTP status code 200: OK 处理Http状态代码302暂时在Netty中移动 - Handling Http status code 302 Moved Temporarily in Netty Spring 启动 API 返回 HTTP 302 状态码 - Spring Boot API returning HTTP 302 status code 当找到 302 状态码时,私有 IP 在 HTML 公开 - Private IP is disclosure at HTML when 302 status code is found vSphere Web服务示例失败,并显示“服务器已发送HTTP状态代码200:确定” - vSphere web-services sample fails with “The server sent HTTP status code 200: OK” Java HttpURLConnection 状态码 302 - Java HttpURLConnection status code 302 HTTP状态404 –在Tomcat服务器上找不到 - HTTP Status 404 – Not Found on Tomcat server
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM