You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Basharaj <wa...@yahoo.com> on 2007/10/30 20:14:41 UTC

Server returned HTTP response code: 411

I am trying to write a cxf java client that consumes a PERL webservice. I am
getting the following error every time I try to send a message:
Server returned HTTP response code: 411 for URL (Full stack trace is at the
end of this message).

I understand that this might be caused by Authochunking set to true by
default, so I created the following cxf.xml file in my classpath: 

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:jaxws="http://cxf.apache.org/jaxws"
       xmlns:http="http://cxf.apache.org/transports/http/configuration"
       xsi:schemaLocation="
       http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
       http://cxf.apache.org/transports/http/configuration
http://cxf.apache.org/schemas/configuration/http-conf.xsd
       http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">

	  <http:conduit name="*.http-conduit">
          <http:client AllowChunking="false" />
       </http:conduit>
</beans>

And I imported this file in Spring application context. However I am still
getting the same 411 error. Any ideas?

Full stack trace:


javax.xml.ws.soap.SOAPFaultException: Could not send Message.
        at
org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:175)
        at $Proxy29.get_ip_for_station(Unknown Source)
        at
com.vms.locationservice.VDMClientTest.testUpdateAssetCount(VDMClientTest.java:24)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at
org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99)
        at
org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81)
        at
org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
        at
org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
        at
org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
        at
org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:66)
        at
org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)
        at
org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
        at
org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
        at
org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
        at
org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
        at
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:138)
        at
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:125)
        at org.apache.maven.surefire.Surefire.run(Surefire.java:132)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at
org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:290)
        at
org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:818)
Caused by: 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:207)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:254)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:205)
        at
org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
        at
org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:135)
        ... 26 more
Caused by: java.io.IOException: Server returned HTTP response code: 411 for
URL: http://iiws/cgi-bin/wsvdm/WSVDMStationInfo.pl
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
        at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
        at
sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1227)
        at java.security.AccessController.doPrivileged(Native Method)
        at
sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1221)
        at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:910)
        at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1921)
        at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1790)
        at
org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
        at
org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:576)
        at
org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
        ... 31 more
Caused by: java.io.IOException: Server returned HTTP response code: 411 for
URL: http://iiws/cgi-bin/wsvdm/WSVDMStationInfo.pl
        at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1174)
        at
java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:367)
        at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1860)
        ... 35 more

-- 
View this message in context: http://www.nabble.com/Server-returned-HTTP-response-code%3A-411-tf4720364.html#a13494659
Sent from the cxf-user mailing list archive at Nabble.com.


Re: Server returned HTTP response code: 411

Posted by Bashar Jawad <bj...@vmsinfo.com>.
Thanks, I did something a little different to work around it which is to 
set Autochunking programmatically:

appContext.xml :

<bean id="vdmClient" 
class="com.vms.locationservice.service.WSVDMStationInfo" 
factory-bean="vdmClientFactory" factory-method="create"/>

   
    <bean id="vdmClientFactory" 
class="com.vms.locationservice.service.VDMJaxWsProxyFactoryBean">
          <property name="serviceClass" 
value="com.vms.locationservice.service.WSVDMStationInfo"/>
          <property name="address" value="{address}"/>
    </bean>   

VDMJaxWsProxyFactoryBean:

public class VDMJaxWsProxyFactoryBean extends JaxWsProxyFactoryBean {
   
    public Object create(){
        WSVDMStationInfo wsvdmStationInfo = (WSVDMStationInfo) 
super.create();
        Client client = ClientProxy.getClient(wsvdmStationInfo);
        HTTPConduit http = (HTTPConduit) client.getConduit();
        HTTPClientPolicy httpClientPolicy = http.getClient();
        httpClientPolicy.setAllowChunking(false);       
        return wsvdmStationInfo;
    }


Regards,

Bashar


Willem Jiang wrote:
> Hi ,
>
> O, if you import the file in the Spring applicaiton context, the 
> configure will not take any effect in the CXF which version is below 
> 2.0.3. We just fixed it in the 2.0.3 SNAPSHOT.
>
> Here is the JIRA[1] which traced the issue.
>
> [1] http://issues.apache.org/jira/browse/CXF-922
>
> Willem.
>
>
> Basharaj wrote:
>> I am trying to write a cxf java client that consumes a PERL 
>> webservice. I am
>> getting the following error every time I try to send a message:
>> Server returned HTTP response code: 411 for URL (Full stack trace is 
>> at the
>> end of this message).
>>
>> I understand that this might be caused by Authochunking set to true by
>> default, so I created the following cxf.xml file in my classpath:
>> <beans xmlns="http://www.springframework.org/schema/beans"
>>        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>        xmlns:jaxws="http://cxf.apache.org/jaxws"
>>        xmlns:http="http://cxf.apache.org/transports/http/configuration"
>>        xsi:schemaLocation="
>>        http://cxf.apache.org/jaxws 
>> http://cxf.apache.org/schemas/jaxws.xsd
>>        http://cxf.apache.org/transports/http/configuration
>> http://cxf.apache.org/schemas/configuration/http-conf.xsd
>>        http://www.springframework.org/schema/beans
>> http://www.springframework.org/schema/beans/spring-beans.xsd">
>>
>>       <http:conduit name="*.http-conduit">
>>           <http:client AllowChunking="false" />
>>        </http:conduit>
>> </beans>
>>
>> And I imported this file in Spring application context. However I am 
>> still
>> getting the same 411 error. Any ideas?
>>
>> Full stack trace:
>>
>>
>> javax.xml.ws.soap.SOAPFaultException: Could not send Message.
>>         at
>> org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:175)
>>         at $Proxy29.get_ip_for_station(Unknown Source)
>>         at
>> com.vms.locationservice.VDMClientTest.testUpdateAssetCount(VDMClientTest.java:24) 
>>
>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>         at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
>>
>>         at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
>>
>>         at java.lang.reflect.Method.invoke(Method.java:585)
>>         at
>> org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99) 
>>
>>         at
>> org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81) 
>>
>>         at
>> org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34) 
>>
>>         at
>> org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75) 
>>
>>         at
>> org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45) 
>>
>>         at
>> org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:66) 
>>
>>         at
>> org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35) 
>>
>>         at
>> org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42) 
>>
>>         at
>> org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34) 
>>
>>         at
>> org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
>>         at
>> org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62) 
>>
>>         at
>> org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:138) 
>>
>>         at
>> org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:125) 
>>
>>         at org.apache.maven.surefire.Surefire.run(Surefire.java:132)
>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>         at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
>>
>>         at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
>>
>>         at java.lang.reflect.Method.invoke(Method.java:585)
>>         at
>> org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:290) 
>>
>>         at
>> org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:818) 
>>
>> Caused by: 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:207) 
>>
>>         at 
>> org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:254)
>>         at 
>> org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:205)
>>         at
>> org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
>>         at
>> org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:135)
>>         ... 26 more
>> Caused by: java.io.IOException: Server returned HTTP response code: 
>> 411 for
>> URL: http://iiws/cgi-bin/wsvdm/WSVDMStationInfo.pl
>>         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
>> Method)
>>         at
>> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) 
>>
>>         at
>> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) 
>>
>>         at 
>> java.lang.reflect.Constructor.newInstance(Constructor.java:494)
>>         at
>> sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1227) 
>>
>>         at java.security.AccessController.doPrivileged(Native Method)
>>         at
>> sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1221) 
>>
>>         at
>> sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:910) 
>>
>>         at
>> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1921) 
>>
>>         at
>> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1790) 
>>
>>         at
>> org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
>>         at
>> org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:576)
>>         at
>> org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62) 
>>
>>         ... 31 more
>> Caused by: java.io.IOException: Server returned HTTP response code: 
>> 411 for
>> URL: http://iiws/cgi-bin/wsvdm/WSVDMStationInfo.pl
>>         at
>> sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1174) 
>>
>>         at
>> java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:367)
>>         at
>> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1860) 
>>
>>         ... 35 more
>>
>>   
>


Re: Server returned HTTP response code: 411

Posted by Willem Jiang <ni...@iona.com>.
Hi ,

O, if you import the file in the Spring applicaiton context, the 
configure will not take any effect in the CXF which version is below 
2.0.3. We just fixed it in the 2.0.3 SNAPSHOT.

Here is the JIRA[1] which traced the issue.

[1] http://issues.apache.org/jira/browse/CXF-922

Willem.


Basharaj wrote:
> I am trying to write a cxf java client that consumes a PERL webservice. I am
> getting the following error every time I try to send a message:
> Server returned HTTP response code: 411 for URL (Full stack trace is at the
> end of this message).
>
> I understand that this might be caused by Authochunking set to true by
> default, so I created the following cxf.xml file in my classpath: 
>
> <beans xmlns="http://www.springframework.org/schema/beans"
>        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>        xmlns:jaxws="http://cxf.apache.org/jaxws"
>        xmlns:http="http://cxf.apache.org/transports/http/configuration"
>        xsi:schemaLocation="
>        http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
>        http://cxf.apache.org/transports/http/configuration
> http://cxf.apache.org/schemas/configuration/http-conf.xsd
>        http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans.xsd">
>
> 	  <http:conduit name="*.http-conduit">
>           <http:client AllowChunking="false" />
>        </http:conduit>
> </beans>
>
> And I imported this file in Spring application context. However I am still
> getting the same 411 error. Any ideas?
>
> Full stack trace:
>
>
> javax.xml.ws.soap.SOAPFaultException: Could not send Message.
>         at
> org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:175)
>         at $Proxy29.get_ip_for_station(Unknown Source)
>         at
> com.vms.locationservice.VDMClientTest.testUpdateAssetCount(VDMClientTest.java:24)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at
> org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99)
>         at
> org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81)
>         at
> org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
>         at
> org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
>         at
> org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
>         at
> org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:66)
>         at
> org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)
>         at
> org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
>         at
> org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
>         at
> org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
>         at
> org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at
> org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:138)
>         at
> org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:125)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:132)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at
> org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:290)
>         at
> org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:818)
> Caused by: 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:207)
>         at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:254)
>         at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:205)
>         at
> org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
>         at
> org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:135)
>         ... 26 more
> Caused by: java.io.IOException: Server returned HTTP response code: 411 for
> URL: http://iiws/cgi-bin/wsvdm/WSVDMStationInfo.pl
>         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)
>         at
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
>         at
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
>         at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
>         at
> sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1227)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at
> sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1221)
>         at
> sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:910)
>         at
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1921)
>         at
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1790)
>         at
> org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
>         at
> org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:576)
>         at
> org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
>         ... 31 more
> Caused by: java.io.IOException: Server returned HTTP response code: 411 for
> URL: http://iiws/cgi-bin/wsvdm/WSVDMStationInfo.pl
>         at
> sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1174)
>         at
> java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:367)
>         at
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1860)
>         ... 35 more
>
>