• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

To pass file object to webservice

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Read the file and pass it a bytes argument
 
Pradeep bhatt
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Gatty,

Read this IBM article

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

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic