This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Web Services and the fly likes Is it possible to make Streaming with webservices Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Is it possible to make Streaming with webservices" Watch "Is it possible to make Streaming with webservices" New topic
Author

Is it possible to make Streaming with webservices

Ould Nadif
Ranch Hand

Joined: Jan 21, 2004
Posts: 184
Hi all,

Is it possible to make Streaming with webservices using apache Axis(I prefer) or others engine else.

I have a video/audio file that I would like to brodcast to several client as a webservice.

Thank in advance for your help

ould nadif


We are ones that build the world, thus build it well.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41635
    
  55
No. Web services are a total misfit for streaming. Look at the protocols used by QuickTime Streaming, Real or Windows Media Player.


Ping & DNS - my free Android networking tools app
Ould Nadif
Ranch Hand

Joined: Jan 21, 2004
Posts: 184
Thank you for your help. But I find out on the google that ther is JSR 173: Streaming API for XML. for details: http://jcp.org/en/jsr/detail?id=173
What is its aim. Does it do streaming.

Here is that i found on the internet :

The goal of this API is to develop APIs and conventions that support processing XML as a stream. The specification will address three main areas:

Develop APIs and conventions that allow a user to programmatically pull parse events from an XML input stream.
Develop APIs that allow a user to write events to an XML output stream.
Develop a set of objects and interfaces that encapsulate the information contained in an XML stream.
The specification should be easy to use, efficient, and not require a grammar. It should include support for namespaces, and associated XML constructs. The specification will make reasonable efforts to define APIs that are "pluggable".


Non-goals of this specification include:

Specifying a validation API. Validation will be done in the layer above the streaming parser. This does not preclude passing validation parameters to an underlying parser.
Specific dependence on an XML grammar.
Support for applications that transform or edit a DTD.


I assure you i am still confused although i read all these articles.

ould nadif
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2922
    
    5
StAX is an alternate model for XML Document parsing/creation - i.e. it's an alternative to SAX (which uses parsing events) and DOM (which uses a Document Object Model to query and manipulate the XML document). The "Streaming" refers to the document parsing/creations style that it uses. While it can be used in the implementation of web services (and it is used in Axis 2.* and JWSDP 2.*) it has no effect on what a web service can consume or emit - it has got nothing to do with streaming media.
An Introduction to StAX
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41635
    
  55
Obviously we're talking about different kinds of streaming - are you talking about streaming XML or streaming media content?
Ould Nadif
Ranch Hand

Joined: Jan 21, 2004
Posts: 184
Hi all,

The media is in the XML document. I was talking about streaming XML. Seeing that the media is in the XML document as a xsi:type="xsd:base64Binary. I think it is the same as media content.

Here is what I found out on the axis web site :
http://ws.apache.org/xmlrpc/faq.html#streaming_mode

How do I enable streaming mode?
Set the property "enabledForExtensions". Note, that enabling the streaming mode doesn't mean, that all responses are served in streaming mode. It depends on the clients:

If a client sends a content-length header, then the server assumes, that the client is a traditional XML-RPC application and doesn't support the vendor extensions from Apache XML-RPC. Consequently, the server assumes, that it needs to set the content-length header itself and disables the streaming mode for that particular request.
However, if the client doesn't send a content-length header, then the server assumes that it will be able to accept any standard HTTP/1.1 request and enable the streaming mode. Streaming mode means, in particular, that the response will not contain a content-length header.


What does it mean streaming mode ?

Thank you in advance for your help.

Ould Nadif
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2922
    
    5
Originally posted by Ould Nadif:
Streaming mode means, in particular, that the response will not contain a content-length header.

What does it mean streaming mode?

It means nothing more than that the client is not relying on the information in the the HTTP content header to figure out who long the HTTP response is. So it's the HTTP response that is being "streamed".

You can only start processing on the client side once the entire SOAP response (which contains all the XML data) has been received (and possibly validated).

The "streaming" here is for the benefit of the server so that it can start the transmission of the response before it is in a position to know what the total length of the response is - this can potentially shorten the delay between the end of the client request and the beginning of the the server response.
Ould Nadif
Ranch Hand

Joined: Jan 21, 2004
Posts: 184
Thank you very much to everybody for your help.
Your different advise has been very usefull.

ould nadif
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Is it possible to make Streaming with webservices