Good question. In a DIME version of my service, I continued with the same
signature as in my original mail:
public DataHandler fileReadAttach(AvakiPrincipal principal, String path,
long offset, int count)
throws RemoteException;
However, in the implementation, I made sure to set the attachment type to
DIME. As a result, when I write Axis clients, I can see that the attachment
format on the wire is _not_ MIME, but I can't tell whether or not it's
really valid DIME.
Why? you may ask. Well, I can't really write .NET clients that target this
WSDL because of the _same_ problem I had earlier in this thread. Axis sets a
type of apachesoap:DataHandler on these attachments and .NET won't even
swallow the WSDL much less construct a client so that I can test the
results.
As it turns out, it was DIME support that got me started on this thread.
Since .NET clients wouldn't swallow my DIMEd WSDLs, I started looking at the
MIMEd WSDLs. That's when I discovered the apachesoap:DataHandler type, which
I think is incorrect, and I suspect Anne agrees with me.
Anand
On Thu, 26 Aug 2004, Flores, Raul wrote:
: How can I support DIME in wsdl for both .NET and java?
:
: Raul
:
: -----Original Message-----
: From: Anne Thomas Manes [mailto:[EMAIL PROTECTED]
: Sent: Wednesday, August 25, 2004 8:58 PM
: To: [EMAIL PROTECTED]; 'Anand Natrajan'
: Subject: RE: What's the right WSDL for MIME?
:
:
: Btw -- WS-I just published the Attachments Profile [1].
:
: Here's an example of a correct WSDL description for document/literal
: binding. Note that Axis should not be using the apachesoap:dataHandler
: datatype. Also note that even though the binding is doc/literal, the
: MIME attachment message parts must be defined as types
: (type="xsd:base64binary") rather than as elements.
:
: <?xml version="1.0" encoding="utf-8" ?>
: <wsdl:definitions xmlns:types="http://example.com/mimetypes"
: xmlns:ref="http://ws-i.org/profiles/basic/1.1/xsd"
: xmlns:xsd="http://www.w3.org/2001/XMLSchema"
: xmlns:soapbind="http://schemas.xmlsoap.org/wsdl/soap/"
: xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
: xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
: targetNamespace="http://example.com/mimewsdl"
: xmlns:tns="http://example.com/mimewsdl">
:
: <wsdl:types>
: <xsd:schema targetNamespace="http://example.com/mimetypes"
: xmlns:xsd="http://www.w3.org/2001/XMLSchema">
:
: <xsd:import
: namespace="http://ws-i.org/profiles/basic/1.1/xsd"
: />
: <xsd:element name="ClaimDetail"
: type="types:ClaimDetailType"/>
: <xsd:complexType name="ClaimDetailType">
: <xsd:sequence>
: <xsd:element name="Name" type="xsd:string"/>
: <xsd:element name="ClaimForm" type="ref:swaRef"/>
: </xsd:sequence>
: </xsd:complexType>
: <xsd:element name="ClaimRefNo" type="xsd:string"/>
: </xsd:schema>
: </wsdl:types>
:
: <wsdl:message name="ClaimIn">
: <wsdl:part name="body" element="types:ClaimDetail"/>
: <wsdl:part name="ClaimPhoto" type="xsd:base64Binary"/>
: </wsdl:message>
:
: <wsdl:message name="ClaimOut">
: <wsdl:part name="out" element="types:ClaimRefNo"/>
: </wsdl:message>
:
: <wsdl:portType name="ClaimPortType">
: <wsdl:operation name="SendClaim">
: <wsdl:input message="tns:ClaimIn"/>
: <wsdl:output message="tns:ClaimOut"/>
: </wsdl:operation>
: </wsdl:portType>
:
: <wsdl:binding name="ClaimBinding" type="tns:ClaimPortType">
: <soapbind:binding style="document"
:
: transport="http://schemas.xmlsoap.org/soap/http"/>
: <wsdl:operation name="SendClaim">
: <soapbind:operation
: soapAction="http://example.com/soapaction"/>
: <wsdl:input>
: <mime:multipartRelated>
: <mime:part>
: <soapbind:body parts="body" use="literal"/>
: </mime:part>
: <mime:part>
: <mime:content part="ClaimPhoto"
: type="image/jpeg"/>
: </mime:part>
: </mime:multipartRelated>
: </wsdl:input>
: <wsdl:output>
: <soapbind:body use="literal" />
: </wsdl:output>
: </wsdl:operation>
: </wsdl:binding>
: </wsdl:definitions>
:
:
: [1] http://www.ws-i.org/Profiles/AttachmentsProfile-1.0-2004-08-24.html
:
: -----Original Message-----
: From: Anand Natrajan [mailto:[EMAIL PROTECTED]
: Sent: Wednesday, August 25, 2004 5:34 PM
: To: [EMAIL PROTECTED]
: Subject: What's the right WSDL for MIME?
:
: All,
:
: I have a web service implemented in Java using Axis. In this service, I
: have a method that takes some simple params and returns a single
: attachment. Following the Axis examples, I have defined the signature of
: this method as:
: public DataHandler fileReadAttach(AvakiPrincipal principal,
: String path,
: long offset, int count)
: throws RemoteException;
:
: Then, I use java2wsdl wrapped/literal to generate a WSDL for this. The
: relevant parts of the WSDL are as below:
: <element name="fileReadAttachResponse">
: <complexType>
: <sequence>
: <element name="fileReadAttachReturn"
: type="apachesoap:DataHandler"/>
: </sequence>
: </complexType>
: </element>
: ...
: <wsdl:operation name="fileReadAttach">
: <wsdlsoap:operation soapAction=""/>
: <wsdl:input name="fileReadAttachRequest">
: <wsdlsoap:body use="literal"/>
: </wsdl:input>
: <wsdl:output name="fileReadAttachResponse">
: <wsdlsoap:body use="literal"/>
: </wsdl:output>
: </wsdl:operation>
:
: Notice how the attachment refers to an apache:DataHandler element. This
: works without a problem when I write Java/Axis clients that target this
: service. However, .NET won't even swallow the WSDL because it does not
: recognise the apachesoap namespace.
:
: My question is: why isn't the generated WSDL something like:
: <wsdl:operation name="fileReadAttach">
: <wsdlsoap:operation soapAction=""/>
: <wsdl:input name="fileReadAttachRequest">
: <wsdlsoap:body use="literal"/>
: </wsdl:input>
: <wsdl:output name="fileReadAttachResponse">
: <mime:multipartRelated>
: <mime:part>
: <wsdlsoap:body parts="body"
: use="literal"/>
: </mime:part>
: <mime:part>
: <mime:content part="docs"
: type="text/plain"/>
: </mime:part>
: </mime:multipartRelated>
: </wsdl:output>
: </wsdl:operation>
: Seems to me that's how it should come out. How do I make it so?
:
: For giggles, I changed the WSDL by hand and tried to generate stubs for
: it. wsdl2java failed to do so, with a NullPointerException:
: [axis-wsdl2java] WSDL2Java
: /home/local/anand/System/Jabc/wsdl/MyServiceWithMIMEDocLit.wsdl
: [axis-wsdl2java] Running Wsdl2javaAntTask with parameters:
: [axis-wsdl2java] verbose:false
: [axis-wsdl2java] debug:false
: [axis-wsdl2java] quiet:false
: [axis-wsdl2java] server-side:true
: [axis-wsdl2java] skeletonDeploy:false
: [axis-wsdl2java] helperGen:false
: [axis-wsdl2java] factory:null
: [axis-wsdl2java] nsIncludes:[]
: [axis-wsdl2java] nsExcludes:[]
: [axis-wsdl2java] factoryProps:[]
: [axis-wsdl2java] testCase:false
: [axis-wsdl2java] noImports:false
: [axis-wsdl2java] NStoPkg:{urn:MyServiceCommon=com.abc.api.common.doclit,
: urn:MyServiceWithMIMEDocLit=com.abc.ws.stubs}
: [axis-wsdl2java] output:/home/local/anand/System/Jabc/wsdl
: [axis-wsdl2java] protocolHandlerPkgs:
: [axis-wsdl2java] deployScope:
: [axis-wsdl2java]
: URL:/home/local/anand/System/Jabc/wsdl/MyServiceWithMIMEDocLit.wsdl
: [axis-wsdl2java] all:false
: [axis-wsdl2java] typeMappingVersion:1.1
: [axis-wsdl2java] timeout:45000
: [axis-wsdl2java] failOnNetworkErrors:false
: [axis-wsdl2java] printStackTraceOnFailure:true
: [axis-wsdl2java] namespaceMappingFile:null
: [axis-wsdl2java] username:null
: [axis-wsdl2java] :passwordnull
: [axis-wsdl2java] :noWrappedfalse
: [axis-wsdl2java] :implementationClassNamenull
: [axis-wsdl2java] :classpathnull
: [axis-wsdl2java] http.proxyHost=null
: [axis-wsdl2java] http.proxyPort=null
: [axis-wsdl2java] http.proxyUser=null
: [axis-wsdl2java] http.proxyPassword=null
: [axis-wsdl2java] socks.proxyHost=null
: [axis-wsdl2java] socks.proxyPort=null
: [axis-wsdl2java] java.lang.NullPointerException
: [axis-wsdl2java] at
: org.apache.axis.wsdl.symbolTable.SymbolTable.addMIMETypes(SymbolTable.ja
: va:2
: 864)
: [axis-wsdl2java] at
: org.apache.axis.wsdl.symbolTable.SymbolTable.fillInBindingInfo(SymbolTab
: le.j
: ava:2544)
: [axis-wsdl2java] at
: org.apache.axis.wsdl.symbolTable.SymbolTable.populateBindings(SymbolTabl
: e.ja
: va:2464)
: [axis-wsdl2java] at
: org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:7
: 31)
: [axis-wsdl2java] at
: org.apache.axis.wsdl.symbolTable.SymbolTable.add(SymbolTable.java:531)
: [axis-wsdl2java] at
: org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:5
: 06)
: [axis-wsdl2java] at
: org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:4
: 83)
: [axis-wsdl2java] at
: org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:356)
: [axis-wsdl2java] at java.lang.Thread.run(Thread.java:534)
:
: Any idea why Axis is failing on what looks like a legitimate WSDL?
: Should I open a bug? Thanks!
:
: Anand
:
: