Hi,
Seems to me from the code in org.apache.axis.Message that maybe you don't have activation.jar in your classpath, and so attchments are not available (I don't actually have a line 639 in Message.java but assume the error is that the mAttachments field is null, and seems to be caused by the absence of attachement support).
Snippet from org.apache.axis.Message.java
// Try to construct an AttachmentsImpl object for attachment
// functionality.
// If there is no org.apache.axis.attachments.AttachmentsImpl class,
// it must mean activation.jar is not present and attachments are not
// supported.
if (isAttachmentSupportEnabled(getMessageContext())) {
// Construct one, and cast to Attachments.
// There must be exactly one constructor of AttachmentsImpl, which
// must take an org.apache.axis.Message!
Constructor attachImplConstr = attachImpl.getConstructors()[0];
try {
mAttachments = (Attachments) attachImplConstr.newInstance(
new Object[] { initialContents,
contentType, contentLocation});
For me, the samples worked just fine, hope this helps,
Diego
-----Original Message-----
From: Carbone Cedric [mailto:[EMAIL PROTECTED]]
Sent: Martes 30 de Diciembre de 2003 06:10
To: [EMAIL PROTECTED]
Subject: RE: Problem with the sample Attachment (Axis Java)
Thank you Rick for your answer.
So, I don't spend time about WSDL generation, this is no a big problem for
my project.
But, I want to run the Axis Attachment sample !!!
1) Do you know how use the example? For example, is the following call is
correct ? (proper argument?)
java samples.attachments.EchoAttachment C:/web.jpg
2) If yes, why axis returns to me a NullPointerException
at
samples.attachments.EchoAttachment.echoUsingSAAJ(EchoAttachment.java:523)
???
3) In this same file, at line 239
[call.setScopedProperty(HTTPConstants.REQUEST_HEADERS, myhttp);]
is the method setScopedProperty() exist really ? (no present in the
JavaDoc??)
Thanks again,
Cedric
-----Message d'origine-----
De : Rick Kellogg [mailto:[EMAIL PROTECTED]]
Envoye : lundi 29 decembre 2003 18:06
A : [EMAIL PROTECTED]
Objet : RE: Problem with the sample Attachment (Axis Java)
Cedric,
According to the following article, WSDL does not support the use of
attachments. That feature will be adding in the WS-I Basic Profile 1.1
which is still under development.
http://webservices.xml.com/pub/a/ws/2003/09/16/wsbp.html
I am not sure as to the current status of attachments as it relates to WSDL
in Axis 1.1.
Just some info to help prevent lost time. Take care,
Rick
-----Original Message-----
From: Carbone Cedric [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 29, 2003 11:43 AM
To: [EMAIL PROTECTED]
Subject: Problem with the sample Attachment (Axis Java)
Hi all,
I have problems with Attachment sample in Axis 1.1 (Java).
For 3 days I have spent with the Attachment sample, I don't arrive to run it
:((
I need your help.
I saw on the mailling list the problem about namespace. According to an
message of november on your mailinglist, I have deleted the namespace (in
the WSSD file) and thanks this, Axis autogenerates the WSDL without
SOAPException (good).
However, the sample don't run I have now java.lang.NullPointerException !
So, I run the sample using C:\>java samples.attachments.EchoAttachment
C:/web.jpg
(The binary file C:/web.jpg exists)
Now this is the response
java.lang.NullPointerException
java.lang.NullPointerException
at org.apache.axis.Message.createAttachmentPart(Message.java:638)
at
javax.xml.soap.SOAPMessage.createAttachmentPart(SOAPMessage.java:243)
at
samples.attachments.EchoAttachment.echoUsingSAAJ(EchoAttachment.java:523)
at samples.attachments.EchoAttachment.main(EchoAttachment.java:362)
So I bug at line 523 of EchoAttachment.java when I create an AttachmentPart
!
javax.xml.soap.AttachmentPart attachment =
soapMessage.createAttachmentPart(dataHandler);
Finally, I want to debug this file but I can't because I don't arrive to
compil the source EchoAttachment.java.
javac EchoAttachment.java
EchoAttachment.java:239: cannot resolve symbol
symbol : method setScopedProperty (java.lang.String,java.util.Hashtable)
location: class org.apache.axis.client.Call
call.setScopedProperty(HTTPConstants.REQUEST_HEADERS, myhttp);
org.apache.axis.client.Call API
[http://ws.apache.org/axis/java/apiDocs/org/apache/axis/client/Call.html]
Call don't support a method called setScopedProperty(String, Hashmap)
Futhermore, org.apache.axis.client.Call implements the interface
javax.xml.rpc.Call
http://ws.apache.org/axis/java/apiDocs/javax/xml/rpc/Call.html
This interface don't support a method called setScopedProperty(String,
Hashmap)
... I don't understand this (pechaps a depreciated method in AXIS 1.1 ??)
Thank you in advance for your help... I'm completlty lost.
Cedric
NeoPost
http://www.portalsociete.com
Vis�tenos, lo estamos esperando.
============================================================
La informaci�n aqu� contenida es confidencial y est� dirigida
solamente a las personas direccionadas en el mail.
No debe ser considerada como recomendaci�n de compra o venta
de valores. Todo acceso no autorizado, uso, reproducci�n, o
divulgaci�n est� prohibido.
Ni SOCIETE GENERALE ni ninguna de sus subsidiarias o filiales
asumir�n responsabilidad ni obligaci�n legal alguna por cualquier
informaci�n incorrecta o alterada contenida en este mensaje.
The information contained herein is confidential and is intended
solely for the addressee(s). It shall not be construed as a
recommendation to buy or sell any security. Any unauthorized
access, use, reproduction, disclosure or dissemination is prohibited.
Neither SOCIETE GENERALE nor any of its subsidiaries or affiliates
shall assume any legal liability or responsibility for any incorrect,
misleading or altered information contained herein.
============================================================
