Discussion:
[esb-java-user] Proxy web service adding 'Transfer-Encoding: chunked' HTTP header
pete.j
2007-07-17 00:31:55 UTC
Permalink
Hi,

I set up a Proxy service with WSO2 ESB - the endpoint is WebMethods. It was easy to setup - however the service seems to add the HTTP Header, Transfer-Encoding: chunked. I do not want this so I tried to turn it off. My axis2.xml (which is where I understood this setting to be) did not even set it so I wondered if if was set dynamically. Can anyone help?

Cheers


Pete...
Asankha C. Perera
2007-07-17 05:38:26 UTC
Permalink
Hi Pete

The chunking would be turned on depending on whether the other party
supports HTTP 1.1. When dealing with dynamic content (say a response)
you need to buffer the complete message in memory and compute its length
if you are not using chunking. Thus if WebMethods does support HTTP 1.1
I do not see any reason for you to want to turn it off. Could you
explain the reasons why you want this, so that we can understand the
requirement better and see if there is any workaround

asankha
Post by pete.j
Hi,
I set up a Proxy service with WSO2 ESB - the endpoint is WebMethods.
It was easy to setup - however the service seems to add the HTTP
Header, Transfer-Encoding: chunked. I do not want this so I tried to
turn it off. My axis2.xml (which is where I understood this setting to
be) did not even set it so I wondered if if was set dynamically. Can
anyone help?
Cheers
Pete...
_______________________________________________
Esb-java-user mailing list
http://wso2.org/cgi-bin/mailman/listinfo/esb-java-user
pete.j
2007-07-18 01:33:37 UTC
Permalink
Hi Asankha,

Thanks for your reply.
I should have said that Webmethods fell over when it received my request with this response:

<SOAP-ENV:Fault>
<faultcode>SOAP-ENV:Client</faultcode>
<faultstring>[ISS.0088.9125] SOAP request does not conform to the SOAP message model</faultstring>

more detail here...
</SOAP-ENV:Fault>

I believe that the problem is caused by chunking the request as webmethods can't handle it. The requests are pretty small so do not need chunking.

I need to turn this off so I can see if it is the problem.

Cheers

Pete...
Asankha C. Perera
2007-07-18 03:08:16 UTC
Permalink
An HTML attachment was scrubbed...
URL: http://wso2.org/pipermail/esb-java-user/attachments/20070718/5583804a/attachment.htm
peetj
2007-07-19 01:43:03 UTC
Permalink
Hi Asankha,

Thanks again for your reply. I know that that the message is fine as I have demonstrated it with XRay which enables me to insert whatever HTTP Header I want. I am also tracing with TCPMonitor in Eclipse and Wireshark. Also spoke to a WebMethods consultant in my office who said that the chunking was most probably the problem. By the way it is an internal system - not public.

The only way forward as I see it is to manipulate the HTTP header to take out the Transfer-Encoding:chunked. I am sure it will work if I can do this. You still haven't confirmed whether this is possible. Is it? Other than that we may have to write an extension to WebMethods to handle the scenario if WSO2 can't do what I want it to.

Cheers

Pete...
Asankha C. Perera
2007-07-19 02:41:34 UTC
Permalink
Hi Pete
Post by peetj
Thanks again for your reply. I know that that the message is fine as I
have demonstrated it with XRay which enables me to insert whatever
HTTP Header I want. I am also tracing with TCPMonitor in Eclipse and
Wireshark. Also spoke to a WebMethods consultant in my office who said
that the chunking was most probably the problem. By the way it is an
internal system - not public.
Ok, let me look at the code and the code of Apache HttpCore we depend
upon and get back to you.
Post by peetj
The only way forward as I see it is to manipulate the HTTP header to
take out the Transfer-Encoding:chunked. I am sure it will work if I
can do this.
Its not just the http header, its the way the body is written.. so just
adding the header will not work.
Post by peetj
You still haven't confirmed whether this is possible. Is it? Other
than that we may have to write an extension to WebMethods to handle
the scenario if WSO2 can't do what I want it to.
Let me get back to you by early next week on how we could address this,
we should be able to do this if required

asankha
peetj
2007-07-19 21:15:43 UTC
Permalink
Hi Asankha,

Here is the code/message I am using.


*************************************************
CODE
*************************************************


package samples.userguide;

import java.net.URL;

import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.impl.builder.StAXOMBuilder;
import org.apache.axis2.Constants;
import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.client.Options;
import org.apache.axis2.client.ServiceClient;
import org.apache.axis2.context.ConfigurationContext;
import org.apache.axis2.context.ConfigurationContextFactory;
import org.apache.axis2.transport.http.HTTPConstants;
import org.apache.axis2.transport.http.HttpTransportProperties;
import org.apache.neethi.Policy;
import org.apache.neethi.PolicyEngine;
import org.apache.rampart.RampartMessageData;

import samples.common.ErrorServiceHandler;

/**
* See build.xml for options
*/
public class ErrorClient {

private static String getProperty(String name, String def) {
String result = System.getProperty(name);
if (result == null || result.length() == 0) {
result = def;
}
return result;
}

public static void main(String[] args) {

// defaults
String mode = getProperty("mode", "1");
String addUrl = getProperty("addurl", null);
String trpUrl = getProperty("trpurl", null);
String prxUrl = getProperty("prxurl", null);
String repo = getProperty("repository", "client_repo");
String svcPolicy = getProperty("policy", null);
String rest = getProperty("rest", null);

double price = 0; int quantity = 0;

try {
Options options = new Options();
OMElement payload = null;
ServiceClient serviceClient = null;

if (repo != null && !"null".equals(repo)) {
ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(repo, null);
serviceClient = new ServiceClient(configContext, null);
} else {
serviceClient = new ServiceClient();
}

if ("1".equals(mode)) {
payload = ErrorServiceHandler.createRequest(2, new String[]{"DateTime,>=,2007-06-03 00:00:00.000,AND","DateTime,<=,2007-07-18 23:59:00.000,AND"});
options.setAction("urn:getError");
}

// set addressing, transport and proxy url
if (addUrl != null && !"null".equals(addUrl)) {
serviceClient.engageModule("addressing");
options.setTo(new EndpointReference(addUrl));
}
if (trpUrl != null && !"null".equals(trpUrl)) {
options.setProperty(Constants.Configuration.TRANSPORT_URL, trpUrl);
}
if (prxUrl != null && !"null".equals(prxUrl)) {
HttpTransportProperties.ProxyProperties proxyProperties =
new HttpTransportProperties.ProxyProperties();
URL url = new URL(prxUrl);
proxyProperties.setProxyName(url.getHost());
proxyProperties.setProxyPort(url.getPort());
proxyProperties.setUserName("");
proxyProperties.setPassWord("");
proxyProperties.setDomain("");
options.setProperty(HTTPConstants.PROXY, proxyProperties);
}

// apply any service policies if any
if (svcPolicy != null && !"null".equals(svcPolicy) && svcPolicy.length() > 0) {
serviceClient.engageModule("addressing");
serviceClient.engageModule("rampart");
options.setProperty(
RampartMessageData.KEY_RAMPART_POLICY, loadPolicy(svcPolicy));
}

if (Boolean.parseBoolean(rest)) {
options.setProperty(Constants.Configuration.ENABLE_REST, Constants.VALUE_TRUE);
}

// We do NOT want to chunk
options.setProperty(org.apache.axis2.transport.http.HTTPConstants.CHUNKED,Boolean.FALSE);
serviceClient.setOptions(options);

// Send request
OMElement result = serviceClient.sendReceive(payload);

// Parse the result
ErrorServiceHandler.parseResponse(result);

} catch (Exception e) {
e.printStackTrace();
}
}

private static Policy loadPolicy(String xmlPath) throws Exception {
StAXOMBuilder builder = new StAXOMBuilder(xmlPath);
return PolicyEngine.getPolicy(builder.getDocumentElement());
}

}


package samples.common;

import org.apache.axiom.om.OMAbstractFactory;
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMFactory;
import org.apache.axiom.om.OMNamespace;
import org.apache.axiom.om.xpath.AXIOMXPath;

/**
* A class that can create messages to, and parse replies from the ESB ErrorService
*/
public class ErrorServiceHandler {

public static OMElement createRequest(int numBooleanRequests, String[] input) {

OMFactory factory = OMAbstractFactory.getOMFactory();
OMNamespace ns = factory.createOMNamespace("urn:au.gov.nsw.police.data.entity.xml.cim.technology.envelope.CIMMessageEnvelope.version_1_1_0_0", "");
OMElement cimMsgEnv = factory.createOMElement("CIMMessageEnvelope", ns);
OMElement header = factory.createOMElement("Header", ns);
OMElement delivery = factory.createOMElement("Delivery", ns);
OMElement message = factory.createOMElement("Message", ns);
OMElement senderMessageID = factory.createOMElement("SenderMessageID", ns);
senderMessageID.setText("n1116172");
OMElement from = factory.createOMElement("From", ns);
OMElement name = factory.createOMElement("Name", ns);
name.setText("ESBTest");
OMElement service = factory.createOMElement("Service", ns);
OMElement serviceName = factory.createOMElement("Name", ns);
serviceName.setText("getError");
OMElement namespace = factory.createOMElement("Namespace", ns);
namespace.setText("urn:au.gov.nsw.police.service.cim.technology.error.version_1_0_0_0");

service.addChild(serviceName);
service.addChild(namespace);
from.addChild(name);
message.addChild(senderMessageID);
delivery.addChild(message);
delivery.addChild(from);
header.addChild(delivery);
header.addChild(service);
cimMsgEnv.addChild(header);

OMElement payload = factory.createOMElement("Payload", ns);
OMElement document = factory.createOMElement("Document", ns);
OMNamespace nsReq = factory.createOMNamespace("urn:au.gov.nsw.police.service.cim.technology.error.version_1_0_0_0", "");
OMElement getRq = factory.createOMElement("getRq", nsReq);

// Create the ExpressionSets
for(int i=0; i < numBooleanRequests; i++){
OMElement expressionSet = createExpressionSet(input[i], factory);
getRq.addChild(expressionSet);
}

document.addChild(getRq);
payload.addChild(document);
cimMsgEnv.addChild(payload);

System.out.println(cimMsgEnv);

return cimMsgEnv;
}

public static void parseResponse(OMElement result) {

System.out.println("IN parseResponse...");
System.out.println("RESULT:");
System.out.println(result.toString());

}

/**
* Return an XML ExpressionSet
* @param input is a String delimited by a comma with 4 parts
* Left,Operation,Right,AndOrOperation
* @return OMElement - the XML representing the ExpressionSet
*/
public static OMElement createExpressionSet(String input, OMFactory factory){

// Create the Namespace and higher level elements
OMNamespace ns = factory.createOMNamespace("urn:au.gov.nsw.police.data.cim.technology.query.version_1_0_0_0", "");
OMElement expressionSet = factory.createOMElement("ExpressionSet", ns);
OMElement booleanExpression = factory.createOMElement("BooleanExpression", ns);

// Split the String into an array
String[] opNames = new String[]{"Left","Operation","Right","AndOrOpertion"};
String[] opVals = input.split(",");

// Create the repeating elements

// Finally return the ExpressionSet
}

}

*************************************************
REQUEST MESSAGE - FROM CLIENT TO ESB
*************************************************

POST / HTTP/1.1
Content-Type: text/xml; charset=UTF-8
SOAPAction: "urn:getError"
User-Agent: Axis2
Host: localhost:8080
Content-Length: 1473


<soapenv:Envelope xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header>
<wsa:To>http://spc7ed01:5555/soap/esbSOAPHandler</wsa:To>
<wsa:MessageID>urn:uuid:1A7D7295DEC149D9D21184881658253</wsa:MessageID>
<wsa:Action>urn:getError</wsa:Action>
</soapenv:Header>
<soapenv:Body>
<CIMMessageEnvelope xmlns="urn:au.gov.nsw.police.data.entity.xml.cim.technology.envelope.CIMMessageEnvelope.version_1_1_0_0">
<Header>
<Delivery>
<Message>
<SenderMessageID>n1116172</SenderMessageID>
</Message>
<From>
<Name>ESBTest</Name>
</From>
</Delivery>
<Service>
<Name>getError</Name>
<Namespace>urn:au.gov.nsw.police.service.cim.technology.error.version_1_0_0_0</Namespace>
</Service>
</Header>
<Payload>
<Document>
<getRq xmlns="urn:au.gov.nsw.police.service.cim.technology.error.version_1_0_0_0">
<ExpressionSet xmlns="urn:au.gov.nsw.police.data.cim.technology.query.version_1_0_0_0">
<BooleanExpression>
<Left>DateTime</Left>
<Operation>>=</Operation>
<Right>2007-06-03 00:00:00.000</Right>
<AndOrOpertion>AND</AndOrOpertion>
</BooleanExpression>
</ExpressionSet>
<ExpressionSet xmlns="urn:au.gov.nsw.police.data.cim.technology.query.version_1_0_0_0">
<BooleanExpression>
<Left>DateTime</Left>
<Operation><=</Operation>
<Right>2007-07-18 23:59:00.000</Right>
<AndOrOpertion>AND</AndOrOpertion>
</BooleanExpression>
</ExpressionSet>
</getRq>
</Document>
</Payload>
</CIMMessageEnvelope>
</soapenv:Body>
</soapenv:Envelope>

*************************************************
REQUEST MESSAGE - FROM ESB TO WEBMETHODS
*************************************************

POST http://spc7ed01:5555/soap/esbSOAPHandler HTTP/1.1
Host: localhost:8080
SOAPAction: urn:getError
Content-Type: text/xml; charset=UTF-8
Transfer-Encoding: chunked
Connection: Keep-Alive
User-Agent: Synapse-HttpComponents-NIO

400
<soapenv:Envelope xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><CIMMessageEnvelope xmlns="urn:au.gov.nsw.police.data.entity.xml.cim.technology.envelope.CIMMessageEnvelope.version_1_1_0_0"><Header><Delivery><Message><SenderMessageID>n1116172</SenderMessageID></Message><From><Name>ESBTest</Name></From></Delivery><Service><Name>getError</Name><Namespace>urn:au.gov.nsw.police.service.cim.technology.error.version_1_0_0_0</Namespace></Service></Header><Payload><Document><getRq xmlns="urn:au.gov.nsw.police.service.cim.technology.error.version_1_0_0_0"><ExpressionSet xmlns="urn:au.gov.nsw.police.data.cim.technology.query.version_1_0_0_0"><BooleanExpression><Left>DateTime</Left><Operation>>=</Operation><Right>2007-06-03 00:00:00.000</Right><AndOrOpertion>AND</AndOrOpertion></BooleanExpression></ExpressionSet><ExpressionSet xmlns="urn:au.gov.nsw.police.data.cim.technology.query.version_1_0_0_0"><BooleanE
fb
xpression><Left>DateTime</Left><Operation><=</Operation><Right>2007-07-18 23:59:00.000</Right><AndOrOpertion>AND</AndOrOpertion></BooleanExpression></ExpressionSet></getRq></Document></Payload></CIMMessageEnvelope></soapenv:Body></soapenv:Envelope>
0

*************************************************
RESPONSE FROM WEBMETHODS
*************************************************

HTTP/1.0 500 Internal Server Error
Set-Cookie: ssnid=2170CZuuRSkX42aOjczYyw6DyO+4omg-555530; path=/;
Content-Type: text/xml;charset=utf-8
Connection: Keep-Alive
Content-Length: 934

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>SOAP-ENV:Client</faultcode>
<faultstring>[ISS.0088.9125] SOAP request does not conform to the SOAP message model</faultstring>
<faultactor>http://localhost:8080http://spc7ed01:5555/soap/esbSOAPHandler</faultactor>
<detail xmlns:webM="http://www.webMethods.com/2001/10/soap/encoding">
<webM:validationError>
<webM:pathName>/</webM:pathName>
<webM:errorCode>NV-002</webM:errorCode>
<webM:errorMessage xml:lang="i-default">[ISC.0082.9002] Unable to retrieve root element</webM:errorMessage>
</webM:validationError>
</detail>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

One thing that i am still investigating is the fact the WebMethod supports HTTP 1.1 for inbound and 1.0 for outbound so
I am a little confused as to why it can't handle my message. I will let you know if I get this resolved.

Thanks for your help

Cheers

Pete...
Asankha C. Perera
2007-07-20 04:18:37 UTC
Permalink
Hi Pete

Please send me a trace of a successful call to WebMethods (when not
using the ESB) as well

thanks
asankha
peetj
2007-07-20 07:29:03 UTC
Permalink
Hi Asankha,

I'll have to do this on Monday as I'm at home now. However I have made some progress. Regarding the WebMethods response it supports HTTP/1.1 for inbound and 1.0 for outbound. My suspicion is that they haven't implemented 1.1 properly.

After spending the day in the source code of Synapse, Axis and HTTPCore I finally changed the axis2.xml TransportOut http binding to CommonsHTTPTransportSender with a parameter of HTTP/1.0 so this 'forced' it to work. I got a good response from WebMethods but I also got a 'HTTP response already committed' error - I didn't have time to delve into this. Do you have any ideas.

Just to emphasize - we need to do this without chunking as you can't guarentee security on the transport from end to end with chunking on. By end to end I mean client -> WSO2 -> WebMethods and back again - unless you spill over into the application code.

Hope this makes sense.


Cheers

Pete...
Asankha C. Perera
2007-07-20 08:06:11 UTC
Permalink
Hi Pete
Post by peetj
I'll have to do this on Monday as I'm at home now.
ok.. I am looking forward to this..
Post by peetj
However I have made some progress. Regarding the WebMethods response
it supports HTTP/1.1 for inbound and 1.0 for outbound. My suspicion is
that they haven't implemented 1.1 properly.
I would say that this is highly unlikely, especially since the error
message you get seems like a validation error, where the root element of
probably the soap body could not be found. If webMethods didn't know
HTTP 1.1 I do not think they could have even given an error like this -
as they would not be able to even detect if the HTTP body was XML or not.

<webM:validationError>
<webM:pathName>/</webM:pathName>
<webM:errorCode>NV-002</webM:errorCode>
<webM:errorMessage xml:lang="i-default">[ISC.0082.9002]
Unable to retrieve root element</webM:errorMessage>
</webM:validationError>
Post by peetj
After spending the day in the source code of Synapse, Axis and
HTTPCore I finally changed the axis2.xml TransportOut http binding to
CommonsHTTPTransportSender with a parameter of HTTP/1.0 so this
'forced' it to work. I got a good response from WebMethods but I also
got a 'HTTP response already committed' error - I didn't have time to
delve into this. Do you have any ideas.
This occurs because you have mixed the NIO and non-NIO HTTP/s transport
implementations. However, as I said, we should be able to force HTTP 1.0
if its really required. Again, I am more interested to see the trace
messages for this scenario
Post by peetj
Just to emphasize - we need to do this without chunking as you can't
guarentee security on the transport from end to end with chunking on.
I don't agree.. the transport can break a SOAP message into several
chunks and transmit it.. anyway, TCP would send your message in multiple
packets.. I don't see why you say that chunking would have a problem
with security..
Post by peetj
By end to end I mean client -> WSO2 -> WebMethods and back again -
unless you spill over into the application code.
Can you describe your concerns about chunking w.r.t security?

asankha
peetj
2007-07-23 01:47:19 UTC
Permalink
Hi Asankha,

A successful request to webmethods goes like this:

**********
REQUEST
**********

POST /soap/esbSOAPHandler HTTP/1.1
Content-Type: text/xml; charset=UTF-8
SOAPAction: "urn:getError"
User-Agent: Axis2
Host: spc7ed01:5555
Content-Length: 1473

<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header>
<wsa:To>http://spc7ed01:5555/soap/esbSOAPHandler</wsa:To>
<wsa:MessageID>urn:uuid:2E44983A9247B79FBC1185161917570</wsa:MessageID>
<wsa:Action>urn:getError</wsa:Action>
</soapenv:Header>
<soapenv:Body>
<CIMMessageEnvelope xmlns="urn:au.gov.nsw.police.data.entity.xml.cim.technology.envelope.CIMMessageEnvelope.version_1_1_0_0">
<Header>
<Delivery>
<Message>
<SenderMessageID>n1116172</SenderMessageID>
</Message>
<From>
<Name>ESBTest</Name>
</From>
</Delivery>
<Service>
<Name>getError</Name>
<Namespace>urn:au.gov.nsw.police.service.cim.technology.error.version_1_0_0_0</Namespace>
</Service>
</Header>
<Payload>
<Document>
<getRq xmlns="urn:au.gov.nsw.police.service.cim.technology.error.version_1_0_0_0">
<ExpressionSet xmlns="urn:au.gov.nsw.police.data.cim.technology.query.version_1_0_0_0">
<BooleanExpression>
<Left>DateTime</Left>
<Operation>>=</Operation>
<Right>2007-06-03 00:00:00.000</Right>
</BooleanExpression>
<AndOrOpertion>AND</AndOrOpertion>
</ExpressionSet>
<ExpressionSet xmlns="urn:au.gov.nsw.police.data.cim.technology.query.version_1_0_0_0">
<BooleanExpression>
<Left>DateTime</Left>
<Operation><=</Operation>
<Right>2007-07-18 23:59:00.000</Right>
</BooleanExpression>
<AndOrOpertion>AND</AndOrOpertion>
</ExpressionSet>
</getRq>
</Document>
</Payload>
</CIMMessageEnvelope>
</soapenv:Body>
</soapenv:Envelope>


**********
RESPONSE
**********

HTTP/1.0 200 OK
Set-Cookie: ssnid=3609DT9+RYOISF2uE0aX4XPlnFX8Qpc-555530; path=/;
Content-Type: text/xml;charset=utf-8
Connection: Keep-Alive
Content-Length: 209760

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<ns:CIMMessageEnvelope xmlns:ns="urn:au.gov.nsw.police.data.entity.xml.cim.technology.envelope.CIMMessageEnvelope.version_1_1_0_0" xmlns:errors="urn:au.gov.nsw.police.service.cim.technology.error.version_1_0_0_0" xmlns:error="urn:au.gov.nsw.police.data.cim.technology.webMethods.error.version_1_0_0_0" xmlns:err="urn:au.gov.nsw.police.xml.model.common.errorAudit.version_1_0_0_0">
<ns:Header>
<ns:Delivery>
<ns:Message>
<ns:ReceiverMessageID>n1116172</ns:ReceiverMessageID>
</ns:Message>
<ns:To>
<ns:Name>ESBTest</ns:Name>
</ns:To>
<ns:From>
<ns:Name>ESB</ns:Name>
</ns:From>
</ns:Delivery>
<ns:PayloadManifest>
<ns:DocumentDetails RefKey="0">
<ns:Name>getError response</ns:Name>
<ns:Namespace>urn:au.gov.nsw.police.data.cim.technology.webMethods.error.version_1_0_0_0</ns:Namespace>
</ns:DocumentDetails>
</ns:PayloadManifest>
<ns:BusinessProcessName>getError</ns:BusinessProcessName>
<ns:Service>
<ns:Name>getErrorService</ns:Name>
<ns:Namespace>urn:au.gov.nsw.police.service.cim.technology.error.version_1_0_0_0</ns:Namespace>
<ns:Version>1_0_0_0</ns:Version>
</ns:Service>
</ns:Header>
<ns:Payload>

...AND SO ON...


By the way I still can't get HTTP/1.0 to work - the error message I get is:

ERROR [23 Jul 13:25:14] Axis2Sender - Unexpected error during Sending message back
org.apache.axis2.AxisFault: Connection reset by peer: socket write error
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:221)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:452)
at org.apache.synapse.core.axis2.Axis2Sender.sendBack(Axis2Sender.java:96)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2SynapseEnvironment.java:110)
at org.apache.synapse.mediators.builtin.SendMediator.mediate(SendMediator.java:89)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:49)
at org.apache.synapse.mediators.filters.OutMediator.mediate(OutMediator.java:55)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:49)
at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:104)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:104)
at org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:218)
at org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:88)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:144)
at org.apache.synapse.core.axis2.DynamicAxisOperation$DynamicOperationClient.send(DynamicAxisOperation.java:239)
at org.apache.synapse.core.axis2.DynamicAxisOperation$DynamicOperationClient.execute(DynamicAxisOperation.java:177)
at org.apache.synapse.core.axis2.Axis2FlexibleMEPClient.send(Axis2FlexibleMEPClient.java:233)
at org.apache.synapse.core.axis2.Axis2Sender.sendOn(Axis2Sender.java:50)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2SynapseEnvironment.java:112)
at org.apache.synapse.mediators.builtin.SendMediator.mediate(SendMediator.java:89)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:49)
at org.apache.synapse.mediators.filters.FilterMediator.mediate(FilterMediator.java:62)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:49)
at org.apache.synapse.mediators.filters.InMediator.mediate(InMediator.java:54)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:49)
at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:104)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:104)
at org.apache.synapse.core.axis2.SynapseMessageReceiver.receive(SynapseMessageReceiver.java:73)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:144)
at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:279)
at org.apache.axis2.transport.http.HTTPWorker.service(HTTPWorker.java:216)
at org.apache.axis2.transport.http.server.AxisHttpService.doService(AxisHttpService.java:275)
at org.apache.axis2.transport.http.server.AxisHttpService.handleRequest(AxisHttpService.java:184)
at org.apache.axis2.transport.http.server.HttpServiceProcessor.run(HttpServiceProcessor.java:74)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
at java.lang.Thread.run(Thread.java:595)
Caused by: org.apache.axis2.AxisFault: Connection reset by peer: socket write error
at org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo(SOAPMessageFormatter.java:59)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.sendUsingOutputStream(CommonsHTTPTransportSender.java:275)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:203)
... 35 more
Caused by: com.ctc.wstx.exc.WstxIOException: Connection reset by peer: socket write error
at com.ctc.wstx.sw.BaseStreamWriter.writeCharacters(BaseStreamWriter.java:511)
at org.apache.axiom.om.impl.MTOMXMLStreamWriter.writeCharacters(MTOMXMLStreamWriter.java:193)
at org.apache.axiom.om.impl.serialize.StreamingOMSerializer.serializeText(StreamingOMSerializer.java:312)
at org.apache.axiom.om.impl.serialize.StreamingOMSerializer.serializeNode(StreamingOMSerializer.java:76)
at org.apache.axiom.om.impl.serialize.StreamingOMSerializer.serialize(StreamingOMSerializer.java:54)
at org.apache.axiom.om.impl.util.OMSerializerUtil.serializeByPullStream(OMSerializerUtil.java:490)
at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.internalSerialize(SOAPEnvelopeImpl.java:226)
at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerializeAndConsume(OMElementImpl.java:808)
at org.apache.axiom.om.impl.llom.OMNodeImpl.serializeAndConsume(OMNodeImpl.java:418)
at org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo(SOAPMessageFormatter.java:55)
... 37 more
Caused by: java.net.SocketException: Connection reset by peer: socket write error
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
at org.apache.http.impl.io.AbstractHttpDataTransmitter.write(AbstractHttpDataTransmitter.java:96)
at org.apache.http.impl.io.IdentityOutputStream.write(IdentityOutputStream.java:86)
at org.apache.axis2.transport.http.server.AxisHttpResponseImpl$AutoCommitOutputStream.write(AxisHttpResponseImpl.java:237)
at com.ctc.wstx.io.UTF8Writer.write(UTF8Writer.java:139)
at com.ctc.wstx.sw.BufferingXmlWriter.writeRaw(BufferingXmlWriter.java:259)
at com.ctc.wstx.sw.BufferingXmlWriter.writeCharacters(BufferingXmlWriter.java:543)
at com.ctc.wstx.sw.BaseStreamWriter.writeCharacters(BaseStreamWriter.java:509)
... 46 more
DEBUG [23 Jul 13:25:14] MediatorFaultHandler - MediatorFaultHandler :: handleFault
DEBUG [23 Jul 13:25:14] SequenceMediator - Sequence mediator <fault> :: mediate()
DEBUG [23 Jul 13:25:14] AbstractListMediator - Implicit Sequence <SequenceMediator> :: mediate()
DEBUG [23 Jul 13:25:14] LogMediator - Log mediator :: mediate()
INFO [23 Jul 13:25:14] LogMediator - To: http://www.w3.org/2005/08/addressing/anonymous, WSAction: , SOAPAction: , MessageID: urn:uuid:19BF95A8E92C90EBF13650146449
2961507879254
DEBUG [23 Jul 13:25:14] OutMediator - Out mediator mediate()
DEBUG [23 Jul 13:25:14] OutMediator - Current message is not outgoing.. skipping child mediators
Exception in thread "HttpConnection-8080-1" java.lang.IllegalStateException: Response already committed
at org.apache.axis2.transport.http.server.AxisHttpResponseImpl.assertNotCommitted(AxisHttpResponseImpl.java:85)
at org.apache.axis2.transport.http.server.AxisHttpResponseImpl.sendError(AxisHttpResponseImpl.java:120)
at org.apache.axis2.transport.http.server.AxisHttpService.doService(AxisHttpService.java:297)
at org.apache.axis2.transport.http.server.AxisHttpService.handleRequest(AxisHttpService.java:184)
at org.apache.axis2.transport.http.server.HttpServiceProcessor.run(HttpServiceProcessor.java:74)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
at java.lang.Thread.run(Thread.java:595)



If possible I would just like to use HTTP 1.0 and leave the chunking discussion for now as I am running out of time. We can resume that after I get 1 valid response back from the ESB.

Cheers

Pete...
Asankha C. Perera
2007-07-23 10:20:42 UTC
Permalink
Pete

Let me give you an update on this. I was going through the code and
attempting a fix today. However, the problem is not that simple, as when
using chunking the content body can be written dynamically, and forcing
an HTTP 1.0 conversation requires the message to be completely buffered,
and the length known. Thus the fix will have to be done carefully, and
may take a couple of days. If you already haven't, could you raise a
JIRA for this? The description should be to "allow for HTTP 1.0 to be
forced for outgoing messages"
The reason for this is that the non-NIO transport sender does not know
how to send the response back to the client, where the request was
received over the NIO transport.

thanks
asankha
Asankha C. Perera
2007-07-23 10:52:33 UTC
Permalink
An HTML attachment was scrubbed...
URL: http://wso2.org/pipermail/esb-java-user/attachments/20070723/0587482d/attachment-0001.htm
peetj
2007-07-24 23:26:35 UTC
Permalink
Hi Asankha,

Sorry to take so long to get back to you. Am fighting sickness. The solution has worked. I will raise a JIRA hopefully in the next few days.

Thank you very much for all your help so far.

Pete...
Sanjiva Weerawarana
2007-07-25 00:30:54 UTC
Permalink
In your IN sequence, set the following property to inform that sending
of the message should be forcing HTTP 1.0
<syn:property name="__CHUNKED__" value="false" scope="axis2" />
Asankha, is this forcing HTTP 1.0 or just turning off chunking? If its the
prior the property should be named differently.

Sanjiva.
--
Sanjiva Weerawarana, Ph.D.
Founder, Chairman & CEO; WSO2, Inc.; http://www.wso2.com/
email: ***@wso2.com; cell: +94 77 787 6880; fax: +1 509 691 2000

"Oxygenating the Web Service Platform."
Asankha C. Perera
2007-07-25 02:16:45 UTC
Permalink
Sanjiva
Post by Sanjiva Weerawarana
In your IN sequence, set the following property to inform that
sending of the message should be forcing HTTP 1.0
<syn:property name="__CHUNKED__" value="false" scope="axis2" />
Asankha, is this forcing HTTP 1.0 or just turning off chunking? If its
the prior the property should be named differently.
Yes, I totally agree.. and already informed Pete that this property name
was may not be the final. I just wanted to get this checked in his
environment before I commit the change, and I will check if Axis2
already has a constant/property to force HTTP 1.0 and if not define one.

thanks
asankha

Loading...