Re: Axis 2: Creating SOAP body from SAX driver

2006-08-17 Thread Davanum Srinivas

The other alternative is to use OMDataSource, keep the streaming
straight to output in the 3 serialize methods and use the code in
JaxmeDataBindingTemplate only for the getReader() method. this way you
will have the best of both worlds. When the engine needs an om object
it will call getReader() and otherwise call the serialize methods.

http://ws.apache.org/commons/axiom/apidocs/org/apache/axiom/om/OMDataSource.html

thanks,
-- dims

On 8/17/06, Jochen Wiedmann <[EMAIL PROTECTED]> wrote:

Davanum Srinivas wrote:

> See, the problem is *IF* you need to secure the soap message, this
> will fail since with this hack, you are just writing it to the
> outputstream.

Understood, but that's the point in streaming, isn't it?

In practice, I do, of course, provide as much objects as possible. For
example, I'd open a file, which I want to return as a stream. But the
possibility of an IOException in the middle of the stream would
remain.


Thanks,

Jochen

--
My wife Mary and I have been married for forty-seven years and not
once have we had an argument serious enough to consider divorce;
murder, yes, but divorce, never.
(Jack Benny)

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Davanum Srinivas : http://www.wso2.net (Oxygen for Web Service Developers)

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Axis 2: Creating SOAP body from SAX driver

2006-08-17 Thread Jochen Wiedmann

Davanum Srinivas wrote:


See, the problem is *IF* you need to secure the soap message, this
will fail since with this hack, you are just writing it to the
outputstream.


Understood, but that's the point in streaming, isn't it?

In practice, I do, of course, provide as much objects as possible. For
example, I'd open a file, which I want to return as a stream. But the
possibility of an IOException in the middle of the stream would
remain.


Thanks,

Jochen

--
My wife Mary and I have been married for forty-seven years and not
once have we had an argument serious enough to consider divorce;
murder, yes, but divorce, never.
(Jack Benny)

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Axis 2: Creating SOAP body from SAX driver

2006-08-16 Thread Davanum Srinivas

See, the problem is *IF* you need to secure the soap message, this
will fail since with this hack, you are just writing it to the
outputstream.

-- dims

On 8/16/06, Jochen Wiedmann <[EMAIL PROTECTED]> wrote:


Davanum Srinivas wrote:

 > plz see the snippets in JaxmeDatabindingTemplate.xsl

Are you referring to the toOM method? But that's not exactly streaming,
isn't it? It simply converts the SAX drivers output into a (possibly
large) OM tree?

In the meantime, I've found a solution, which I personally do consider
better:

   return new OMElementImpl(qName, null, pCommands.getOMFactory()){
 protected void internalSerialize(XMLStreamWriter pWriter,
   boolean pCache) throws XMLStreamException {
if (pCache) {
   throw new IllegalStateException("Caching isn't implemented.");
 }
 // Fire the SAX drivers output into pWriter here
 ...
 }
   };


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Davanum Srinivas : http://www.wso2.net (Oxygen for Web Service Developers)

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Axis 2: Creating SOAP body from SAX driver

2006-08-16 Thread Jochen Wiedmann


Davanum Srinivas wrote:

> plz see the snippets in JaxmeDatabindingTemplate.xsl

Are you referring to the toOM method? But that's not exactly streaming, 
isn't it? It simply converts the SAX drivers output into a (possibly 
large) OM tree?


In the meantime, I've found a solution, which I personally do consider 
better:


  return new OMElementImpl(qName, null, pCommands.getOMFactory()){
protected void internalSerialize(XMLStreamWriter pWriter,
  boolean pCache) throws XMLStreamException {
if (pCache) {
  throw new IllegalStateException("Caching isn't implemented.");
}
// Fire the SAX drivers output into pWriter here
...
}
  };


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Axis 2: Creating SOAP body from SAX driver

2006-08-16 Thread Martin Gainty
Great example

with regards tp XSLT processor ..Is there a way to specify the XSLT processor 
or is that hardcoded somewhere?
(I thought it might be an option for BeanWriter?)

Thanks,
M-
*
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.



- Original Message - 
From: "Davanum Srinivas" <[EMAIL PROTECTED]>
To: 
Sent: Wednesday, August 16, 2006 8:29 AM
Subject: Re: Axis 2: Creating SOAP body from SAX driver


> Jochen,
> 
> plz see the snippets in JaxmeDataBindingTemplate.xsl
> 
> -- dims
> 
> On 8/16/06, Jochen Wiedmann <[EMAIL PROTECTED]> wrote:
>>
>> Hi,
>>
>> as I read the Axis 2 implementation (AbstractInOutSyncMessageReceiver),
>> it allows to stream a response, if the response can be "pulled". In
>> other words, if the response object behaves like an InputStream.
>>
>> Unfortunately, in my case this is not an option. I have an object, which
>> can only push. For example, imagine an XMLFilter or SAX driver.
>>
>> Is it possible to stream a response in that manner? In other words,
>> obtain an XMLWriter to which the body may be written?
>>
>> Thanks,
>>
>> Jochen
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> 
> -- 
> Davanum Srinivas : http://www.wso2.net (Oxygen for Web Service Developers)
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

Re: Axis 2: Creating SOAP body from SAX driver

2006-08-16 Thread Davanum Srinivas

Jochen,

plz see the snippets in JaxmeDataBindingTemplate.xsl

-- dims

On 8/16/06, Jochen Wiedmann <[EMAIL PROTECTED]> wrote:


Hi,

as I read the Axis 2 implementation (AbstractInOutSyncMessageReceiver),
it allows to stream a response, if the response can be "pulled". In
other words, if the response object behaves like an InputStream.

Unfortunately, in my case this is not an option. I have an object, which
can only push. For example, imagine an XMLFilter or SAX driver.

Is it possible to stream a response in that manner? In other words,
obtain an XMLWriter to which the body may be written?

Thanks,

Jochen


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Davanum Srinivas : http://www.wso2.net (Oxygen for Web Service Developers)

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Axis 2: Creating SOAP body from SAX driver

2006-08-15 Thread Jochen Wiedmann


Hi,

as I read the Axis 2 implementation (AbstractInOutSyncMessageReceiver), 
it allows to stream a response, if the response can be "pulled". In 
other words, if the response object behaves like an InputStream.


Unfortunately, in my case this is not an option. I have an object, which 
can only push. For example, imagine an XMLFilter or SAX driver.


Is it possible to stream a response in that manner? In other words, 
obtain an XMLWriter to which the body may be written?


Thanks,

Jochen


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]