Oleg, Thank you for your quick reply.
You can use following steps to reproduce this issue: (1) Use " wsdl2java -ss -sd -ssi -d xmlbeans -uri Axis2SampleDocLit.wsdl " on windows Xp platform to generate java code . <<Axis2SampleDocLit.wsdl>> <?xml version="1.0" encoding="UTF-8"?> <definitions name="Axis2SampleDocLitService" targetNamespace="http://userguide.axis2.apache.org/Axis2SampleDocLit" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://userguide.axis2.apache.org/Axis2SampleDocLit" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsd1="http://userguide.axis2.apache.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <types> <schema targetNamespace="http://userguide.axis2.apache.org/xsd" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" elementFormDefault="qualified"> <element name="echoStringParam" type="xsd:string"/> <element name="echoStringReturn" type="xsd:string"/> </schema> </types> <message name="echoString"> <part element="xsd1:echoStringParam" name="a"/> </message> <message name="echoStringResponse"> <part element="xsd1:echoStringReturn" name="result"/> </message> <portType name="Axis2SampleDocLitPortType"> <operation name="echoString"> <input message="tns:echoString" name="echoString"/> <output message="tns:echoStringResponse" name="echoStringResponse"/> </operation> </portType> <binding name="Axis2SampleDocLitPortBinding" type="tns:Axis2SampleDocLitPortType"> <soap:binding style="document" transport=" http://schemas.xmlsoap.org/soap/http"/> <operation name="echoString"> <soap:operation soapAction="echoString" style="rpc"/> <input name="echoString"> <soap:body namespace=" http://userguide.axis2.apache.org/Axis2SampleDocLit" use="literal"/> </input> <output name="echoStringResponse"> <soap:body namespace=" http://userguide.axis2.apache.org/Axis2SampleDocLit" use="literal"/> </output> </operation> </binding> <service name="Axis2SampleDocLitService"> <port binding="tns:Axis2SampleDocLitPortBinding" name="Axis2SampleDocLitPort"> <soap:address location=" http://userguide.axis2.apache.org/stkv3/wsdl/Axis2SampleDocLit.wsdl"/> </port> </service> </definitions> (2) Added the implemententation to class Axis2SampleDocLitServiceSkeleton: public EchoStringResponseDocument echoString(EchoStringDocument param2) { EchoStringResponseDocument resDoc = EchoStringResponseDocument.Factory.newInstance(); EchoStringResponseDocument.EchoStringResponse response = resDoc.addNewEchoStringResponse(); response.setEchoStringReturn(param2.getEchoString ().getEchoStringParam()); return resDoc; } (3) Packag deploy this service to Axis2 repository . (4) Run the following simple client to send the soap request and receive the response from axis2 standalone server byte[] buffer = new byte[1024*5]; URL url; try { url = new URL(" http://localhost:8080/axis2/services/Axis2SampleDocLitService"); HttpURLConnection urlCon = (HttpURLConnection)url.openConnection(); urlCon.setDoOutput(true); urlCon.setRequestMethod("POST"); urlCon.setUseCaches(false); urlCon.setRequestProperty("Content-Type", "text/xml"); String outstr = "<?xml version='1.0' encoding='UTF-8'?>" + "<soapenv:Envelope xmlns:soapenv=\" http://schemas.xmlsoap.org/soap/envelope/\"><soapenv:Header /><soapenv:Body><echoString xmlns=\" http://userguide.axis2.apache.org/Axis2SampleDocLit\"><echoStringParam xmlns=\"http://userguide.axis2.apache.org/xsd\ ">ECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRINGECHOSTRING</echoStringParam></echoString></soapenv:Body></soapenv:Envelope>"; urlCon.getOutputStream().write(outstr.getBytes()); urlCon.getOutputStream().flush(); int count = 0; if (urlCon.getResponseCode() != java.net.HttpURLConnection.HTTP_OK) { System.err.println ("--------------ERROR---------------------------"); ByteArrayOutputStream out = new ByteArrayOutputStream(); count = urlCon.getInputStream().read(buffer); while (count > 0) { out.write(buffer, 0, count); count = urlCon.getInputStream().read(buffer); } System.err.println(out.toString()); System.err.println ("--------------ERROR---------------------------"); throw new java.lang.RuntimeException("Reponse err: server reponse code is " + urlCon.getResponseCode()); } ByteArrayOutputStream out = new ByteArrayOutputStream(); count = urlCon.getInputStream().read(buffer); while (count > 0) { System.out.println("---count -----" + count); out.write(buffer, 0, count); count = urlCon.getInputStream().read(buffer); } if (out.toString().toLowerCase().indexOf("fail") > -1) { throw new RuntimeException("Response err: soap err message is returned"); } } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } When I set the buffer size is 1024*1 , readed count will be : ---count -----32 ---count -----1024 ---count -----638 buffersize is 1024*2 , The output is : ---count -----27 ---count -----1667 buffersize is 1024*3 ,output will be : ---count -----32 ---count -----1662 Regards Jim On 12/12/06, Oleg Kalnichevski <[EMAIL PROTECTED]> wrote:
On Tue, 2006-12-12 at 11:55 +0800, jim ma wrote: > > Can anyone shed some light on this ? > Jim, HttpCore uses 2048 byte chunks per default and as far as I know Axis2 SimpleHttpServer does not override this default behavior. http://jakarta.apache.org/httpcomponents/httpcore/jakarta-httpcore/xref/org/apache/http/io/ChunkedOutputStream.html#132 I simply do not see a way for HttpCore to produce content chunks less then 2048. Please give me a little more details how to reproduce the problem locally. Oleg > On 12/8/06, jim ma < [EMAIL PROTECTED]> wrote: > Hi all , > > I think this is a bug maybe introduced by > jakarta-httpcore-4.0-alpha2. When enable the chunk mode for > StringEntity , client will read 28 bytes each time . Client > will read many times when a large payload response returned . > This definitely affects Aixs2's performance. > > Axis2 need to set chunk buffersize for HttpCore before > invoking StringEntity.setChunk(true) ? > > Regards > > Jim > > > On 12/5/06, jim ma < [EMAIL PROTECTED]> wrote: > Hi all , > > I downloaded the aixs2 1.1 std kit and tried a simple > sample contains one operation: echoString() . After I > deployed the service in repository and launch the > server with axis2server.I wrote the following code to > send the payload to aixs2server and soap response : > > httpCon.getOutputStream().write(payload); > httpCon.getOutputStream().flush(); > byte[] buffer = new byte[1024]; > count = httpCon.getInputStream().read(buffer); > while (count > 0) { > System.out.println ("---readed----" + count); > count = httpCon.getInputStream ().read(buffer); > } > > I found the thing confused me : each time it only can > read 28 bytes from inputStream . Large size respsone > will be readed many times. But I deployed it into > tomcat , It will read 1024 bytes each time. > > Which line code in Artix2 1.1 cause this ? > > Thanks > > Jim > > > > > > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]