File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes To pass file object to webservice Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Web Services
Reply Bookmark "To pass file object to webservice" Watch "To pass file object to webservice" New topic
Author

To pass file object to webservice

yathish Gatty
Ranch Hand

Joined: Oct 05, 2004
Posts: 31
Hi,
I am able to run webservices passing data types like int,string.But when I pass data type like file object it is not able to create .wsdl file.It throws following warning.

"The class java.io.File 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."

Is there a way so that we can create a .wsdl file so that it takes file objects as a parameter to webserice.

with regards,

Yathish
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 32767
Is there a way so that we can create a .wsdl file so that it takes file objects as a parameter to webserice.


I don't know how anyType would work, but it sounds like it is just a warning, not an error.
Are you sure that File objects can be transported from machine to machine and still work? Try serializing a File object and see whether that works across machines (having the same OS, obviously).


Android appsImageJ pluginsJava web charts
yathish Gatty
Ranch Hand

Joined: Oct 05, 2004
Posts: 31
Hi,
This is able to create .wsdl and related class files from .wsdl file.
But when I try to access this webservice through ASP.net it is not able to call the related webservice.
It throws an error stating "Unable to import binding 'fileobjectSoapBinding'
from namespace 'urn:fileobject".Unable to import operation 'getFileObject'.
Schema with targetNamespace='http://net.jboss.org/jmx' has invalid syntax.
SimpleType content is missing.

with regards,

Yathish
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 11862
File objects are very much tied to a particular operating system/jvm and are meaningless in the web service context. You must redesign your application - exactly what are you trying to accomplish?
Bill


Java Resources at www.wbrogden.com
yathish Gatty
Ranch Hand

Joined: Oct 05, 2004
Posts: 31
Hi,
If I want to read a file through webservice how would I do it?
The senario is I have to upload a file using ASP(client) and read the file and do some functionalities using java.
Please suggest what would be the way to do so.

With regards,
Yathish
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8845

Read the file and pass it a bytes argument


Groovy
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8845

Hello Gatty,

Read this IBM article

http://www-128.ibm.com/developerworks/xml/library/x-tippass.html

 
 
subject: To pass file object to webservice
 
Threads others viewed
Transforming a flat file to XML file
Facade design pattern in web services
Web Service Request Validation against WSDL
Working With Complex Data Types
create wsdl in eclipse editor
MyEclipse, The Clear Choice

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture