I think I may have solved the problem. I think there's a misspelling of "octet-stream" in line 702 of org.apache.axis.wsdl.toJava.Utils: else if ("application/octetstream".equals(mimeName)) { return Constants.MIME_OCTETSTREAM;
If I use "application/octetstream" in my WSDL WSDL2Java works. The signature of the stub is: java.lang.Object echoAttachment( java.lang.Object ) That seems reasonable. Mark --- Mark Mueller <[EMAIL PROTECTED]> wrote: > 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 > === message truncated === __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com