gpt4 book ai didi

spring - 无法从 InputStream : Invalid Content-Type:text/html 创建消息

转载 作者:行者123 更新时间:2023-12-05 05:28:45 25 4
gpt4 key购买 nike

你好。我通过手册为 WSDL 创建了一个客户端: http://static.springsource.org/spring-ws/site/reference/html/client.html

但是当我启动我的应用程序时,我得到这个错误:

Exception in thread "main" org.springframework.ws.soap.SoapMessageCreationException: Could not create message from InputStream: Invalid Content-Type:text/html. Is this an error message instead of a SOAP response?; nested exception is com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Invalid Content-Type:text/html. Is this an error message instead of a SOAP response?
at org.springframework.ws.soap.saaj.SaajSoapMessageFactory.createWebServiceMessage(SaajSoapMessageFactory.java:204)
at org.springframework.ws.soap.saaj.SaajSoapMessageFactory.createWebServiceMessage(SaajSoapMessageFactory.java:58)
at org.springframework.ws.transport.AbstractWebServiceConnection.receive(AbstractWebServiceConnection.java:90)
at org.springframework.ws.client.core.WebServiceTemplate.doSendAndReceive(WebServiceTemplate.java:548)
at org.springframework.ws.client.core.WebServiceTemplate.sendAndReceive(WebServiceTemplate.java:496)
at org.springframework.ws.client.core.WebServiceTemplate.doSendAndReceive(WebServiceTemplate.java:451)
at org.springframework.ws.client.core.WebServiceTemplate.sendSourceAndReceiveToResult(WebServiceTemplate.java:395)
at org.springframework.ws.client.core.WebServiceTemplate.sendSourceAndReceiveToResult(WebServiceTemplate.java:386)
at org.springframework.ws.client.core.WebServiceTemplate.sendSourceAndReceiveToResult(WebServiceTemplate.java:376)
at com.software.prod.core.ws.WebServiceClient.simpleSendAndReceive(WebServiceClient.java:36)
at com.software.pro.core.common.ServiceRunner.main(ServiceRunner.java:19)
Caused by: com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Invalid Content-Type:text/html. Is this an error message instead of a SOAP response?
at com.sun.xml.internal.messaging.saaj.soap.MessageImpl.identifyContentType(MessageImpl.java:602)
at com.sun.xml.internal.messaging.saaj.soap.MessageImpl.<init>(MessageImpl.java:275)
at com.sun.xml.internal.messaging.saaj.soap.ver1_1.Message1_1Impl.<init>(Message1_1Impl.java:67)
at com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl.createMessage(SOAPMessageFactory1_1Impl.java:61)
at org.springframework.ws.soap.saaj.SaajSoapMessageFactory.createWebServiceMessage(SaajSoapMessageFactory.java:182)
... 10 more

最佳答案

是否有在您尝试调用的任何 URL 上运行的 Web 服务?看起来您收到的响应可能是 html 页面或 HTTP 错误(我猜是 404 - 未找到文件或目录)。

您要调用哪个 URL?您创建的 Web 服务或某些外部 Web 服务?

我建议首先尝试使用 SoapUI 调用 Web 服务(以确保 Web 服务存在并且正在运行)

关于spring - 无法从 InputStream : Invalid Content-Type:text/html 创建消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7510937/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com