javax.xml.ws.WebServiceException: Could not send Message.

Apache's JIRA Issue Tracker | Guilherme Veloso Neves Oliveira | 3 years ago
  1. 0

    The issue https://issues.apache.org/jira/browse/CXF-5781 was resolved the exception "port out of range: -1", but introduced the new exception below (Could not send Message - HTTP response '404: Not Found') What is surprising for me is that the application server hosting the webservice runs an instance of JBoss (Red Hat) and not IIS (Microsoft). I say this because the HTTP header response for code 404 was produced by an IIS server (Microsoft). In DEBUG mode, I collected the correct header produced by JBOSS and wrong produced by IIS (Microsoft). I caught these two headers stopping code execution in getResponseCode () method of the class $ org.apache.cxf.transport.http.netty.client.NettyHttpConduit NettyWrappedOutputStream. The wrong HTTP header was produced simply running the code! The correct HTTP header was produced as follows: at runtime, in initializePorts() method of class org.apache.cxf.jaxws.ServiceImpl.java the value of the local variable called "address" (in line 210, before calling the method addPort) was changed to include the number of TCP port 443 (https://homologwsincom.in.gov.br:443/services/servicoIN). With this change again (the reasons are described in https://issues.apache.org/jira/browse/CXF-5781), everything worked normally. Despite trying to create a patch, I did not get success. So, I would ask that the TCP port number was not removed from the local variable called "address". Below the headers HTTP: ========================================================== Correct Header DefaultFullHttpResponse(decodeResult: success) HTTP/1.1 200 OK Date: Mon, 09 Jun 2014 01:22:57 GMT X-Powered-By: Servlet 2.5; JBoss-5.0/JBossWeb-2.1 Content-Type: text/xml;charset=UTF-8 Vary: Accept-Encoding,User-Agent Keep-Alive: timeout=20, max=100 Connection: Keep-Alive Content-Length: 730 ------------------------------------------------------------------------------------- Wrong Header DefaultFullHttpResponse(decodeResult: success) HTTP/1.1 404 Not Found Date: Mon, 09 Jun 2014 01:20:52 GMT Server: Microsoft-IIS/7.5 Content-Type: text/html; charset=ISO-8859-1 X-Powered-By: ASP.NET Vary: Accept-Encoding,User-Agent Keep-Alive: timeout=5, max=100 Connection: Keep-Alive Content-Length: 1245 ========================================================= Below, the stacktrace: Jun 08, 2014 10:09:05 PM org.apache.cxf.phase.PhaseInterceptorChain doDefaultLogging WARNING: Interceptor for {http://xfire.ws.incom}servicoIN#{http://xfire.ws.incom}ConsultaFormasPagamento has thrown exception, unwinding now org.apache.cxf.interceptor.Fault: Could not send Message. at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:64) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307) at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:514) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:423) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:326) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:279) at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96) at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:137) at com.sun.proxy.$Proxy35.consultaFormasPagamento(Unknown Source) at incom.ws.xfire.ServicoINPortType_ServicoINHttpPort_Client.main(ServicoINPortType_ServicoINHttpPort_Client.java:60) Caused by: org.apache.cxf.transport.http.HTTPException: HTTP response '404: Not Found' when communicating with https://homologwsincom.in.gov.br/services/servicoIN at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1573) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1525) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1330) at org.apache.cxf.transport.http.netty.client.NettyHttpConduit$NettyWrappedOutputStream.close(NettyHttpConduit.java:153) at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56) at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:638) at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62) ... 9 more Exception in thread "main" javax.xml.ws.WebServiceException: Could not send Message. at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:148) at com.sun.proxy.$Proxy35.consultaFormasPagamento(Unknown Source) at incom.ws.xfire.ServicoINPortType_ServicoINHttpPort_Client.main(ServicoINPortType_ServicoINHttpPort_Client.java:60) Caused by: org.apache.cxf.transport.http.HTTPException: HTTP response '404: Not Found' when communicating with https://homologwsincom.in.gov.br/services/servicoIN at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1573) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1525) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1330) at org.apache.cxf.transport.http.netty.client.NettyHttpConduit$NettyWrappedOutputStream.close(NettyHttpConduit.java:153) at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56) at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:638) at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307) at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:514) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:423) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:326) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:279) at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96) at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:137) ... 2 more

    Apache's JIRA Issue Tracker | 3 years ago | Guilherme Veloso Neves Oliveira
    javax.xml.ws.WebServiceException: Could not send Message.
  2. 0

    The issue https://issues.apache.org/jira/browse/CXF-5781 was resolved the exception "port out of range: -1", but introduced the new exception below (Could not send Message - HTTP response '404: Not Found') What is surprising for me is that the application server hosting the webservice runs an instance of JBoss (Red Hat) and not IIS (Microsoft). I say this because the HTTP header response for code 404 was produced by an IIS server (Microsoft). In DEBUG mode, I collected the correct header produced by JBOSS and wrong produced by IIS (Microsoft). I caught these two headers stopping code execution in getResponseCode () method of the class $ org.apache.cxf.transport.http.netty.client.NettyHttpConduit NettyWrappedOutputStream. The wrong HTTP header was produced simply running the code! The correct HTTP header was produced as follows: at runtime, in initializePorts() method of class org.apache.cxf.jaxws.ServiceImpl.java the value of the local variable called "address" (in line 210, before calling the method addPort) was changed to include the number of TCP port 443 (https://homologwsincom.in.gov.br:443/services/servicoIN). With this change again (the reasons are described in https://issues.apache.org/jira/browse/CXF-5781), everything worked normally. Despite trying to create a patch, I did not get success. So, I would ask that the TCP port number was not removed from the local variable called "address". Below the headers HTTP: ========================================================== Correct Header DefaultFullHttpResponse(decodeResult: success) HTTP/1.1 200 OK Date: Mon, 09 Jun 2014 01:22:57 GMT X-Powered-By: Servlet 2.5; JBoss-5.0/JBossWeb-2.1 Content-Type: text/xml;charset=UTF-8 Vary: Accept-Encoding,User-Agent Keep-Alive: timeout=20, max=100 Connection: Keep-Alive Content-Length: 730 ------------------------------------------------------------------------------------- Wrong Header DefaultFullHttpResponse(decodeResult: success) HTTP/1.1 404 Not Found Date: Mon, 09 Jun 2014 01:20:52 GMT Server: Microsoft-IIS/7.5 Content-Type: text/html; charset=ISO-8859-1 X-Powered-By: ASP.NET Vary: Accept-Encoding,User-Agent Keep-Alive: timeout=5, max=100 Connection: Keep-Alive Content-Length: 1245 ========================================================= Below, the stacktrace: Jun 08, 2014 10:09:05 PM org.apache.cxf.phase.PhaseInterceptorChain doDefaultLogging WARNING: Interceptor for {http://xfire.ws.incom}servicoIN#{http://xfire.ws.incom}ConsultaFormasPagamento has thrown exception, unwinding now org.apache.cxf.interceptor.Fault: Could not send Message. at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:64) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307) at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:514) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:423) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:326) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:279) at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96) at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:137) at com.sun.proxy.$Proxy35.consultaFormasPagamento(Unknown Source) at incom.ws.xfire.ServicoINPortType_ServicoINHttpPort_Client.main(ServicoINPortType_ServicoINHttpPort_Client.java:60) Caused by: org.apache.cxf.transport.http.HTTPException: HTTP response '404: Not Found' when communicating with https://homologwsincom.in.gov.br/services/servicoIN at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1573) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1525) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1330) at org.apache.cxf.transport.http.netty.client.NettyHttpConduit$NettyWrappedOutputStream.close(NettyHttpConduit.java:153) at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56) at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:638) at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62) ... 9 more Exception in thread "main" javax.xml.ws.WebServiceException: Could not send Message. at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:148) at com.sun.proxy.$Proxy35.consultaFormasPagamento(Unknown Source) at incom.ws.xfire.ServicoINPortType_ServicoINHttpPort_Client.main(ServicoINPortType_ServicoINHttpPort_Client.java:60) Caused by: org.apache.cxf.transport.http.HTTPException: HTTP response '404: Not Found' when communicating with https://homologwsincom.in.gov.br/services/servicoIN at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1573) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1525) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1330) at org.apache.cxf.transport.http.netty.client.NettyHttpConduit$NettyWrappedOutputStream.close(NettyHttpConduit.java:153) at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56) at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:638) at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307) at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:514) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:423) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:326) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:279) at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96) at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:137) ... 2 more

    Apache's JIRA Issue Tracker | 3 years ago | Guilherme Veloso Neves Oliveira
    javax.xml.ws.WebServiceException: Could not send Message.
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    Wildfly 8.2 and SOAP web service - sending files over https

    Stack Overflow | 1 year ago | Matic Balantic
    org.apache.cxf.transport.http.HTTPException: HTTP response '403: Forbidden' when communicating with https://localhost:8443/Jedro-EDV/EDVWs
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. org.apache.cxf.transport.http.HTTPException

    HTTP response '404: Not Found' when communicating with https://homologwsincom.in.gov.br/services/servicoIN

    at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal()
  2. Apache CXF Runtime HTTP Transport
    HTTPConduit$WrappedOutputStream.close
    1. org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1573)
    2. org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1525)
    3. org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1330)
    3 frames
  3. Apache CXF Runtime HTTP Netty Client Transport
    NettyHttpConduit$NettyWrappedOutputStream.close
    1. org.apache.cxf.transport.http.netty.client.NettyHttpConduit$NettyWrappedOutputStream.close(NettyHttpConduit.java:153)
    1 frame
  4. Apache CXF Core
    AbstractConduit.close
    1. org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
    1 frame
  5. Apache CXF Runtime HTTP Transport
    HTTPConduit.close
    1. org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:638)
    1 frame
  6. Apache CXF Core
    ClientImpl.invoke
    1. org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
    2. org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
    3. org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:514)
    4. org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:423)
    5. org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:326)
    6. org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:279)
    6 frames
  7. Apache CXF Runtime Simple Frontend
    ClientProxy.invokeSync
    1. org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
    1 frame
  8. Apache CXF Runtime JAX-WS Frontend
    JaxWsClientProxy.invoke
    1. org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:137)
    1 frame
  9. com.sun.proxy
    $Proxy35.consultaFormasPagamento
    1. com.sun.proxy.$Proxy35.consultaFormasPagamento(Unknown Source)
    1 frame
  10. incom.ws.xfire
    ServicoINPortType_ServicoINHttpPort_Client.main
    1. incom.ws.xfire.ServicoINPortType_ServicoINHttpPort_Client.main(ServicoINPortType_ServicoINHttpPort_Client.java:60)
    1 frame