Josh,
Thanks! I took your WSDL and ran it through WSDL2Java
to generate the client java. To my surprise, the
echoAttachment signature was:
String echoAttachment( String ).
Given that the MIME type of the attachment is
"text/plain", it seemed that the attached file could
be considered a container for a long string. I then
changed the MIME type to "image/jpeg" and got this
signature:
java.awt.Image echoAttachment(java.awt.Image)
Then I changed the MIME type to "audio/x-wav" which is
what I have in original WSDL which won't compile --
and I got the same error message:
java.lang.NullPointerException
at
org.apache.axis.wsdl.toJava.Utils.getNewQName(Utils.java:613)
at
org.apache.axis.wsdl.toJava.JavaStubWriter.writeOperationMap(JavaStubWriter.java:384)
So it seems like a problem figuring out what sort of
object to convert "audio/x-wav" to.
I then changed the MIME type to
"application/octet-stream", but that failed with the
same error.
Is there any way to, say, map "audio/x-wav" to
javax.sound.sampled.Clip? Or at least to map
"application/octet-stream" to a DataHandler?
Mark
--- Josh Kropf <[EMAIL PROTECTED]>
wrote:
> Mark,
>
> I have investigtated slightly this matter of MIME
> mention in WSDL code. Just
> for fun, I created a web service in BEA Weblogic
> that returned a DataHandler
> since this is the automatic method to attach files
> apparently. The WSDL BEA
> creates for this class DOES have a MIME section in
> the operations node.
> (attached is the WSDL, unformatted... sorry)
>
> I proceded to try and get .NET to generate a stub
> from the WSDL and it
> simply skips the operation that has the mime
> mentioned in it.
>
> However both Weblogic and Axis seem to create a
> semi-resonable stub (with
> Object's in place of DataHandler). I assume that if
> you stub where to cast
> the Object returned to a DataHandler, it would work
> as expected... however
> un-verified at this point.
>
> So I think this answers your question... Axis does
> handle the mime section.
> But other platform implementations MAY not (im still
> unsure) like Micro$uks
> .CRAP Framework.
>
> -----Original Message-----
> From: Mark Mueller [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, January 28, 2003 4:09 PM
> To: [EMAIL PROTECTED]
> Subject: RE: Interoperative attachments
>
>
> Folks,
>
> I originally used the method in the EchoAttachments
> sample which did use MIME to send the attahcment --
> but the WSDL identified the type as
> "apachesoap:DataHandler" and didn't mention MIME in
> the generated WSDL. Intuitively, this didn't seem
> very interoperative.
>
> Josh showed me how to add an attachment "manually"
> in
> my code, but the Axis-generated WSDL still didn't
> mention the MIME attachment. Using the WSDL 1.1
> Note
> as a model, I modified my WSDL (file attached).
> When
> I tried to generate the client code with WSDL2Java I
> got this error:
>
> $ java org.apache.axis.wsdl.WSDL2Java Text2wav.wsdl
> java.lang.NullPointerException
> at
>
org.apache.axis.wsdl.toJava.Utils.getNewQName(Utils.java:613)
> at
>
org.apache.axis.wsdl.toJava.JavaStubWriter.writeOperationMap(JavaStubWriter.
> java:384)
> at
>
org.apache.axis.wsdl.toJava.JavaStubWriter.writeFileBody(JavaStubWriter.java
> :153)
> at
>
org.apache.axis.wsdl.toJava.JavaWriter.generate(JavaWriter.java:151)
> at
>
org.apache.axis.wsdl.toJava.JavaBindingWriter.generate(JavaBindingWriter.jav
> a:145)
> at
>
org.apache.axis.wsdl.toJava.JavaGeneratorFactory$Writers.generate(JavaGenera
> torFactory.java:290)
> at
>
org.apache.axis.wsdl.gen.Parser.generate(Parser.java:325)
> at
>
org.apache.axis.wsdl.gen.Parser.access$000(Parser.java:83)
> at
>
org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:247)
> at java.lang.Thread.run(Thread.java:536)
> -----------------------
>
> Is my hand-modified wsdl file bad, or does Axis not
> deal well with wsdl that uses MIME stuff?
>
> Mark
>
>
> --- Norris Merritt <[EMAIL PROTECTED]>
> wrote:
> > I've had success with the Axis 1.1 beta DIME
> support
> > demonstrated in the
> > echoAttachments sample (which also has a mode in
> > which it uses MIME). Axis
> > 1.1 beta DIME support interoperates both with
> gSOAP
> > and .NET. For my money
> > DIME is the way to go, especially with attachments
> > that would otherwise need
> > to be Base-64 encoded. Its much more efficient
> than
> > MIME.
> >
> > -----Original Message-----
> > From: Steve Loughran [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, January 28, 2003 9:17 AM
> > To: [EMAIL PROTECTED]
> > Subject: Re: Interoperative attachments
> >
> >
> >
> > ----- Original Message -----
> > From: "Mark Mueller" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Tuesday, January 28, 2003 08:18
> > Subject: RE: Interoperative attachments
> >
> >
> > > Josh,
> > >
> > > Yes, I am trying to develop the service that is
> > > language and platform neutral, so I'm trying to
> > find
> > > the "right" way to handle attachments.
> > Unfortunately
> > > I don't have other platforms to test on.
> >
> > pocketsoap, MSSTK and .NET with the WSE all do
> > attachments if you want to
> > cross-test
> >
> > >
> > > The W3C WSDL 1.1 Note shows a MIME binding that
> > > supports attachments, but poking around on the
> > > Xmethods website, I didn't run across any WSDL
> > that
> > > shows the MIME binding. If vender
> > interoperability
> > > for attachments just isn't there yet, that would
> > be
> > > good to know.
> >
> > all uses of attachments I've seen have attachments
> > attached and removed
> > manually, with attachment details 'add three of
> > them' in the service
> > specification.
>
>
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up
> now.
> http://mailplus.yahoo.com
> > <?xml version="1.0" encoding="utf-8"?>
>
> <definitions
> xmlns:s="http://www.w3.org/2001/XMLSchema"
>
> xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
>
> xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
>
>
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
>
> xmlns:tns="http://tempuri.org/"
>
> xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
> targetNamespace="http://tempuri.org/"
> xmlns="http://schemas.xmlsoap.org/wsdl/">
>
>
>
> <message name="echoAttachment" >
>
> <part name="data"
> xmlns:partns="http://www.w3.org/2001/XMLSchema"
> type="partns:anyType" />
>
>
> </message>
> <message name="echoAttachmentResponse" >
>
> <part name="result"
> xmlns:partns="http://www.w3.org/2001/XMLSchema"
> type="partns:anyType" />
>
>
> </message>
>
>
>
>
>
> <message name="helloWorld" >
>
> </message>
> <message name="helloWorldResponse" >
>
> <part name="result"
> xmlns:partns="http://www.w3.org/2001/XMLSchema"
> type="partns:string" />
>
>
> </message>
>
>
>
>
>
>
> <portType name="MyServicePort" >
>
> <operation name="echoAttachment" >
> <input message="tns:echoAttachment" />
>
> <output message="tns:echoAttachmentResponse" />
>
>
> </operation>
>
> <operation name="helloWorld" >
> <input message="tns:helloWorld" />
>
> <output message="tns:helloWorldResponse" />
>
>
> </operation>
>
> </portType>
>
>
>
> <binding name="MyServicePortSoapBinding"
> type="tns:MyServicePort" >
>
> <soap:binding style="rpc"
>
> transport="http://schemas.xmlsoap.org/soap/http" />
>
> <operation name="echoAttachment" >
> <soap:operation
> soapAction=""
> style="rpc" />
>
> <input>
>
> <mime:multipartRelated>
> <mime:part>
>
> <soap:body use="encoded"
> namespace="http://tempuri.org/"
>
>
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> />
>
>
>
> </mime:part>
>
> <mime:part>
> <mime:content part="data"
> type="text/plain"/>
>
> </mime:part>
>
> </mime:multipartRelated>
>
> </input>
> <output>
>
> <mime:multipartRelated>
> <mime:part>
>
> <soap:body use="encoded"
> namespace="http://tempuri.org/"
>
>
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> />
>
>
>
> </mime:part>
>
> <mime:part>
> <mime:content part="result"
> type="text/plain"/>
>
> </mime:part>
>
> </mime:multipartRelated>
>
> </output>
>
> </operation>
>
>
> <operation name="helloWorld" >
> <soap:operation
> soapAction=""
> style="rpc" />
>
> <input>
>
>
> <soap:body use="encoded"
> namespace="http://tempuri.org/"
>
>
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> />
>
>
>
>
> </input>
> <output>
>
>
> <soap:body use="encoded"
> namespace="http://tempuri.org/"
>
>
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> />
>
>
>
>
> </output>
>
> </operation>
>
>
> </binding>
>
>
> <service name="MyService" >
> <documentation>todo: add your documentation
> here</documentation>
>
> <port name="MyServicePort"
> binding="tns:MyServicePortSoapBinding">
> <soap:address
> location="http://localhost:7001/attach/MyService"/>
> </port>
>
> </service>
>
> </definitions>
>
__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com