You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Stuart Barlow <sb...@peopledoc.com> on 2004/04/09 13:11:49 UTC

DataHandler and Java2WSDL and WSDL2Java

I have looked at the attachments example in the 1.1 release and
can see the DataHandler type mentioned as the return type for
the message in the WSDL.

Is it possible to use the DataHandler class and the AXIS roundtrip
tools?

I have a Java class with method...

public DataHandler getDocumentDataJavaClientOnly(String dst,
     String dmDocID, int versionNumber) throws Exception;


When I run Java2WSDL against this I get...
<wsdl:message name="getDocumentDataJavaClientOnlyResponse">
<wsdl:part name="getDocumentDataJavaClientOnlyReturn" type="xsd:anyType"/>
</wsdl:message>

I guess that Java2WSDL does not recognise the DataHandler type.
This is all in AXIS 1.1 has anyone tried the 1.2 alpha build for
this?

Ta,
Stuart.


Re: DataHandler and Java2WSDL and WSDL2Java

Posted by Stuart Barlow <sb...@peopledoc.com>.
Thanks for the interest in this problem. I am now to coding client
by hand (following the attachments example) and am getting the
following error...

Caused by: org.xml.sax.SAXException: Bad types (class [B -> class 
javax.activation.DataHandler)

Service method is...
public DataHandler getDocumentData(String dst, String dmDocID,
     int versionNumber) throws DmSystemSPIException;

I have not seen exactly this problem in the mailing lists?

ta,
Stuart.


Davanum Srinivas wrote:
> Tom,
> 
> my 2 cents, we should generate mime stuff in the auto-generated WSDL (see
> test\wsdl\attachments\mime.wsdl) for example. There's bunch of issues in JIRA. Add your thoughts
> there (http://nagoya.apache.org/jira/browse/AXIS-1138).
> 
> -- dims
> 
> --- Tom Nelson <to...@raba.com> wrote:
> 
>>I believe that the dynamically generated wsdl from a deployed
>>axis1.2beta service DOES show type ="tns1:DataHandler" for the return
>>type of javax.activation.DataHandler.
>>
>>I wonder if, for the sake of interoperability, the wsdl
>>file would be better off showing an 'xsd:anyType' return type
>>instead of 'DataHandler'....
>>
>>For my own interoperability testing between an Axis1.2beta service
>>and a WASP client, I had to modify the Axis service to return
>>the DataHandler as a java.lang.Object so that the WASP client
>>did not treat the DataHandler as a javabean. After I made that
>>change, the dynamic wsdl showed a return type of 'tns1:anyType',
>>and the WASP client was able to turn the Axis-generated
>>multipart/related
>>message into a WASP 'org.idoox.wasp.typesMessageAttachment'
>>instance. The Axis client also still worked.
>>
>>Here's how I ended up defining the service:
>>
>>Object getFile(String name) {
>>      return new DataHandler(new FileDataSource(name));
>>}
>>
>>If the dynamic wsdl returned an 'anyType', I might have been able to
>>leave the Axis service definition like this:
>>
>>DataHandler getFile(String name)  // the rest is the same
>>
>>Thoughts?
>>
>>Tom Nelson
>>RABA Technologies
>>
>>On Apr 12, 2004, at 6:22 AM, Stuart Barlow wrote:
>>
>>
>>>Yep in the beta release this bug still exists.
>>>Ill raise a bug.
>>>
>>>Davanum Srinivas wrote:
>>>
>>>
>>>>Again, if there is a problem with 1.2Beta, we can get this fixed. 
>>>>Please open a bug report.
>>>>-- dims
>>>>--- Stuart Barlow <sb...@peopledoc.com> wrote:
>>>>
>>>>>I have looked at the attachments example in the 1.1 release and
>>>>>can see the DataHandler type mentioned as the return type for
>>>>>the message in the WSDL.
>>>>>
>>>>>Is it possible to use the DataHandler class and the AXIS roundtrip
>>>>>tools?
>>>>>
>>>>>I have a Java class with method...
>>>>>
>>>>>public DataHandler getDocumentDataJavaClientOnly(String dst,
>>>>>    String dmDocID, int versionNumber) throws Exception;
>>>>>
>>>>>
>>>>>When I run Java2WSDL against this I get...
>>>>><wsdl:message name="getDocumentDataJavaClientOnlyResponse">
>>>>><wsdl:part name="getDocumentDataJavaClientOnlyReturn" 
>>>>>type="xsd:anyType"/>
>>>>></wsdl:message>
>>>>>
>>>>>I guess that Java2WSDL does not recognise the DataHandler type.
>>>>>This is all in AXIS 1.1 has anyone tried the 1.2 alpha build for
>>>>>this?
>>>>>
>>>>>Ta,
>>>>>Stuart.
>>>>>
>>>>
>>>>=====
>>>>Davanum Srinivas - http://webservices.apache.org/~dims/
>>>
> 
> 
> =====
> Davanum Srinivas - http://webservices.apache.org/~dims/
> 


Re: DataHandler and Java2WSDL and WSDL2Java

Posted by Davanum Srinivas <di...@yahoo.com>.
Tom,

my 2 cents, we should generate mime stuff in the auto-generated WSDL (see
test\wsdl\attachments\mime.wsdl) for example. There's bunch of issues in JIRA. Add your thoughts
there (http://nagoya.apache.org/jira/browse/AXIS-1138).

-- dims

--- Tom Nelson <to...@raba.com> wrote:
> I believe that the dynamically generated wsdl from a deployed
> axis1.2beta service DOES show type ="tns1:DataHandler" for the return
> type of javax.activation.DataHandler.
> 
> I wonder if, for the sake of interoperability, the wsdl
> file would be better off showing an 'xsd:anyType' return type
> instead of 'DataHandler'....
> 
> For my own interoperability testing between an Axis1.2beta service
> and a WASP client, I had to modify the Axis service to return
> the DataHandler as a java.lang.Object so that the WASP client
> did not treat the DataHandler as a javabean. After I made that
> change, the dynamic wsdl showed a return type of 'tns1:anyType',
> and the WASP client was able to turn the Axis-generated
> multipart/related
> message into a WASP 'org.idoox.wasp.typesMessageAttachment'
> instance. The Axis client also still worked.
> 
> Here's how I ended up defining the service:
> 
> Object getFile(String name) {
>       return new DataHandler(new FileDataSource(name));
> }
> 
> If the dynamic wsdl returned an 'anyType', I might have been able to
> leave the Axis service definition like this:
> 
> DataHandler getFile(String name)  // the rest is the same
> 
> Thoughts?
> 
> Tom Nelson
> RABA Technologies
> 
> On Apr 12, 2004, at 6:22 AM, Stuart Barlow wrote:
> 
> > Yep in the beta release this bug still exists.
> > Ill raise a bug.
> >
> > Davanum Srinivas wrote:
> >
> >> Again, if there is a problem with 1.2Beta, we can get this fixed. 
> >> Please open a bug report.
> >> -- dims
> >> --- Stuart Barlow <sb...@peopledoc.com> wrote:
> >>> I have looked at the attachments example in the 1.1 release and
> >>> can see the DataHandler type mentioned as the return type for
> >>> the message in the WSDL.
> >>>
> >>> Is it possible to use the DataHandler class and the AXIS roundtrip
> >>> tools?
> >>>
> >>> I have a Java class with method...
> >>>
> >>> public DataHandler getDocumentDataJavaClientOnly(String dst,
> >>>     String dmDocID, int versionNumber) throws Exception;
> >>>
> >>>
> >>> When I run Java2WSDL against this I get...
> >>> <wsdl:message name="getDocumentDataJavaClientOnlyResponse">
> >>> <wsdl:part name="getDocumentDataJavaClientOnlyReturn" 
> >>> type="xsd:anyType"/>
> >>> </wsdl:message>
> >>>
> >>> I guess that Java2WSDL does not recognise the DataHandler type.
> >>> This is all in AXIS 1.1 has anyone tried the 1.2 alpha build for
> >>> this?
> >>>
> >>> Ta,
> >>> Stuart.
> >>>
> >> =====
> >> Davanum Srinivas - http://webservices.apache.org/~dims/
> >
> 


=====
Davanum Srinivas - http://webservices.apache.org/~dims/

Re: DataHandler and Java2WSDL and WSDL2Java

Posted by Tom Nelson <to...@raba.com>.
I believe that the dynamically generated wsdl from a deployed
axis1.2beta service DOES show type ="tns1:DataHandler" for the return
type of javax.activation.DataHandler.

I wonder if, for the sake of interoperability, the wsdl
file would be better off showing an 'xsd:anyType' return type
instead of 'DataHandler'....

For my own interoperability testing between an Axis1.2beta service
and a WASP client, I had to modify the Axis service to return
the DataHandler as a java.lang.Object so that the WASP client
did not treat the DataHandler as a javabean. After I made that
change, the dynamic wsdl showed a return type of 'tns1:anyType',
and the WASP client was able to turn the Axis-generated
multipart/related
message into a WASP 'org.idoox.wasp.typesMessageAttachment'
instance. The Axis client also still worked.

Here's how I ended up defining the service:

Object getFile(String name) {
      return new DataHandler(new FileDataSource(name));
}

If the dynamic wsdl returned an 'anyType', I might have been able to
leave the Axis service definition like this:

DataHandler getFile(String name)  // the rest is the same

Thoughts?

Tom Nelson
RABA Technologies

On Apr 12, 2004, at 6:22 AM, Stuart Barlow wrote:

> Yep in the beta release this bug still exists.
> Ill raise a bug.
>
> Davanum Srinivas wrote:
>
>> Again, if there is a problem with 1.2Beta, we can get this fixed. 
>> Please open a bug report.
>> -- dims
>> --- Stuart Barlow <sb...@peopledoc.com> wrote:
>>> I have looked at the attachments example in the 1.1 release and
>>> can see the DataHandler type mentioned as the return type for
>>> the message in the WSDL.
>>>
>>> Is it possible to use the DataHandler class and the AXIS roundtrip
>>> tools?
>>>
>>> I have a Java class with method...
>>>
>>> public DataHandler getDocumentDataJavaClientOnly(String dst,
>>>     String dmDocID, int versionNumber) throws Exception;
>>>
>>>
>>> When I run Java2WSDL against this I get...
>>> <wsdl:message name="getDocumentDataJavaClientOnlyResponse">
>>> <wsdl:part name="getDocumentDataJavaClientOnlyReturn" 
>>> type="xsd:anyType"/>
>>> </wsdl:message>
>>>
>>> I guess that Java2WSDL does not recognise the DataHandler type.
>>> This is all in AXIS 1.1 has anyone tried the 1.2 alpha build for
>>> this?
>>>
>>> Ta,
>>> Stuart.
>>>
>> =====
>> Davanum Srinivas - http://webservices.apache.org/~dims/
>


Re: DataHandler and Java2WSDL and WSDL2Java

Posted by Stuart Barlow <sb...@peopledoc.com>.
Yep in the beta release this bug still exists.
Ill raise a bug.

Davanum Srinivas wrote:

> Again, if there is a problem with 1.2Beta, we can get this fixed. Please open a bug report.
> 
> -- dims
> 
> --- Stuart Barlow <sb...@peopledoc.com> wrote:
> 
>>I have looked at the attachments example in the 1.1 release and
>>can see the DataHandler type mentioned as the return type for
>>the message in the WSDL.
>>
>>Is it possible to use the DataHandler class and the AXIS roundtrip
>>tools?
>>
>>I have a Java class with method...
>>
>>public DataHandler getDocumentDataJavaClientOnly(String dst,
>>     String dmDocID, int versionNumber) throws Exception;
>>
>>
>>When I run Java2WSDL against this I get...
>><wsdl:message name="getDocumentDataJavaClientOnlyResponse">
>><wsdl:part name="getDocumentDataJavaClientOnlyReturn" type="xsd:anyType"/>
>></wsdl:message>
>>
>>I guess that Java2WSDL does not recognise the DataHandler type.
>>This is all in AXIS 1.1 has anyone tried the 1.2 alpha build for
>>this?
>>
>>Ta,
>>Stuart.
>>
> 
> 
> 
> =====
> Davanum Srinivas - http://webservices.apache.org/~dims/
> 


Re: DataHandler and Java2WSDL and WSDL2Java

Posted by Davanum Srinivas <di...@yahoo.com>.
Again, if there is a problem with 1.2Beta, we can get this fixed. Please open a bug report.

-- dims

--- Stuart Barlow <sb...@peopledoc.com> wrote:
> I have looked at the attachments example in the 1.1 release and
> can see the DataHandler type mentioned as the return type for
> the message in the WSDL.
> 
> Is it possible to use the DataHandler class and the AXIS roundtrip
> tools?
> 
> I have a Java class with method...
> 
> public DataHandler getDocumentDataJavaClientOnly(String dst,
>      String dmDocID, int versionNumber) throws Exception;
> 
> 
> When I run Java2WSDL against this I get...
> <wsdl:message name="getDocumentDataJavaClientOnlyResponse">
> <wsdl:part name="getDocumentDataJavaClientOnlyReturn" type="xsd:anyType"/>
> </wsdl:message>
> 
> I guess that Java2WSDL does not recognise the DataHandler type.
> This is all in AXIS 1.1 has anyone tried the 1.2 alpha build for
> this?
> 
> Ta,
> Stuart.
> 


=====
Davanum Srinivas - http://webservices.apache.org/~dims/