If you go to the generated code, and you use 
MessageContext.getMessage..... there, you should get a value. 

But calling the generated method and then trying to get the MessageContext 
won't work.

James




"Dorner, Thomas" <[EMAIL PROTECTED]> 
01/04/2004 13:45
Please respond to
[EMAIL PROTECTED]


To
"'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
cc

Subject
AW: AW: MessageContext.getCurrentContext() returns null







oService is your Service or your locator (both are Service or extend
Service!)
--> read my text and think about! ;)

Forget the MessageContext - you can t make

MessageContext context = MessageContext.get....

if you use the stub and the skeleton!
I get also null from MessageContext


-----Ursprüngliche Nachricht-----
Von: Tony Thompson [mailto:[EMAIL PROTECTED]
Gesendet: Donnerstag, 1. April 2004 14:38
An: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Betreff: Re: AW: MessageContext.getCurrentContext() returns null


In your examples, what is "soapService" and "oService"?

Is it possible that my service is not deployed correctly and that is
why the current message context is null?

Thanks.
Tony

>>> [EMAIL PROTECTED] 04/01/04 02:37AM >>>
You can handle your attachment like this - without using the 
MessageContext

Object[] attachments = soapService.getAttachments();
AttachmentPart attachPart = (AttachmentPart) attachments[0];
AttachmentPart attachPart1 = (AttachmentPart) attachments[1];
 
DataHandler arrow = attachPart.getDataHandler();
DataHandler folder = attachPart1.getDataHandler();
 
File myFile1 = new File("C:\\temp\\" + attachPart.getContentId() +
".gif");
FileOutputStream myFOS1 = new FileOutputStream(myFile1);
arrow.writeTo(myFOS1);

....

Another solution can be - take your Service or Locator (also Service)
and get the AxisEngine --> then make
engine.getCurrentMessageContext()!?

AxisEngine engine = oService.getEngine();
engine.getCurrentMessageContext();

Thomas

-----Ursprüngliche Nachricht-----
Von: Tony Thompson [mailto:[EMAIL PROTECTED] 
Gesendet: Mittwoch, 31. März 2004 15:51
An: [EMAIL PROTECTED] 
Betreff: MessageContext.getCurrentContext() returns null


When I invoke MessageContext.getCurrentContext(), it returns null. 
Can
anyone explain why that might happen and how I can fix it?  I am
trying
to add a DIME attachment to a response and it is hard to do without a
MessageContext.

Thanks.
Tony


This email is intended solely for the use of the named addressee(s). Any 
unauthorised disclosure, copying or distribution of the confidential 
information contained therein, or the taking of any action based on it, is 
prohibited. The sender disclaims any liability for the integrity of this 
email. Legally binding declarations must be in written form.

Reply via email to