Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I'm also having this problem on JBoss 5.0.1. I have copied jbossws-*.jars into lib endorsed also and I reference this when I run junits and it works fine. However when I use my client from within a running JBoss AS I get this : Caused by: org.jboss.ws.WSException: Invalid HTTP server response [404] - Not Found But I've triple checked that the service endpoint I have configured is correct, I can go to it in a browser, soapUI can hit it, and my unit test using same client can call it.</p> <p>AFter much research I found that JBoss (and JBossWS) may have some bugs in the JBossWS 3.0.x versions (maybe others). This may be caused by a combination of your JAX-WS version being used and the server your calling. In my case the server did not support chunked HTTP requests and JBoss WS had some bugs with dealing with that. Here is the code I needed to add before the actual request:</p> <pre><code> // HACK: This is a hack for disabling chunked encoding. .NET server run by service host does nto seem to support chunked encoding. //Jboss WS version 3.0.5 has multiple bugs disallowing the setting of either a new client type or disabling chunking. //So, we are resporting to this hack here. // This essentially sets the chunck size to 0 forcing the Webservice client to not chunk requests and not expect responses to be chunked (effectively HTTP 1.0 mode) // ((StubExt) port).setConfigName("HTTP 1.0 Client"); // does not work in Jboss WS 3.0.5 EndpointMetaData endpointMetaData = ((StubExt) serviceEndPoint).getEndpointMetaData(); CommonConfig commonConfig = endpointMetaData.getConfig(); boolean hacked = false; try { if (commonConfig.getProperties() != null){ Iterator&lt;EndpointProperty&gt; iter = commonConfig.getProperties().iterator(); while (iter.hasNext()){ EndpointProperty p = iter.next(); if (p.name.equals(new URI(EndpointProperty.CHUNKED_ENCODING_SIZE))){ p.value = "0"; hacked = true; log.info("Chunking set to 0 since service host does not support chunked requests"); } } } } catch (URISyntaxException e) { e.printStackTrace(); } if (!hacked)commonConfig.addProperty(EndpointProperty.CHUNKED_ENCODING_SIZE, "0"); // END HACK </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload