axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [jira] Commented: (AXIS-1283) can't use mime:multipartRelated in wsdl:output element of a wsdl:operation
Date Sat, 03 Apr 2004 18:22:54 GMT
The following comment has been added to this issue:

     Author: Davanum Srinivas
    Created: Sat, 3 Apr 2004 10:22 AM
If you are looking for "valid" wsdl's for MIME and DIME that WSDL2Java understands...Here
they are:

Note that the WSDL2Java does not generate code with DataHandlers...Which is a problem...

-- dims
View this comment:

View the issue:

Here is an overview of the issue:
        Key: AXIS-1283
    Summary: can't use mime:multipartRelated in wsdl:output element of a wsdl:operation
       Type: Bug

     Status: Unassigned
   Priority: Major

    Project: Axis
             WSDL processing

   Reporter: Bill Bug

    Created: Sat, 3 Apr 2004 7:41 AM
    Updated: Sat, 3 Apr 2004 10:22 AM
Environment: Mac OS v10.3.3(Darwin v7.3), Tomcat v5.0.19

I'm having trouble creating an appropriate WSDL file to make a service returning a large set
of binary attachments.

Neither Java2WSDL nor WSDL2Java appear to be ready to process with the markup for MIME attachments
that should reside within the wsdl:output element of a wsdl:operation in the wsdl:binding
section of a WSDL file.

I've been trying to combine what I could pull from the documentation on WSDL2Java with the
info in the very useful article:

Web services programming tips and tricks: SOAP attachments with JAX-RPC

So far, I've not been successful.

I've got an original implementation using SAAJ that works, but the code is much more complicated
than it would be had I used JAX-RPC attachments as described in the article listed above.

I created a very simple Interface that I ran through Java2WSDL to create my WSDL file.

The Interface is as follows:

import java.rmi.Remote;
import java.rmi.RemoteException;

 * @author  billbug
public interface IRepositoryAccess extends Remote  {
        public DataHandler[] getImages(Boolean returnZip, String imageSet) throws RemoteException;

I assumed extrapolating from the article above that I could have a return type of DataHandler[]
to return a collection of attached files.

The WSDL generated from this interface is all exactly as I'd expect it to be - except in the
wsdl:output element created within the wsdl:operation element for my function call within
the wsdl:binding section of the WSDL.
Unfortunately, all I get is:

	 <wsdl:output name="getImagesResponse">
		<wsdlsoap:body namespace="urn:RepositoryAccessService" use="encoded"/>

According to the article, it should look something like this:

         <wsdl:output name="getImagesResponse">
        			<mime:part name="part1">
          			<wsdlsoap:body encodingStyle="" namespace="urn:RepositoryAccessService"
          		<mime:part name="part2">
          			<mime:content part="output" type="application/octetstream"/>

included in the wsdl:definitions element at the top of the WSDL.

Basically, it's a multipart MIME message, where the first part is the body of the SOAP response
message, the the additional part(s) are the attached binary files.

If I add in the mime:multipartRelated as given above into the wsdl:output element, then try
to run WSDL2Java, I get the following error:

java org.apache.axis.wsdl.WSDL2Java --output "gen" --deployScope "Application" --server-side
--skeletonDeploy --verbose RepositoryAcess.wsdl
        at org.apache.axis.wsdl.symbolTable.SymbolTable.addMIMETypes(
        at org.apache.axis.wsdl.symbolTable.SymbolTable.fillInBindingInfo(
        at org.apache.axis.wsdl.symbolTable.SymbolTable.populateBindings(
        at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(
        at org.apache.axis.wsdl.symbolTable.SymbolTable.add(
        at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(
        at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(
        at org.apache.axis.wsdl.gen.Parser$

I peaked into the source for org.apache.axis.wsdl.symbolTable.SymbolTable.  At line 2084 where
it's hitting a NullPointerException, it is in the function addMIMETypes as indicated above.
 Here's a snippet from that function:

     * Add the parts that are really MIME types as MIME types.
     * A side effect is to return the body Type of the given
     * MIMEMultipartRelated object.
    private Use addMIMETypes(BindingEntry bEntry, MIMEMultipartRelated mpr,
            Operation op) throws IOException {
        Use bodyType = Use.ENCODED;
        List parts = mpr.getMIMEParts();
        Iterator i = parts.iterator();
        while (i.hasNext()) {
            MIMEPart part = (MIMEPart);
            List elems = part.getExtensibilityElements();
            Iterator j = elems.iterator();
            while (j.hasNext()) {
                Object obj =;
                if (obj instanceof MIMEContent) {
                    MIMEContent content = (MIMEContent) obj;
                    TypeEntry typeEntry = findPart(op, content.getPart());
line:2084-->String dims = typeEntry.getDimensions();
                    if(dims.length() <=0 && typeEntry.getRefType() != null) {
                        Node node = typeEntry.getRefType().getNode();
                            dims += "[]";
                    String type = content.getType();
                    if(type == null || type.length() == 0)
                        type = "text/plain";
                    bEntry.setMIMEInfo(op.getName(), content.getPart(), type, dims);

As best I figure from this code, the typeEntry object is null, probably because content.getPart()
returns null or an invalid value.

I'm pretty certain I've got the wsdl:output MIME syntax in the WSDL very close.  The part
I think is wrong is the line:

	<mime:content part="output" type="application/octetstream"/>

The 'part="output" is probably the offending piece.  The article I'm using as my example describes
how to create a WSDL for a function that accepts an attachment as an input parameter, not
one that returns an attachment.  I'm also trying to attach several files, not just a single
file.  It seems I ought to have to specify I'm returning an array of attachments somewhere
in the mime:content element.

I've been to the World-Wide Web consortium site to look over the WSDL v1.2 specification.
 There's very little info contained in the section on MIME multi-part messages:
There's really nothing here that goes much beyond the original article I site above.

It would be really a big leap forward if Java2WSDL & WSDL2Java could handle MIME attachments
as deftly as it does almost every other aspect of a JAX-RPC payload.

Bill Bug

Bill Bug
Senior Analyst/Ontological Engineer

Laboratory for Bioimaging  & Anatomical Informatics
Department of Neurobiology & Anatomy
Drexel University College of Medicine
2900 Queen Lane
Philadelphia, PA	19129
215 991 8430 (ph)

This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:

If you want more information on JIRA, or have a bug to report see:

View raw message