Preston,

is this streaming code supposed to work against the Bonsai test server?

I have a linux box running the 7.0.3 beta, and get headers only returned.
I tested against your servers as well; I am getting the following url for
one of the messages in the demo2 account on your server, but only receive
the http headers (obviously, session id will differ)

http://151.155.5.234:7191/attachment...0.0.1.0.1%4030

HTTP/1.1 400
Date: Fri, 30 Nov 2007 12:13:46 GMT
Server: Linux GroupWise POA 7.5
Content-Type: text/html
Pragma: no-cache

Thanks,
Johan

PS. Interesting to note is the fact that the web server headers announce
"7.5", but the soap userlogin returns "8.0.0 Beta" in the gwVersion property



"Preston Stephenson" <PStephenson@gw.novell.com> wrote in message
news:473D33F1.07F1.0037.1@gw.novell.com...
>I don't think there is a public 7.0.2 HP build that has the HTTP streaming
> code.
> You will have to use 7.0.3 or Bonsai.
> I've included some java code I used to test the streaming of attachments.
>
> if ( e.getActionCommand().equalsIgnoreCase( "Attachments" ) ) {
> AttachmentInfo info;
> AttachmentItemInfo[] items;
> FileOutputStream out;
> int i;
> int len;
> int offset;
> int size;
> String temp = "http://137.65.15.137:7291/attachment?session=";
>
> info = m_item.getAttachments();
> items = info.getAttachment();
> for ( i = 0; i < items.length; i++ ) {
> str = temp + m_main.getSessionId() + "&id=" +
> items[i].getId().get_value();
> size = (int)items[ i ].getSize();
> offset = 0;
> try {
> URL url = new URL( str );
> HttpURLConnection huc = (HttpURLConnection)url.openConnection();
> InputStream is = huc.getInputStream();
> byte[] b = new byte[ 16384 ];
> out = new FileOutputStream( new File( "c:\\temp", items[
> i ].getName()
> ) );
> System.out.println( "Start: " + new Date().toString() );
> while ( size > 0 ) {
> len = is.read( b, 0, 16384 );
> if ( -1 == len ) {
> break;
> }
> out.write( b, 0, len );
> offset += len;
> size -= len;
> }
> out.flush();
> out.close();
> out = null;
> System.out.println( "End: " + new Date().toString() );
> } catch ( Exception ex ) {
> ex.printStackTrace();
> break;
> }
> }
> }
>
>
> Preston
>
>>>> On Thursday, November 15, 2007 at 8:38 PM, leek<angle4781@163.com>

> wrote:
>> Hi everyone,
>>
>> After I retrieve attachment id , I want use this attachment id to
>> retrieve

>
>> attachment by http, how to configure my environment and how to develop by

>
>> java?
>> Anyone who tried this way can help me ?
>>
>> thanks
>> leek