You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by teo <fa...@yahoo.com> on 2003/01/12 18:37:39 UTC

complaints from Java2WSDL for attachments sample

hi all,
when I tried to produce wsdl file from the sample/attachments/EchoAttachmentsService, I got this:
 java -cp .:$CLASSPATH$ org.apache.axis.wsdl.Java2WSDL -o rmcpservice.wsdl  -l"http://community.ucs.indiana.edu:8080/axis/services/MyRmCpService" -n  "urn:Rcp1" -p"remote_copy" "urn:Rcp1"  remote_copy.FileCopyService


- The class org.w3c.dom.Document does not contain a default constructor, which is a requirement for a bean class.  The class cannot be converted into an xml schema type.  An xml schema anyType will be used to define this class in the wsdl file.
- The class java.lang.Exception is defined in a java or javax package and cannot be converted into an xml schema type.  An xml schema anyType will be used to define this class in the wsdl file.


can anybody help me out? Since, I am new to Axis, and it is supposed to work...I have seen some people saying that they were able to run the sample, but I could not.. I am using Tomcat 4.18 with axis 1.0..

thanks alot inadvance...

regards,

teo

 
 
 
 teo <fa...@yahoo.com> wrote:
hi everybody,

I checked the attachments/samples and I could not see the code for the service side.... 

I am trying to send a file to my web service and save it over there.... In my client, 

Service service = new Service(); //A new axis Service.

Call call = (Call) service.createCall();
call.setTargetEndpointAddress(new URL(sServiceAddress)); 

call.setOperationName("saveToDir");

MessageFactory mf = MessageFactory.newInstance();
SOAPMessage message = mf.createMessage();
FileDataSource n = new FileDataSource(new File(sSrcDir));
DataHandler dh = new DataHandler(n);
//message.addAttachmentPart(message.createAttachmentPart(dh));
Object ret = call.invoke(new Object[] {dh, sDestDir}); 

In my service code:

 public String saveToDir(javax.activation.DataHandler dh, String sPath) 

 {
    try
    {
           dh.writeTo(new FileOutputStream(sPath));

    }

   catch().....

}

 

can anybody please help me? If I use Attachments or Message class(org.apache.axis.Message), I can not generate wsdl file, it complaints that "there is no default constructor in class Attachments or Message"...If I use, AttachmentPart, then I am getting the same complaint "there is no default constructor...."...

Can anybody please help me the way how to send and receive attachment via Axis?

I really appreciated any help...

thanks,

teo

 



---------------------------------
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!


---------------------------------
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!