I've had the same problem. This is how I managed to solve it.
In the axis2.xml there is a place where this is specified
<transportSender name="http"
class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
<parameter name="PROTOCOL" locked="false">HTTP/1.1</parameter>
<!--
<parameter name="Transfer-Encoding" locked="false">chunked</parameter>
-->
</transportSender>
To understand how to manage with the axis2.xml file read the api for
org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContextFromFileSystem
Hope this will work.
-----Messaggio originale-----
Da: Igor Arenz [mailto:[EMAIL PROTECTED]
Inviato: mercoledì 2 agosto 2006 16.26
A: [email protected]
Oggetto: Re: [axis2] Disable Chunk-Transfer-Encoding?
Thank you for this answer,
nice try, but it doesn't work.
I've updated tu the last SNAPSHOT from today (2 august).
The exception is still the same:
org.apache.axiom.om.OMException: Unsupported Operation
at ..OMTextImpl.getText(OMTextImpl.java:254)
at ..OMTextImpl.writeOutput(OMTextImpl.java:219)
(for complet exception, see below [2])
Can anybody help me again?
I've debugged a litte in the axis2 sourcecode and find that the
excpeiton is thrown here:
<javaCode from="axis2">
public java.io.InputStream getInputStream() throws OMException {
if (isBinary) {
if (dataHandlerObject == null) {
getDataHandler();
}
InputStream inStream;
javax.activation.DataHandler dataHandler =
(javax.activation.DataHandler) dataHandlerObject;
try {
inStream = dataHandler.getDataSource().getInputStream();
} catch (IOException e) {
throw new OMException(
"Cannot get InputStream from DataHandler." + e);
}
return inStream;
} else {
throw new OMException("Unsupported Operation");
HHHEEERRREEE IS THE EXCEPTION THROWN!
}
}
</javaCode>
Thank you for help again!
greets
igor :-)
PS: i have still 90 minutes to make this working evor deadline...
Am Tuesday, den 01.08.2006, 22:39 +0530 schrieb Eran Chinthaka:
> options.setProperty(org.apache.axis2.transport.http.HTTPConstants.CHUNKED,
> "false")
>
> Igor Arenz wrote:
> > Hello List :-)
> >
> > I need a little help. I want to connect to a extenal webService, i'm
> > using axis2 as client. The first problem that occured was the
> > apache-server on server-site (owned by a other company) that gave me a
> > HTTP 411 Error.
> >
> > The Apache-Log shows this errormessage: [error] [client x.x.x.x] chunked
> > Transfer-Encoding forbidden:
> >
> > So i used google to get a solution for this problem. I tried to disable
> > this chunked transfer encoding. I tried
> >
> > <javaCode>
> > (for complet soucecode see below [1])
> > options.setProperty(
> > MessageContextConstants.CHUNKED,
> > Constants.VALUE_FALSE);
> > </javaCode>
> >
> > Now, axis throws me a exception:
> > org.apache.axiom.om.OMException: Unsupported Operation
> > at ..OMTextImpl.getText(OMTextImpl.java:254)
> > at ..OMTextImpl.writeOutput(OMTextImpl.java:219)
> > (for complet exception, see below [2])
> >
> > This exception is thrown directly after the Log-message
> > DEBUG:spool_8: org.apache.commons.httpclient.Wire (Wire.java:69) => >>
> > "POST path?wsdl HTTP/1.1[\r][\n]"
> >
> > As next, as test, I have set the client to http 1.0 with this option:
> >
> > <javaCode>
> > options.setProperty(
> > MessageContextConstants.HTTP_PROTOCOL_VERSION,
> > HTTPConstants.HEADER_PROTOCOL_10);
> > </javaCode>
> >
> > The exception doesn't change, but the Point where it is thrown differs
> > from HTTP 1.1. Now the exception is thrown after the complet logging og
> > the http-header.
> >
> > Can anybody say me, how to disable the transfer-encoding: chunked?
> >
> > Thank you for your help!
> >
> > Igor :-)
> >
> > PS: sorry, but my english-teacher in school was not the best ;-)
> >
> > [1]: complet client Sourcecode
> > try {
> > HttpTransportProperties.BasicAuthentication basicAuth = new
> > HttpTransportProperties().new BasicAuthentication();
> > basicAuth.setUsername(username);
> > basicAuth.setPassword(password);
> >
> > Options options = new Options();
> > options.setTo(new EndpointReference(endpoint));
> > options.setProperty(HTTPConstants.BASIC_AUTHENTICATION,
> > basicAuth);
> >
> > // Timeout....
> > options.setProperty(HTTPConstants.SO_TIMEOUT,new
> > Integer(180*1000));
> > options.setProperty(HTTPConstants.CONNECTION_TIMEOUT,new
> > Integer(180*1000));
> >
> > // HTTP 1.0
> > /*
> > options.setProperty(
> > MessageContextConstants.HTTP_PROTOCOL_VERSION,
> > HTTPConstants.HEADER_PROTOCOL_10);
> > */
> >
> > options.setProperty(
> > MessageContextConstants.CHUNKED,
> > Constants.VALUE_FALSE);
> >
> >
> >
> >
> > ServiceClient serviceClient = new ServiceClient();
> > serviceClient.setOptions(options);
> > serviceClient.sendReceive(generateRequest(job));
> > } catch (AxisFault axisFault) {
> > LOG.error(axisFault.getMessage());
> > ...
> > }
> >
> >
> > [2]: complet thrown exception
> > DEBUG:spool_8: org.apache.commons.httpclient.Wire (Wire.java:69) => >>
> > "POST path?wsdl HTTP/1.1[\r][\n]"
> > java.lang.Error: org.apache.axiom.om.OMException:
> > Caused by: org.apache.axiom.om.OMException:
> > org.apache.axiom.om.OMException: Unsupported Operation
> > at
> > org.apache.axiom.om.impl.llom.OMTextImpl.getText(OMTextImpl.java:254)
> > at
> > org.apache.axiom.om.impl.llom.OMTextImpl.writeOutput(OMTextImpl.java:219)
> > at
> > org.apache.axiom.om.impl.llom.OMTextImpl.internalSerializeLocal(OMTextImpl.java:405)
> > at
> > org.apache.axiom.om.impl.llom.OMTextImpl.internalSerializeAndConsume(OMTextImpl.java:398)
> > at
> > org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:780)
> > at
> > org.apache.axiom.om.impl.llom.OMElementImpl.internalSerializeAndConsume(OMElementImpl.java:809)
> > at
> > org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:780)
> > at
> > org.apache.axiom.om.impl.llom.OMElementImpl.internalSerializeAndConsume(OMElementImpl.java:809)
> > at
> > org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:780)
> > at
> > org.apache.axiom.om.impl.llom.OMElementImpl.internalSerializeAndConsume(OMElementImpl.java:809)
> > at
> > org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:780)
> > at
> > org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.internalSerialize(SOAPEnvelopeImpl.java:171)
> > at
> > org.apache.axiom.om.impl.llom.OMElementImpl.internalSerializeAndConsume(OMElementImpl.java:809)
> > at
> > org.apache.axiom.om.impl.llom.OMNodeImpl.serializeAndConsume(OMNodeImpl.java:381)
> > at org.apache.axis2.transport.http.SOAPOverHTTPSender
> > $AxisSOAPRequestEntity.writeBytes(SOAPOverHTTPSender.java:180)
> > at org.apache.axis2.transport.http.SOAPOverHTTPSender
> > $AxisSOAPRequestEntity.getContentLength(SOAPOverHTTPSender.java:232)
> > at
> > org.apache.commons.httpclient.methods.EntityEnclosingMethod.getRequestContentLength(EntityEnclosingMethod.java:332)
> > at
> > org.apache.commons.httpclient.methods.EntityEnclosingMethod.addContentLengthRequestHeader(EntityEnclosingMethod.java:402)
> > at
> > org.apache.commons.httpclient.methods.EntityEnclosingMethod.addRequestHeaders(EntityEnclosingMethod.java:370)
> > at
> > org.apache.commons.httpclient.HttpMethodBase.writeRequestHeaders(HttpMethodBase.java:2036)
> > at
> > org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:1919)
> > at
> > org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:993)
> > at
> > org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:393)
> > at
> > org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:168)
> > at
> > org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
> > at
> > org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
> > at
> > org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:659)
> > at
> > org.apache.axis2.transport.http.SOAPOverHTTPSender.send(SOAPOverHTTPSender.java:109)
> > at
> > org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:301)
> > at
> > org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:206)
> > at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:651)
> > at
> > org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:344)
> > at
> > org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:280)
> > at
> > org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:538)
> > at
> > org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:472)
> > at
> > de.xxxxxxxxxxxx.SOAPNotifyBase.service(SOAPNotifyBase.java:78)
> > at de.dominic.server.core.Job.run(Job.java:1400)
> > ... 2 more
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------
CONFIDENTIALITY NOTICE
This message and its attachments are addressed solely to the persons above and
may contain confidential information. If you have received the message in
error, be informed that any use of the content hereof is prohibited. Please
return it immediately to the sender and delete the message. Should you have any
questions, please contact us by replying to [EMAIL PROTECTED]
Thank you
www.telecomitalia.it
--------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]