• Post Reply Bookmark Topic Watch Topic
  • New Topic

To pass file object to webservice

 
yathish Gatty
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
 
yathish Gatty
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
yathish Gatty
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Read the file and pass it a bytes argument
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Gatty,

Read this IBM article

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

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!