Skip to main content

Deprecated method

1 reply [Last post]
yuki78
Offline
Joined: 2006-11-15
Points: 0

Hello,
I'm trying to update my code removing deprecated methods "newAdvertisement".

I wrote:

XMLDocument DOC =(XMLDocument)

StructuredDocumentFactory.newStructuredDocument(new MimeMediaType("text/xml"),is);

Advertisement adv = AdvertisementFactory.newAdvertisement(DOC);

But the code gave me an error and didn't read the pipe.

Can you say me where I made a mistrake, please???
Thank you very much.
Anna

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
stedob
Offline
Joined: 2006-10-20
Points: 0

You did not specify what the error was, but here is an example that works for me:

[b]FileInputStream fis = new FileInputStream(pipeAdvFile);

XMLDocument pipeAdvXML = (XMLDocument)StructuredDocumentFactory.newStructuredDocument(MimeMediaType.XMLUTF8, fis);

PipeAdvertisement pipeAdv = (PipeAdvertisement)AvertisementFactory.newAdvertisement(pipeAdvXML);[/b]