Thanks again for your prompt reply and help,
streaming response sounds good but there is no way to do so in Axis2 I gues, if this could happens, it would be the best.
I impressed with Axis2's pull parsor since it does not creates an in memory tree but it throws XMLStreamException when response access 2000 rows:
org.apache.axis2.om.OMException
: javax.xml.stream.XMLStreamExceptionat org.apache.axis2.om.impl.llom.builder.StAXOMBuilder.next(StAXOMBuilder.java:203)
at org.apache.axis2.om.impl.llom.OMNodeImpl.build(OMNodeImpl.java:284)
at com.etilize.inquire.services.client.EchoBlockingClient.main(EchoBlockingClient.java:57)
Caused by: javax.xml.stream.XMLStreamException
at com.bea.xml.stream.MXParser.nextImpl(MXParser.java:1826)|
at com.bea.xml.stream.MXParser.next(MXParser.java:1249)
at org.apache.axis2.om.impl.llom.builder.StAXOMBuilder.next(StAXOMBuilder.java:163)
... 2 more
Exception in thread "main"
Axis2 might not capable of sending such junk to the stream or have bug.
Chunk module is like Iterator pattern where client send search query for products services add product references to the client session, the client codes are as :
srv.loadProducts(SearchElement);
srv.setBuffer(500);
while(srv.hasNext()){
Element p=srv.nextProducts();
.......
}
I ll appriciate if you help me implementing streaming output or resolve obove exception.
Thanks again.
With Warm Regards,
Muhammad Iqbal
MCIT, DCS, SCJP, MCP (.NET)
Software Engineer
Etilize Inc.
Cell#: 0092-300-9377801
From: "Ron Reynolds" <[EMAIL PROTECTED]>
Reply-To: [email protected]
To: [email protected]
Subject: Re: [axis2] How to control response Serialization
Date: Fri, 30 Sep 2005 16:35:16 -0700 (PDT)
>ah, that does complicate things. no serialized objects, that's for sure - only works when the client is java and has
>the same classes loaded locally. not familiar with the Chunk model but it sounds messy. so the assumption that seems
>to make sense is that the server is running out of memory while building the XML (or DOM) from the large object tree
>you want to return to the client. you can go with a non-XML approach to reduce the size of the response, but if just
>building the response takes down the server i would consider adding memory to that server because if you have
>simultaneous client requests (which is pretty normal in most server environments) then you're going to have that many
>more copies of the response to build. it all depends on what's causing the server to run out of memory - if it's the
>process of building a full in-memory copy of the response (i.e., if your response XML is so much larger than the
>original data object it's being built from) you might consider a way to start streaming the response to the client
>that doesn't require a full in-memory copy of the data. or you might consider exposing an interface to the data that
>doesn't require that you stream the whole thing (similar to the more granular API idea) - something like the way
>databases expose cursors to a dataset instead of returning the entire dataset in one monster response. or you could
>use a more compact, tho perhaps not binary, format for returning the data depending on how complex it is - for
>instance if it's many rows of data with no structures perhaps a comma-seperated sequence of rows would work.
>sorry i couldn't be of more help.
>................ron.
> >
> > Thanks a lot Ron.
> > Clients typically going to want the whole block as XML, i have implemented the Chunk model but its goes very slow.
> > What are other ways those can enable me to send Lacs of records to the client? Client may be PHP, .NET, Java etc.
> >
> > With Warm Regards,
> >
> > Muhammad Iqbal
> > Cell#: 0092-300-9377801
> > [EMAIL PROTECTED]
> > From: "Ron Reynolds"
> > Reply-To: [email protected]
> > To: [email protected]
> > Subject: Re: [axis2] How to control response Serialization
> > Date: Fri, 30 Sep 2005 14:52:31 -0700 (PDT)
> >>you might consider sending it as a binary attachment (never tried, only read about it) or, if you want to return it
> >>within the XML, you can first serialize the object tree into a byte[] and then Base64-encode it (which will make it a
> >>about 30% larger) and embed that into the XML as a very big block of text). or you might consider an approach other
> >>than web services for this particular call or breaking the API into smaller operatiosn (instead of returning one big
> >>lump of data perhaps it can be accessed in pieces - are clients typically going to want the whole block or just
> >> pieces
> >>of it?).
> >>
> >>...............ron.
> >>
> >> >
> >> > my web service returns a very huge result, that going to send to the client. when it retuns result it goes out of
> >> > memeory and slow performance. I my service should directly seririalize result to the output stream as in java
> >> servlet
> >> > e.g.; out.writel(myOMElement);
> >> >
> >> >
> >> >
> >> >
> >> > With Warm Regards,
> >> >
> >> > Muhammad Iqbal
> >> > MCIT, DCS, SCJP, MCP (.NET)
> >> > Etilize Inc.
> >> > Cell#: 0092-300-9377801
> >> > [EMAIL PROTECTED]
> >>
> >>
> >
>
>
