> -----Original Message-----
> From: Simon Nash [mailto:[email protected]]
> Sent: Monday, November 21, 2011 4:21 PM
> To: [email protected]
> Subject: Re: Dynamic service references ?
>
[snip]
> I strongly suspect that no-one has ever tried mixing XML serialization
> with authentication before.
>
> Would you be able to quickly try doing this with regular Java binary
> serialization of the service reference to see if the authentication
> problem
> occurs in this case as well?
>
> Thanks,
> Simon
I did try the following coding, which has the same problem:
@SuppressWarnings("unchecked")
private ServiceReference<T> copy2( ServiceReference<T> serviceRef, String uri )
throws Exception
{
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ObjectOutputStream out = new ObjectOutputStream( baos );
out.writeObject( serviceRef );
ObjectInputStream in = new ObjectInputStream( new ByteArrayInputStream(
baos.toByteArray() ) );
ServiceReference<T> copy = (ServiceReference<T>) in.readObject();
return copy;
}
Of course, ObjectOutputStream#writeObject() will implicitly also use XML,
because ServiceReference implements Externalizable.
Or did you have something else in mind?
-- Sebastian
IDS Scheer Consulting GmbH
Geschäftsführer/Managing Directors: Kamyar Niroumand, Ivo Totev
Sitz/Registered office: Altenkesseler Straße 17, 66115 Saarbrücken, Germany -
Registergericht/Commercial register: Saarbrücken HRB 19681
http://www.softwareag.com