Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Automatically generated WSDL file of attachment sample fully interoperable?  RSS feed

 
Bernhard Pauler
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!

I want/need to develop a web service that accepts a file.

After I got a little familiar with Axis I searched for articles about passing files to web services.
I stumbled across the following IBM developerWorks article:

"Web services programming tips and tricks: SOAP attachments with JAX-RPC"
http://www.ibm.com/developerworks/webservices/library/ws-tip-soapjax.html

After that I checked out the EchoAttachment sample of the latest Axis release (1.4).
After deploying it I looked at the automatically generated WSDL file and was a little bit irritated...

The type of the parameter of the echo function is declared as DataHandler in the WSDL file. There is nothing to be found in the WSDL file about MIME like in the mentioned IBM article.
It looks to me like DataHandler will constrain the use of the web service to Java users because DataHandler is only known in the Java space - or am I missing something here?

Cheers,

Bernhard Pauler
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Bernhard Pauler:
After deploying it I looked at the automatically generated WSDL file and was a little bit irritated
... - or am I missing something here?


The article that you quoted starts with a WSDL and generates the needed Java (WSDL2Java). The use of javax.activation.DataHandler is simply the Java-centric way of dealing with MIME types.

You apparently did the opposite. You started with the Java-implementation and expected to "automatically" be able generate an interoperable WSDL (Java2WSDL).

When is comes to designing SOAP web service interfaces WSDL is the lingua franca - not an interface specification in some platform specific programming language. So WSDL2Java should be the primary tool. Java2WSDL is merely a convenience that may have the tendency to produce Java-centric WSDL. Apparently it wasn't worth while in Java2WSDL to detect that the use of a DataHandler probably meant that an exchange of SOAP attachments is taking place. Furthermore the Java code may not contain enough information to exactly describe the MIME types that need to be mentioned in the WSDL - so Java2WSDL did the best it could.

Between the article and your own experiments you should have enough information to cobble together your own SOAP Attachment WSDL that WSDL2Java will translate into the Java interface that you are looking for.
 
Bernhard Pauler
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for your very fast and meaty reply.

I am surprised because this is the WSDL file created from the "official" Axis example for attachments (accessible under http://localhost:8080/axis/services/urn:EchoAttachmentsService?wsdl). :roll:

Bernhard
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!