You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by cs...@apache.org on 2005/12/16 00:04:44 UTC
svn commit: r357084 - in /beehive/trunk: system-controls/
system-controls/test/webservice/ system-controls/test/webservice/schemas/
system-controls/test/webservice/schemas/rpcEncoded/
system-controls/test/webservice/servers/webapp/WEB-INF/src/org/apach...
Author: cschoett
Date: Thu Dec 15 15:04:27 2005
New Revision: 357084
URL: http://svn.apache.org/viewcvs?rev=357084&view=rev
Log:
Added new tests for DataHandler type attachements in service control.
Added:
beehive/trunk/system-controls/test/webservice/schemas/DataHandlerDocLitWrapped.wsdl
beehive/trunk/system-controls/test/webservice/schemas/DataHandlerRpcLit.wsdl
beehive/trunk/system-controls/test/webservice/schemas/rpcEncoded/DataHandlerRpcEnc.wsdl
beehive/trunk/system-controls/test/webservice/servers/webapp/WEB-INF/src/org/apache/beehive/attachments/ByteArrayDataSource.java (with props)
beehive/trunk/system-controls/test/webservice/servers/webapp/WEB-INF/src/org/apache/beehive/attachments/DataHandlerAttachments.java (with props)
beehive/trunk/system-controls/test/webservice/servers/webapp/WEB-INF/webservices/attachments/datahandler/
beehive/trunk/system-controls/test/webservice/servers/webapp/WEB-INF/webservices/attachments/datahandler/DataHandlerDocLitWrapped.java (with props)
beehive/trunk/system-controls/test/webservice/servers/webapp/WEB-INF/webservices/attachments/datahandler/DataHandlerRpcEnc.java (with props)
beehive/trunk/system-controls/test/webservice/servers/webapp/WEB-INF/webservices/attachments/datahandler/DataHandlerRpcLit.java (with props)
beehive/trunk/system-controls/test/webservice/servers/webapp/WEB-INF/webservices/attachments/datahandler/resources/
beehive/trunk/system-controls/test/webservice/servers/webapp/WEB-INF/webservices/attachments/datahandler/resources/beehive_logo.gif
beehive/trunk/system-controls/test/webservice/servers/webapp/WEB-INF/webservices/attachments/datahandler/resources/bird1.jpg (with props)
beehive/trunk/system-controls/test/webservice/tests/org/apache/beehive/controls/system/webservice/units/DataHandlerAttachementDocLitWrappedTest.java (with props)
beehive/trunk/system-controls/test/webservice/tests/org/apache/beehive/controls/system/webservice/units/DataHandlerAttachementRpcEncTest.java (with props)
beehive/trunk/system-controls/test/webservice/tests/org/apache/beehive/controls/system/webservice/units/DataHandlerAttachementRpcLitTest.java (with props)
Modified:
beehive/trunk/system-controls/systemcontrols-imports.xml
beehive/trunk/system-controls/test/webservice/build.xml
beehive/trunk/system-controls/test/webservice/servers/webapp/WEB-INF/webservices/attachments/images/ImagesDocLitWrapped.java
beehive/trunk/wsm/src/axis/org/apache/beehive/wsm/axis/ServiceDescriptionFactory.java
beehive/trunk/wsm/src/axis/org/apache/beehive/wsm/axis/databinding/AxisLookupService.java
Modified: beehive/trunk/system-controls/systemcontrols-imports.xml
URL: http://svn.apache.org/viewcvs/beehive/trunk/system-controls/systemcontrols-imports.xml?rev=357084&r1=357083&r2=357084&view=diff
==============================================================================
--- beehive/trunk/system-controls/systemcontrols-imports.xml (original)
+++ beehive/trunk/system-controls/systemcontrols-imports.xml Thu Dec 15 15:04:27 2005
@@ -24,7 +24,7 @@
<path id="axis.dependency.path">
<fileset dir="${beehive.home}/wsm/external/axis-1.2" includes="axis.jar"/>
- <fileset dir="${beehive.home}/wsm/external/axis-1.2" includes="jaxrpc.jar"/>
+ <fileset dir="${beehive.home}/wsm/external/axis-1.2" includes="axis-ant.jar"/>
</path>
<path id="jaxrpc.dependency.path">
Modified: beehive/trunk/system-controls/test/webservice/build.xml
URL: http://svn.apache.org/viewcvs/beehive/trunk/system-controls/test/webservice/build.xml?rev=357084&r1=357083&r2=357084&view=diff
==============================================================================
--- beehive/trunk/system-controls/test/webservice/build.xml (original)
+++ beehive/trunk/system-controls/test/webservice/build.xml Thu Dec 15 15:04:27 2005
@@ -128,6 +128,7 @@
<fileset dir="${junit-source.dir}">
<include name="**/*Test.java"/>
<exclude name="**/Image*Test.java"/>
+ <exclude name="**/DataHandler*Test.java"/>
</fileset>
</batchtest>
</junit>
@@ -258,6 +259,8 @@
<include name="*.wsdl"/>
<exclude name="ImagesDocLitWrapped.wsdl"/>
<exclude name="ImagesRpcLit.wsdl"/>
+ <exclude name="DataHandlerDocLitWrapped.wsdl"/>
+ <exclude name="DataHandlerRpcLit.wsdl"/>
</fileset>
</xmlbeanbuild>
@@ -295,6 +298,9 @@
<check-wsdl webservicePath="attachments/images" webserviceName="ImagesDocLitWrapped" drtWsdlDir="${wsdls.dir}"/>
<check-wsdl webservicePath="attachments/images" webserviceName="ImagesRpcLit" drtWsdlDir="${wsdls.dir}"/>
<check-wsdl webservicePath="attachments/images" webserviceName="ImagesRpcEnc" drtWsdlDir="${rpc.encoded.wsdls.dir}"/>
+ <check-wsdl webservicePath="attachments/datahandler" webserviceName="DataHandlerDocLitWrapped" drtWsdlDir="${wsdls.dir}"/>
+ <check-wsdl webservicePath="attachments/datahandler" webserviceName="DataHandlerRpcLit" drtWsdlDir="${wsdls.dir}"/>
+ <check-wsdl webservicePath="attachments/datahandler" webserviceName="DataHandlerRpcEnc" drtWsdlDir="${rpc.encoded.wsdls.dir}"/>
<check-wsdl webservicePath="soapMarshalling" webserviceName="SoapMarshallingRpcEnc" drtWsdlDir="${rpc.encoded.wsdls.dir}"/>
<check-wsdl webservicePath="soapMarshalling" webserviceName="SoapMarshallingRpcEncArrayTypes" drtWsdlDir="${rpc.encoded.wsdls.dir}"/>
<check-wsdl webservicePath="web/complex" webserviceName="DocumentLiteralWrappedSample" drtWsdlDir="${wsdls.dir}"/>
Added: beehive/trunk/system-controls/test/webservice/schemas/DataHandlerDocLitWrapped.wsdl
URL: http://svn.apache.org/viewcvs/beehive/trunk/system-controls/test/webservice/schemas/DataHandlerDocLitWrapped.wsdl?rev=357084&view=auto
==============================================================================
--- beehive/trunk/system-controls/test/webservice/schemas/DataHandlerDocLitWrapped.wsdl (added)
+++ beehive/trunk/system-controls/test/webservice/schemas/DataHandlerDocLitWrapped.wsdl Thu Dec 15 15:04:27 2005
@@ -0,0 +1,223 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions targetNamespace="http://datahandler.attachments" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://datahandler.attachments" xmlns:intf="http://datahandler.attachments" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+<!--WSDL created by Apache Axis version: 1.2
+Built on May 03, 2005 (02:20:24 EDT)-->
+ <wsdl:types>
+ <schema elementFormDefault="qualified" targetNamespace="http://datahandler.attachments" xmlns="http://www.w3.org/2001/XMLSchema">
+ <import namespace="http://xml.apache.org/xml-soap"/>
+ <element name="getJpgImage">
+ <complexType/>
+ </element>
+ <element name="getJpgImageResponse">
+ <complexType>
+ <sequence>
+ <element name="return" type="apachesoap:DataHandler"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="getGifImage">
+ <complexType/>
+ </element>
+ <element name="getGifImageResponse">
+ <complexType>
+ <sequence>
+ <element name="return" type="apachesoap:DataHandler"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="getPlainText">
+ <complexType/>
+ </element>
+ <element name="getPlainTextResponse">
+ <complexType>
+ <sequence>
+ <element name="return" type="apachesoap:DataHandler"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="getXmlText">
+ <complexType/>
+ </element>
+ <element name="getXmlTextResponse">
+ <complexType>
+ <sequence>
+ <element name="return" type="apachesoap:DataHandler"/>
+ </sequence>
+ </complexType>
+ </element>
+ </schema>
+ </wsdl:types>
+
+ <wsdl:message name="getPlainTextRequest">
+
+ <wsdl:part element="impl:getPlainText" name="parameters"/>
+
+ </wsdl:message>
+
+ <wsdl:message name="getPlainTextResponse">
+
+ <wsdl:part element="impl:getPlainTextResponse" name="parameters"/>
+
+ </wsdl:message>
+
+ <wsdl:message name="getGifImageResponse">
+
+ <wsdl:part element="impl:getGifImageResponse" name="parameters"/>
+
+ </wsdl:message>
+
+ <wsdl:message name="getXmlTextRequest">
+
+ <wsdl:part element="impl:getXmlText" name="parameters"/>
+
+ </wsdl:message>
+
+ <wsdl:message name="getJpgImageRequest">
+
+ <wsdl:part element="impl:getJpgImage" name="parameters"/>
+
+ </wsdl:message>
+
+ <wsdl:message name="getXmlTextResponse">
+
+ <wsdl:part element="impl:getXmlTextResponse" name="parameters"/>
+
+ </wsdl:message>
+
+ <wsdl:message name="getJpgImageResponse">
+
+ <wsdl:part element="impl:getJpgImageResponse" name="parameters"/>
+
+ </wsdl:message>
+
+ <wsdl:message name="getGifImageRequest">
+
+ <wsdl:part element="impl:getGifImage" name="parameters"/>
+
+ </wsdl:message>
+
+ <wsdl:portType name="DataHandlerDocLitWrapped">
+
+ <wsdl:operation name="getJpgImage">
+
+ <wsdl:input message="impl:getJpgImageRequest" name="getJpgImageRequest"/>
+
+ <wsdl:output message="impl:getJpgImageResponse" name="getJpgImageResponse"/>
+
+ </wsdl:operation>
+
+ <wsdl:operation name="getGifImage">
+
+ <wsdl:input message="impl:getGifImageRequest" name="getGifImageRequest"/>
+
+ <wsdl:output message="impl:getGifImageResponse" name="getGifImageResponse"/>
+
+ </wsdl:operation>
+
+ <wsdl:operation name="getPlainText">
+
+ <wsdl:input message="impl:getPlainTextRequest" name="getPlainTextRequest"/>
+
+ <wsdl:output message="impl:getPlainTextResponse" name="getPlainTextResponse"/>
+
+ </wsdl:operation>
+
+ <wsdl:operation name="getXmlText">
+
+ <wsdl:input message="impl:getXmlTextRequest" name="getXmlTextRequest"/>
+
+ <wsdl:output message="impl:getXmlTextResponse" name="getXmlTextResponse"/>
+
+ </wsdl:operation>
+
+ </wsdl:portType>
+
+ <wsdl:binding name="DataHandlerDocLitWrappedSoapBinding" type="impl:DataHandlerDocLitWrapped">
+
+ <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+
+ <wsdl:operation name="getJpgImage">
+
+ <wsdlsoap:operation soapAction=""/>
+
+ <wsdl:input name="getJpgImageRequest">
+
+ <wsdlsoap:body use="literal"/>
+
+ </wsdl:input>
+
+ <wsdl:output name="getJpgImageResponse">
+
+ <wsdlsoap:body use="literal"/>
+
+ </wsdl:output>
+
+ </wsdl:operation>
+
+ <wsdl:operation name="getGifImage">
+
+ <wsdlsoap:operation soapAction=""/>
+
+ <wsdl:input name="getGifImageRequest">
+
+ <wsdlsoap:body use="literal"/>
+
+ </wsdl:input>
+
+ <wsdl:output name="getGifImageResponse">
+
+ <wsdlsoap:body use="literal"/>
+
+ </wsdl:output>
+
+ </wsdl:operation>
+
+ <wsdl:operation name="getPlainText">
+
+ <wsdlsoap:operation soapAction=""/>
+
+ <wsdl:input name="getPlainTextRequest">
+
+ <wsdlsoap:body use="literal"/>
+
+ </wsdl:input>
+
+ <wsdl:output name="getPlainTextResponse">
+
+ <wsdlsoap:body use="literal"/>
+
+ </wsdl:output>
+
+ </wsdl:operation>
+
+ <wsdl:operation name="getXmlText">
+
+ <wsdlsoap:operation soapAction=""/>
+
+ <wsdl:input name="getXmlTextRequest">
+
+ <wsdlsoap:body use="literal"/>
+
+ </wsdl:input>
+
+ <wsdl:output name="getXmlTextResponse">
+
+ <wsdlsoap:body use="literal"/>
+
+ </wsdl:output>
+
+ </wsdl:operation>
+
+ </wsdl:binding>
+
+ <wsdl:service name="DataHandlerDocLitWrappedService">
+
+ <wsdl:port binding="impl:DataHandlerDocLitWrappedSoapBinding" name="DataHandlerDocLitWrapped">
+
+ <wsdlsoap:address location="http://localhost:8080/ServiceControlDRT/attachments/datahandler/DataHandlerDocLitWrapped.jws"/>
+
+ </wsdl:port>
+
+ </wsdl:service>
+
+</wsdl:definitions>
Added: beehive/trunk/system-controls/test/webservice/schemas/DataHandlerRpcLit.wsdl
URL: http://svn.apache.org/viewcvs/beehive/trunk/system-controls/test/webservice/schemas/DataHandlerRpcLit.wsdl?rev=357084&view=auto
==============================================================================
--- beehive/trunk/system-controls/test/webservice/schemas/DataHandlerRpcLit.wsdl (added)
+++ beehive/trunk/system-controls/test/webservice/schemas/DataHandlerRpcLit.wsdl Thu Dec 15 15:04:27 2005
@@ -0,0 +1,170 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions targetNamespace="http://datahandler.attachments" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://datahandler.attachments" xmlns:intf="http://datahandler.attachments" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+<!--WSDL created by Apache Axis version: 1.2
+Built on May 03, 2005 (02:20:24 EDT)-->
+
+ <wsdl:message name="getPlainTextRequest">
+
+ </wsdl:message>
+
+ <wsdl:message name="getPlainTextResponse">
+
+ <wsdl:part name="return" type="apachesoap:DataHandler"/>
+
+ </wsdl:message>
+
+ <wsdl:message name="getGifImageResponse">
+
+ <wsdl:part name="return" type="apachesoap:DataHandler"/>
+
+ </wsdl:message>
+
+ <wsdl:message name="getXmlTextRequest">
+
+ </wsdl:message>
+
+ <wsdl:message name="getJpgImageRequest">
+
+ </wsdl:message>
+
+ <wsdl:message name="getXmlTextResponse">
+
+ <wsdl:part name="return" type="apachesoap:DataHandler"/>
+
+ </wsdl:message>
+
+ <wsdl:message name="getJpgImageResponse">
+
+ <wsdl:part name="return" type="apachesoap:DataHandler"/>
+
+ </wsdl:message>
+
+ <wsdl:message name="getGifImageRequest">
+
+ </wsdl:message>
+
+ <wsdl:portType name="DataHandlerRpcLit">
+
+ <wsdl:operation name="getJpgImage">
+
+ <wsdl:input message="impl:getJpgImageRequest" name="getJpgImageRequest"/>
+
+ <wsdl:output message="impl:getJpgImageResponse" name="getJpgImageResponse"/>
+
+ </wsdl:operation>
+
+ <wsdl:operation name="getGifImage">
+
+ <wsdl:input message="impl:getGifImageRequest" name="getGifImageRequest"/>
+
+ <wsdl:output message="impl:getGifImageResponse" name="getGifImageResponse"/>
+
+ </wsdl:operation>
+
+ <wsdl:operation name="getPlainText">
+
+ <wsdl:input message="impl:getPlainTextRequest" name="getPlainTextRequest"/>
+
+ <wsdl:output message="impl:getPlainTextResponse" name="getPlainTextResponse"/>
+
+ </wsdl:operation>
+
+ <wsdl:operation name="getXmlText">
+
+ <wsdl:input message="impl:getXmlTextRequest" name="getXmlTextRequest"/>
+
+ <wsdl:output message="impl:getXmlTextResponse" name="getXmlTextResponse"/>
+
+ </wsdl:operation>
+
+ </wsdl:portType>
+
+ <wsdl:binding name="DataHandlerRpcLitSoapBinding" type="impl:DataHandlerRpcLit">
+
+ <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+
+ <wsdl:operation name="getJpgImage">
+
+ <wsdlsoap:operation soapAction=""/>
+
+ <wsdl:input name="getJpgImageRequest">
+
+ <wsdlsoap:body namespace="http://datahandler.attachments" use="literal"/>
+
+ </wsdl:input>
+
+ <wsdl:output name="getJpgImageResponse">
+
+ <wsdlsoap:body namespace="http://datahandler.attachments" use="literal"/>
+
+ </wsdl:output>
+
+ </wsdl:operation>
+
+ <wsdl:operation name="getGifImage">
+
+ <wsdlsoap:operation soapAction=""/>
+
+ <wsdl:input name="getGifImageRequest">
+
+ <wsdlsoap:body namespace="http://datahandler.attachments" use="literal"/>
+
+ </wsdl:input>
+
+ <wsdl:output name="getGifImageResponse">
+
+ <wsdlsoap:body namespace="http://datahandler.attachments" use="literal"/>
+
+ </wsdl:output>
+
+ </wsdl:operation>
+
+ <wsdl:operation name="getPlainText">
+
+ <wsdlsoap:operation soapAction=""/>
+
+ <wsdl:input name="getPlainTextRequest">
+
+ <wsdlsoap:body namespace="http://datahandler.attachments" use="literal"/>
+
+ </wsdl:input>
+
+ <wsdl:output name="getPlainTextResponse">
+
+ <wsdlsoap:body namespace="http://datahandler.attachments" use="literal"/>
+
+ </wsdl:output>
+
+ </wsdl:operation>
+
+ <wsdl:operation name="getXmlText">
+
+ <wsdlsoap:operation soapAction=""/>
+
+ <wsdl:input name="getXmlTextRequest">
+
+ <wsdlsoap:body namespace="http://datahandler.attachments" use="literal"/>
+
+ </wsdl:input>
+
+ <wsdl:output name="getXmlTextResponse">
+
+ <wsdlsoap:body namespace="http://datahandler.attachments" use="literal"/>
+
+ </wsdl:output>
+
+ </wsdl:operation>
+
+ </wsdl:binding>
+
+ <wsdl:service name="DataHandlerRpcLitService">
+
+ <wsdl:port binding="impl:DataHandlerRpcLitSoapBinding" name="DataHandlerRpcLit">
+
+ <wsdlsoap:address location="http://localhost:8080/ServiceControlDRT/attachments/datahandler/DataHandlerRpcLit.jws"/>
+
+ </wsdl:port>
+
+ </wsdl:service>
+
+</wsdl:definitions>
Added: beehive/trunk/system-controls/test/webservice/schemas/rpcEncoded/DataHandlerRpcEnc.wsdl
URL: http://svn.apache.org/viewcvs/beehive/trunk/system-controls/test/webservice/schemas/rpcEncoded/DataHandlerRpcEnc.wsdl?rev=357084&view=auto
==============================================================================
--- beehive/trunk/system-controls/test/webservice/schemas/rpcEncoded/DataHandlerRpcEnc.wsdl (added)
+++ beehive/trunk/system-controls/test/webservice/schemas/rpcEncoded/DataHandlerRpcEnc.wsdl Thu Dec 15 15:04:27 2005
@@ -0,0 +1,170 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions targetNamespace="http://datahandler.attachments" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://datahandler.attachments" xmlns:intf="http://datahandler.attachments" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+<!--WSDL created by Apache Axis version: 1.2
+Built on May 03, 2005 (02:20:24 EDT)-->
+
+ <wsdl:message name="getPlainTextRequest">
+
+ </wsdl:message>
+
+ <wsdl:message name="getPlainTextResponse">
+
+ <wsdl:part name="return" type="apachesoap:DataHandler"/>
+
+ </wsdl:message>
+
+ <wsdl:message name="getGifImageResponse">
+
+ <wsdl:part name="return" type="apachesoap:DataHandler"/>
+
+ </wsdl:message>
+
+ <wsdl:message name="getXmlTextRequest">
+
+ </wsdl:message>
+
+ <wsdl:message name="getJpgImageRequest">
+
+ </wsdl:message>
+
+ <wsdl:message name="getXmlTextResponse">
+
+ <wsdl:part name="return" type="apachesoap:DataHandler"/>
+
+ </wsdl:message>
+
+ <wsdl:message name="getJpgImageResponse">
+
+ <wsdl:part name="return" type="apachesoap:DataHandler"/>
+
+ </wsdl:message>
+
+ <wsdl:message name="getGifImageRequest">
+
+ </wsdl:message>
+
+ <wsdl:portType name="DataHandlerRpcEnc">
+
+ <wsdl:operation name="getJpgImage">
+
+ <wsdl:input message="impl:getJpgImageRequest" name="getJpgImageRequest"/>
+
+ <wsdl:output message="impl:getJpgImageResponse" name="getJpgImageResponse"/>
+
+ </wsdl:operation>
+
+ <wsdl:operation name="getGifImage">
+
+ <wsdl:input message="impl:getGifImageRequest" name="getGifImageRequest"/>
+
+ <wsdl:output message="impl:getGifImageResponse" name="getGifImageResponse"/>
+
+ </wsdl:operation>
+
+ <wsdl:operation name="getPlainText">
+
+ <wsdl:input message="impl:getPlainTextRequest" name="getPlainTextRequest"/>
+
+ <wsdl:output message="impl:getPlainTextResponse" name="getPlainTextResponse"/>
+
+ </wsdl:operation>
+
+ <wsdl:operation name="getXmlText">
+
+ <wsdl:input message="impl:getXmlTextRequest" name="getXmlTextRequest"/>
+
+ <wsdl:output message="impl:getXmlTextResponse" name="getXmlTextResponse"/>
+
+ </wsdl:operation>
+
+ </wsdl:portType>
+
+ <wsdl:binding name="DataHandlerRpcEncSoapBinding" type="impl:DataHandlerRpcEnc">
+
+ <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+
+ <wsdl:operation name="getJpgImage">
+
+ <wsdlsoap:operation soapAction=""/>
+
+ <wsdl:input name="getJpgImageRequest">
+
+ <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://datahandler.attachments" use="encoded"/>
+
+ </wsdl:input>
+
+ <wsdl:output name="getJpgImageResponse">
+
+ <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://datahandler.attachments" use="encoded"/>
+
+ </wsdl:output>
+
+ </wsdl:operation>
+
+ <wsdl:operation name="getGifImage">
+
+ <wsdlsoap:operation soapAction=""/>
+
+ <wsdl:input name="getGifImageRequest">
+
+ <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://datahandler.attachments" use="encoded"/>
+
+ </wsdl:input>
+
+ <wsdl:output name="getGifImageResponse">
+
+ <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://datahandler.attachments" use="encoded"/>
+
+ </wsdl:output>
+
+ </wsdl:operation>
+
+ <wsdl:operation name="getPlainText">
+
+ <wsdlsoap:operation soapAction=""/>
+
+ <wsdl:input name="getPlainTextRequest">
+
+ <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://datahandler.attachments" use="encoded"/>
+
+ </wsdl:input>
+
+ <wsdl:output name="getPlainTextResponse">
+
+ <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://datahandler.attachments" use="encoded"/>
+
+ </wsdl:output>
+
+ </wsdl:operation>
+
+ <wsdl:operation name="getXmlText">
+
+ <wsdlsoap:operation soapAction=""/>
+
+ <wsdl:input name="getXmlTextRequest">
+
+ <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://datahandler.attachments" use="encoded"/>
+
+ </wsdl:input>
+
+ <wsdl:output name="getXmlTextResponse">
+
+ <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://datahandler.attachments" use="encoded"/>
+
+ </wsdl:output>
+
+ </wsdl:operation>
+
+ </wsdl:binding>
+
+ <wsdl:service name="DataHandlerRpcEncService">
+
+ <wsdl:port binding="impl:DataHandlerRpcEncSoapBinding" name="DataHandlerRpcEnc">
+
+ <wsdlsoap:address location="http://localhost:8080/ServiceControlDRT/attachments/datahandler/DataHandlerRpcEnc.jws"/>
+
+ </wsdl:port>
+
+ </wsdl:service>
+
+</wsdl:definitions>
Added: beehive/trunk/system-controls/test/webservice/servers/webapp/WEB-INF/src/org/apache/beehive/attachments/ByteArrayDataSource.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/system-controls/test/webservice/servers/webapp/WEB-INF/src/org/apache/beehive/attachments/ByteArrayDataSource.java?rev=357084&view=auto
==============================================================================
--- beehive/trunk/system-controls/test/webservice/servers/webapp/WEB-INF/src/org/apache/beehive/attachments/ByteArrayDataSource.java (added)
+++ beehive/trunk/system-controls/test/webservice/servers/webapp/WEB-INF/src/org/apache/beehive/attachments/ByteArrayDataSource.java Thu Dec 15 15:04:27 2005
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$
+ */
+
+package org.apache.beehive.attachments;
+
+import javax.activation.DataSource;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+/**
+ */
+public class ByteArrayDataSource implements DataSource {
+
+ private String contentType;
+ private byte[] data;
+ private String name;
+
+ public ByteArrayDataSource(String name, byte[] data, String contentType) {
+ this.name = name;
+ this.data = data;
+ this.contentType = contentType;
+ }
+
+ public String getContentType() {
+ return contentType;
+ }
+
+ public InputStream getInputStream() throws IOException {
+ return new ByteArrayInputStream(data);
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public OutputStream getOutputStream() throws IOException {
+ throw new IOException("ByteArrayDataSource cannot support getOutputStream.");
+ }
+}
Propchange: beehive/trunk/system-controls/test/webservice/servers/webapp/WEB-INF/src/org/apache/beehive/attachments/ByteArrayDataSource.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/system-controls/test/webservice/servers/webapp/WEB-INF/src/org/apache/beehive/attachments/DataHandlerAttachments.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/system-controls/test/webservice/servers/webapp/WEB-INF/src/org/apache/beehive/attachments/DataHandlerAttachments.java?rev=357084&view=auto
==============================================================================
--- beehive/trunk/system-controls/test/webservice/servers/webapp/WEB-INF/src/org/apache/beehive/attachments/DataHandlerAttachments.java (added)
+++ beehive/trunk/system-controls/test/webservice/servers/webapp/WEB-INF/src/org/apache/beehive/attachments/DataHandlerAttachments.java Thu Dec 15 15:04:27 2005
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$
+ */
+
+package org.apache.beehive.attachments;
+
+import javax.activation.DataHandler;
+import java.io.InputStream;
+import java.io.IOException;
+import java.io.ByteArrayOutputStream;
+
+/**
+ */
+public abstract class DataHandlerAttachments {
+
+ public abstract DataHandler getPlainText();
+
+ public abstract DataHandler getXmlText();
+
+ public abstract DataHandler getJpgImage();
+
+ public abstract DataHandler getGifImage();
+
+ protected abstract InputStream getResourceStream(String imageName);
+
+ protected byte[] loadImage(String imageName) {
+
+ InputStream is = getResourceStream(imageName);
+
+ byte[] buffer = new byte[1024];
+ byte[] content = null;
+ ByteArrayOutputStream os = new ByteArrayOutputStream();
+
+ try {
+ int count;
+ while ((count = is.read(buffer, 0, buffer.length)) > 0) {
+ os.write(buffer, 0, count);
+ }
+ content = os.toByteArray();
+ is.close();
+ os.close();
+
+ } catch (IOException ioe) {
+ ioe.printStackTrace();
+ return null;
+ }
+ return content;
+ }
+}
Propchange: beehive/trunk/system-controls/test/webservice/servers/webapp/WEB-INF/src/org/apache/beehive/attachments/DataHandlerAttachments.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/system-controls/test/webservice/servers/webapp/WEB-INF/webservices/attachments/datahandler/DataHandlerDocLitWrapped.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/system-controls/test/webservice/servers/webapp/WEB-INF/webservices/attachments/datahandler/DataHandlerDocLitWrapped.java?rev=357084&view=auto
==============================================================================
--- beehive/trunk/system-controls/test/webservice/servers/webapp/WEB-INF/webservices/attachments/datahandler/DataHandlerDocLitWrapped.java (added)
+++ beehive/trunk/system-controls/test/webservice/servers/webapp/WEB-INF/webservices/attachments/datahandler/DataHandlerDocLitWrapped.java Thu Dec 15 15:04:27 2005
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package attachments.datahandler;
+
+import org.apache.beehive.attachments.ByteArrayDataSource;
+import org.apache.beehive.attachments.DataHandlerAttachments;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+import javax.activation.DataHandler;
+import java.io.InputStream;
+
+/**
+ * Purpose:
+ */
+@WebService()
+@SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL,
+ parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
+public class DataHandlerDocLitWrapped extends DataHandlerAttachments {
+
+ @WebMethod()
+ public DataHandler getPlainText() {
+ return new DataHandler("Some plain text.", "text/plain");
+ }
+
+ @WebMethod()
+ public DataHandler getXmlText() {
+ return new DataHandler("<user><name>Fred</name></user>", "text/xml");
+ }
+
+ @WebMethod()
+ public DataHandler getJpgImage() {
+ byte[] img = loadImage("resources/bird1.jpg");
+ return new DataHandler(new org.apache.beehive.attachments.ByteArrayDataSource("Image data", img, "image/jpeg"));
+ }
+
+ @WebMethod()
+ public DataHandler getGifImage() {
+ byte[] img = loadImage("resources/beehive_logo.gif");
+ return new DataHandler(new ByteArrayDataSource("Image data", img, "image/gif"));
+ }
+
+ protected InputStream getResourceStream(String nm) {
+ return DataHandlerDocLitWrapped.class.getResourceAsStream(nm);
+ }
+}
Propchange: beehive/trunk/system-controls/test/webservice/servers/webapp/WEB-INF/webservices/attachments/datahandler/DataHandlerDocLitWrapped.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/system-controls/test/webservice/servers/webapp/WEB-INF/webservices/attachments/datahandler/DataHandlerRpcEnc.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/system-controls/test/webservice/servers/webapp/WEB-INF/webservices/attachments/datahandler/DataHandlerRpcEnc.java?rev=357084&view=auto
==============================================================================
--- beehive/trunk/system-controls/test/webservice/servers/webapp/WEB-INF/webservices/attachments/datahandler/DataHandlerRpcEnc.java (added)
+++ beehive/trunk/system-controls/test/webservice/servers/webapp/WEB-INF/webservices/attachments/datahandler/DataHandlerRpcEnc.java Thu Dec 15 15:04:27 2005
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package attachments.datahandler;
+
+import org.apache.beehive.attachments.ByteArrayDataSource;
+import org.apache.beehive.attachments.DataHandlerAttachments;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+import javax.activation.DataHandler;
+import java.io.InputStream;
+
+/**
+ * Purpose:
+ */
+@WebService()
+@SOAPBinding(style = SOAPBinding.Style.RPC, use = SOAPBinding.Use.ENCODED)
+public class DataHandlerRpcEnc extends DataHandlerAttachments {
+
+ @WebMethod()
+ public DataHandler getPlainText() {
+ return new DataHandler("Some plain text.", "text/plain");
+ }
+
+ @WebMethod()
+ public DataHandler getXmlText() {
+ return new DataHandler("<user><name>Fred</name></user>", "text/xml");
+ }
+
+ @WebMethod()
+ public DataHandler getJpgImage() {
+ byte[] img = loadImage("resources/bird1.jpg");
+ return new DataHandler(new ByteArrayDataSource("Image data", img, "image/jpeg"));
+ }
+
+ @WebMethod()
+ public DataHandler getGifImage() {
+ byte[] img = loadImage("resources/beehive_logo.gif");
+ return new DataHandler(new ByteArrayDataSource("Image data", img, "image/gif"));
+ }
+
+ protected InputStream getResourceStream(String nm) {
+ return DataHandlerRpcEnc.class.getResourceAsStream(nm);
+ }
+}
Propchange: beehive/trunk/system-controls/test/webservice/servers/webapp/WEB-INF/webservices/attachments/datahandler/DataHandlerRpcEnc.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/system-controls/test/webservice/servers/webapp/WEB-INF/webservices/attachments/datahandler/DataHandlerRpcLit.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/system-controls/test/webservice/servers/webapp/WEB-INF/webservices/attachments/datahandler/DataHandlerRpcLit.java?rev=357084&view=auto
==============================================================================
--- beehive/trunk/system-controls/test/webservice/servers/webapp/WEB-INF/webservices/attachments/datahandler/DataHandlerRpcLit.java (added)
+++ beehive/trunk/system-controls/test/webservice/servers/webapp/WEB-INF/webservices/attachments/datahandler/DataHandlerRpcLit.java Thu Dec 15 15:04:27 2005
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package attachments.datahandler;
+
+import org.apache.beehive.attachments.ByteArrayDataSource;
+import org.apache.beehive.attachments.DataHandlerAttachments;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+import javax.activation.DataHandler;
+import java.io.InputStream;
+
+/**
+ * Purpose:
+ */
+@WebService()
+@SOAPBinding(style = SOAPBinding.Style.RPC, use = SOAPBinding.Use.LITERAL)
+public class DataHandlerRpcLit extends DataHandlerAttachments {
+
+ @WebMethod()
+ public DataHandler getPlainText() {
+ return new DataHandler("Some plain text.", "text/plain");
+ }
+
+ @WebMethod()
+ public DataHandler getXmlText() {
+ return new DataHandler("<user><name>Fred</name></user>", "text/xml");
+ }
+
+ @WebMethod()
+ public DataHandler getJpgImage() {
+ byte[] img = loadImage("resources/bird1.jpg");
+ return new DataHandler(new ByteArrayDataSource("Image data", img, "image/jpeg"));
+ }
+
+ @WebMethod()
+ public DataHandler getGifImage() {
+ byte[] img = loadImage("resources/beehive_logo.gif");
+ return new DataHandler(new ByteArrayDataSource("Image data", img, "image/gif"));
+ }
+
+ protected InputStream getResourceStream(String nm) {
+ return DataHandlerRpcLit.class.getResourceAsStream(nm);
+ }
+}
Propchange: beehive/trunk/system-controls/test/webservice/servers/webapp/WEB-INF/webservices/attachments/datahandler/DataHandlerRpcLit.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/system-controls/test/webservice/servers/webapp/WEB-INF/webservices/attachments/datahandler/resources/beehive_logo.gif
URL: http://svn.apache.org/viewcvs/beehive/trunk/system-controls/test/webservice/servers/webapp/WEB-INF/webservices/attachments/datahandler/resources/beehive_logo.gif?rev=357084&view=auto
==============================================================================
Binary files /tmp/tmpEoy8FD and /tmp/tmpfzVFBR differ
Added: beehive/trunk/system-controls/test/webservice/servers/webapp/WEB-INF/webservices/attachments/datahandler/resources/bird1.jpg
URL: http://svn.apache.org/viewcvs/beehive/trunk/system-controls/test/webservice/servers/webapp/WEB-INF/webservices/attachments/datahandler/resources/bird1.jpg?rev=357084&view=auto
==============================================================================
Binary file - no diff available.
Propchange: beehive/trunk/system-controls/test/webservice/servers/webapp/WEB-INF/webservices/attachments/datahandler/resources/bird1.jpg
------------------------------------------------------------------------------
svn:mime-type = image/jpeg
Modified: beehive/trunk/system-controls/test/webservice/servers/webapp/WEB-INF/webservices/attachments/images/ImagesDocLitWrapped.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/system-controls/test/webservice/servers/webapp/WEB-INF/webservices/attachments/images/ImagesDocLitWrapped.java?rev=357084&r1=357083&r2=357084&view=diff
==============================================================================
--- beehive/trunk/system-controls/test/webservice/servers/webapp/WEB-INF/webservices/attachments/images/ImagesDocLitWrapped.java (original)
+++ beehive/trunk/system-controls/test/webservice/servers/webapp/WEB-INF/webservices/attachments/images/ImagesDocLitWrapped.java Thu Dec 15 15:04:27 2005
@@ -60,38 +60,4 @@
protected InputStream getResourceStream(String nm) {
return ImagesDocLitWrapped.class.getResourceAsStream(nm);
}
-// private Image loadImage(String imageName) {
-//
-// InputStream is = attachments.images.ImagesDocLitWrapped.class.getResourceAsStream(imageName);
-//
-// byte[] buffer = new byte[1024];
-// byte[] content = null;
-// ByteArrayOutputStream os = new ByteArrayOutputStream();
-//
-// try {
-// int count;
-// while ((count = is.read(buffer, 0, buffer.length)) > 0) {
-// os.write(buffer, 0, count);
-// }
-// content = os.toByteArray();
-// is.close();
-// os.close();
-//
-// } catch (IOException ioe) {
-// ioe.printStackTrace();
-// return null;
-// }
-//
-// MediaTracker tracker = new MediaTracker(new Component() {});
-// Image img = Toolkit.getDefaultToolkit().createImage(content);
-// tracker.addImage(img, 0);
-// try {
-// tracker.waitForAll();
-// }
-// catch (InterruptedException e) {
-// e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
-// }
-//
-// return img;
-// }
}
Added: beehive/trunk/system-controls/test/webservice/tests/org/apache/beehive/controls/system/webservice/units/DataHandlerAttachementDocLitWrappedTest.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/system-controls/test/webservice/tests/org/apache/beehive/controls/system/webservice/units/DataHandlerAttachementDocLitWrappedTest.java?rev=357084&view=auto
==============================================================================
--- beehive/trunk/system-controls/test/webservice/tests/org/apache/beehive/controls/system/webservice/units/DataHandlerAttachementDocLitWrappedTest.java (added)
+++ beehive/trunk/system-controls/test/webservice/tests/org/apache/beehive/controls/system/webservice/units/DataHandlerAttachementDocLitWrappedTest.java Thu Dec 15 15:04:27 2005
@@ -0,0 +1,141 @@
+/*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.beehive.controls.system.webservice.units;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import org.apache.beehive.controls.api.bean.Control;
+import org.apache.beehive.controls.system.webservice.units.utils.ControlTestCase;
+
+import javax.activation.DataHandler;
+import java.awt.*;
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+
+
+public class DataHandlerAttachementDocLitWrappedTest
+ extends ControlTestCase {
+
+ @Control
+ public test.DataHandlerDocLitWrappedService client;
+
+ public void testPlainText() throws Exception {
+ DataHandler dataHandler = client.getPlainText();
+ assertNotNull(dataHandler);
+ assertEquals("text/plain", dataHandler.getContentType());
+
+ String content = (String) dataHandler.getContent();
+ assertEquals("Some plain text.", content);
+ }
+
+ public void testXmlText() throws Exception {
+ DataHandler dataHandler = client.getXmlText();
+ assertNotNull(dataHandler);
+ assertEquals("text/xml", dataHandler.getContentType());
+
+ String content = (String) dataHandler.getContent();
+ assertEquals("<user><name>Fred</name></user>", content);
+ }
+
+ public void testJpgImage() throws Exception {
+ DataHandler dataHandler = client.getJpgImage();
+ assertNotNull(dataHandler);
+ assertEquals("image/jpeg", dataHandler.getContentType());
+
+ InputStream is = (InputStream) dataHandler.getContent();
+
+ byte[] buffer = new byte[1024];
+ byte[] content = null;
+ ByteArrayOutputStream os = new ByteArrayOutputStream();
+
+ int count;
+ while ((count = is.read(buffer, 0, buffer.length)) > 0) {
+ os.write(buffer, 0, count);
+ }
+ content = os.toByteArray();
+ is.close();
+ os.close();
+
+ MediaTracker tracker = new MediaTracker(new Component() {});
+ Image img = Toolkit.getDefaultToolkit().createImage(content);
+ tracker.addImage(img, 0);
+ try {
+ tracker.waitForAll();
+ }
+ catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ assertNotNull(img);
+ assertEquals(125, img.getHeight(null));
+ assertEquals(125, img.getWidth(null));
+ }
+
+ public void testGifImage() throws Exception {
+ DataHandler dataHandler = client.getGifImage();
+ assertNotNull(dataHandler);
+ assertEquals("image/gif", dataHandler.getContentType());
+
+ InputStream is = (InputStream) dataHandler.getContent();
+
+ byte[] buffer = new byte[1024];
+ byte[] content = null;
+ ByteArrayOutputStream os = new ByteArrayOutputStream();
+
+ int count;
+ while ((count = is.read(buffer, 0, buffer.length)) > 0) {
+ os.write(buffer, 0, count);
+ }
+ content = os.toByteArray();
+ is.close();
+ os.close();
+
+ MediaTracker tracker = new MediaTracker(new Component() {});
+ Image img = Toolkit.getDefaultToolkit().createImage(content);
+ tracker.addImage(img, 0);
+ try {
+ tracker.waitForAll();
+ }
+ catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ assertNotNull(img);
+ assertEquals(51, img.getHeight(null));
+ assertEquals(324, img.getWidth(null));
+ }
+
+ public void setUp() throws Exception {
+ try {
+ super.setUp();
+ initializeControls(this);
+ setMyControlObject(client);
+
+ }
+ catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ public DataHandlerAttachementDocLitWrappedTest() throws Exception {
+ }
+
+ public static Test suite() {
+ return new TestSuite(DataHandlerAttachementDocLitWrappedTest.class);
+ }
+
+ public static void main(String[] args) {
+ junit.textui.TestRunner.run(suite());
+ }
+}
\ No newline at end of file
Propchange: beehive/trunk/system-controls/test/webservice/tests/org/apache/beehive/controls/system/webservice/units/DataHandlerAttachementDocLitWrappedTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/system-controls/test/webservice/tests/org/apache/beehive/controls/system/webservice/units/DataHandlerAttachementRpcEncTest.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/system-controls/test/webservice/tests/org/apache/beehive/controls/system/webservice/units/DataHandlerAttachementRpcEncTest.java?rev=357084&view=auto
==============================================================================
--- beehive/trunk/system-controls/test/webservice/tests/org/apache/beehive/controls/system/webservice/units/DataHandlerAttachementRpcEncTest.java (added)
+++ beehive/trunk/system-controls/test/webservice/tests/org/apache/beehive/controls/system/webservice/units/DataHandlerAttachementRpcEncTest.java Thu Dec 15 15:04:27 2005
@@ -0,0 +1,141 @@
+/*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.beehive.controls.system.webservice.units;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import org.apache.beehive.controls.api.bean.Control;
+import org.apache.beehive.controls.system.webservice.units.utils.ControlTestCase;
+
+import javax.activation.DataHandler;
+import java.awt.*;
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+
+
+public class DataHandlerAttachementRpcEncTest
+ extends ControlTestCase {
+
+ @Control
+ public test.DataHandlerRpcEncService client;
+
+ public void testPlainText() throws Exception {
+ DataHandler dataHandler = client.getPlainText();
+ assertNotNull(dataHandler);
+ assertEquals("text/plain", dataHandler.getContentType());
+
+ String content = (String) dataHandler.getContent();
+ assertEquals("Some plain text.", content);
+ }
+
+ public void testXmlText() throws Exception {
+ DataHandler dataHandler = client.getXmlText();
+ assertNotNull(dataHandler);
+ assertEquals("text/xml", dataHandler.getContentType());
+
+ String content = (String) dataHandler.getContent();
+ assertEquals("<user><name>Fred</name></user>", content);
+ }
+
+ public void testJpgImage() throws Exception {
+ DataHandler dataHandler = client.getJpgImage();
+ assertNotNull(dataHandler);
+ assertEquals("image/jpeg", dataHandler.getContentType());
+
+ InputStream is = (InputStream) dataHandler.getContent();
+
+ byte[] buffer = new byte[1024];
+ byte[] content = null;
+ ByteArrayOutputStream os = new ByteArrayOutputStream();
+
+ int count;
+ while ((count = is.read(buffer, 0, buffer.length)) > 0) {
+ os.write(buffer, 0, count);
+ }
+ content = os.toByteArray();
+ is.close();
+ os.close();
+
+ MediaTracker tracker = new MediaTracker(new Component() {});
+ Image img = Toolkit.getDefaultToolkit().createImage(content);
+ tracker.addImage(img, 0);
+ try {
+ tracker.waitForAll();
+ }
+ catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ assertNotNull(img);
+ assertEquals(125, img.getHeight(null));
+ assertEquals(125, img.getWidth(null));
+ }
+
+ public void testGifImage() throws Exception {
+ DataHandler dataHandler = client.getGifImage();
+ assertNotNull(dataHandler);
+ assertEquals("image/gif", dataHandler.getContentType());
+
+ InputStream is = (InputStream) dataHandler.getContent();
+
+ byte[] buffer = new byte[1024];
+ byte[] content = null;
+ ByteArrayOutputStream os = new ByteArrayOutputStream();
+
+ int count;
+ while ((count = is.read(buffer, 0, buffer.length)) > 0) {
+ os.write(buffer, 0, count);
+ }
+ content = os.toByteArray();
+ is.close();
+ os.close();
+
+ MediaTracker tracker = new MediaTracker(new Component() {});
+ Image img = Toolkit.getDefaultToolkit().createImage(content);
+ tracker.addImage(img, 0);
+ try {
+ tracker.waitForAll();
+ }
+ catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ assertNotNull(img);
+ assertEquals(51, img.getHeight(null));
+ assertEquals(324, img.getWidth(null));
+ }
+
+ public void setUp() throws Exception {
+ try {
+ super.setUp();
+ initializeControls(this);
+ setMyControlObject(client);
+
+ }
+ catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ public DataHandlerAttachementRpcEncTest() throws Exception {
+ }
+
+ public static Test suite() {
+ return new TestSuite(DataHandlerAttachementRpcEncTest.class);
+ }
+
+ public static void main(String[] args) {
+ junit.textui.TestRunner.run(suite());
+ }
+}
\ No newline at end of file
Propchange: beehive/trunk/system-controls/test/webservice/tests/org/apache/beehive/controls/system/webservice/units/DataHandlerAttachementRpcEncTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/system-controls/test/webservice/tests/org/apache/beehive/controls/system/webservice/units/DataHandlerAttachementRpcLitTest.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/system-controls/test/webservice/tests/org/apache/beehive/controls/system/webservice/units/DataHandlerAttachementRpcLitTest.java?rev=357084&view=auto
==============================================================================
--- beehive/trunk/system-controls/test/webservice/tests/org/apache/beehive/controls/system/webservice/units/DataHandlerAttachementRpcLitTest.java (added)
+++ beehive/trunk/system-controls/test/webservice/tests/org/apache/beehive/controls/system/webservice/units/DataHandlerAttachementRpcLitTest.java Thu Dec 15 15:04:27 2005
@@ -0,0 +1,141 @@
+/*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.beehive.controls.system.webservice.units;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import org.apache.beehive.controls.api.bean.Control;
+import org.apache.beehive.controls.system.webservice.units.utils.ControlTestCase;
+
+import javax.activation.DataHandler;
+import java.awt.*;
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+
+
+public class DataHandlerAttachementRpcLitTest
+ extends ControlTestCase {
+
+ @Control
+ public test.DataHandlerRpcLitService client;
+
+ public void testPlainText() throws Exception {
+ DataHandler dataHandler = client.getPlainText();
+ assertNotNull(dataHandler);
+ assertEquals("text/plain", dataHandler.getContentType());
+
+ String content = (String) dataHandler.getContent();
+ assertEquals("Some plain text.", content);
+ }
+
+ public void testXmlText() throws Exception {
+ DataHandler dataHandler = client.getXmlText();
+ assertNotNull(dataHandler);
+ assertEquals("text/xml", dataHandler.getContentType());
+
+ String content = (String) dataHandler.getContent();
+ assertEquals("<user><name>Fred</name></user>", content);
+ }
+
+ public void testJpgImage() throws Exception {
+ DataHandler dataHandler = client.getJpgImage();
+ assertNotNull(dataHandler);
+ assertEquals("image/jpeg", dataHandler.getContentType());
+
+ InputStream is = (InputStream) dataHandler.getContent();
+
+ byte[] buffer = new byte[1024];
+ byte[] content = null;
+ ByteArrayOutputStream os = new ByteArrayOutputStream();
+
+ int count;
+ while ((count = is.read(buffer, 0, buffer.length)) > 0) {
+ os.write(buffer, 0, count);
+ }
+ content = os.toByteArray();
+ is.close();
+ os.close();
+
+ MediaTracker tracker = new MediaTracker(new Component() {});
+ Image img = Toolkit.getDefaultToolkit().createImage(content);
+ tracker.addImage(img, 0);
+ try {
+ tracker.waitForAll();
+ }
+ catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ assertNotNull(img);
+ assertEquals(125, img.getHeight(null));
+ assertEquals(125, img.getWidth(null));
+ }
+
+ public void testGifImage() throws Exception {
+ DataHandler dataHandler = client.getGifImage();
+ assertNotNull(dataHandler);
+ assertEquals("image/gif", dataHandler.getContentType());
+
+ InputStream is = (InputStream) dataHandler.getContent();
+
+ byte[] buffer = new byte[1024];
+ byte[] content = null;
+ ByteArrayOutputStream os = new ByteArrayOutputStream();
+
+ int count;
+ while ((count = is.read(buffer, 0, buffer.length)) > 0) {
+ os.write(buffer, 0, count);
+ }
+ content = os.toByteArray();
+ is.close();
+ os.close();
+
+ MediaTracker tracker = new MediaTracker(new Component() {});
+ Image img = Toolkit.getDefaultToolkit().createImage(content);
+ tracker.addImage(img, 0);
+ try {
+ tracker.waitForAll();
+ }
+ catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ assertNotNull(img);
+ assertEquals(51, img.getHeight(null));
+ assertEquals(324, img.getWidth(null));
+ }
+
+ public void setUp() throws Exception {
+ try {
+ super.setUp();
+ initializeControls(this);
+ setMyControlObject(client);
+
+ }
+ catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ public DataHandlerAttachementRpcLitTest() throws Exception {
+ }
+
+ public static Test suite() {
+ return new TestSuite(DataHandlerAttachementRpcLitTest.class);
+ }
+
+ public static void main(String[] args) {
+ junit.textui.TestRunner.run(suite());
+ }
+}
\ No newline at end of file
Propchange: beehive/trunk/system-controls/test/webservice/tests/org/apache/beehive/controls/system/webservice/units/DataHandlerAttachementRpcLitTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: beehive/trunk/wsm/src/axis/org/apache/beehive/wsm/axis/ServiceDescriptionFactory.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/wsm/src/axis/org/apache/beehive/wsm/axis/ServiceDescriptionFactory.java?rev=357084&r1=357083&r2=357084&view=diff
==============================================================================
--- beehive/trunk/wsm/src/axis/org/apache/beehive/wsm/axis/ServiceDescriptionFactory.java (original)
+++ beehive/trunk/wsm/src/axis/org/apache/beehive/wsm/axis/ServiceDescriptionFactory.java Thu Dec 15 15:04:27 2005
@@ -178,13 +178,18 @@
}
if (qn == null) {
-
Class type = returnType;
if (type.isArray()) {
type = type.getComponentType();
}
- // todo: don't mess with if image attachement
- if (!java.awt.Image.class.isAssignableFrom(type)) {
+
+ if (isActivationEnabled() && java.awt.Image.class.isAssignableFrom(type)) {
+ ; // do nothing - axis will have already set value correctly
+ }
+ else if (isActivationEnabled() && getDataHandlerClass().isAssignableFrom(type)) {
+ ; // do nothing - axis will have already set value correctly
+ }
+ else {
qn = configureTypeMapping(sd, returnType, meth.getWrTargetNamespace());
od.setReturnType(qn);
od.setReturnClass(returnType);
Modified: beehive/trunk/wsm/src/axis/org/apache/beehive/wsm/axis/databinding/AxisLookupService.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/wsm/src/axis/org/apache/beehive/wsm/axis/databinding/AxisLookupService.java?rev=357084&r1=357083&r2=357084&view=diff
==============================================================================
--- beehive/trunk/wsm/src/axis/org/apache/beehive/wsm/axis/databinding/AxisLookupService.java (original)
+++ beehive/trunk/wsm/src/axis/org/apache/beehive/wsm/axis/databinding/AxisLookupService.java Thu Dec 15 15:04:27 2005
@@ -89,10 +89,18 @@
return tm.getClassForQName(qType);
}
- /* special case for Images */
- if (Constants.NS_URI_XMLSOAP.equals(qType.getNamespaceURI())
- && ("Image".equals(qType.getLocalPart()) || "Image[]".equals(qType.getLocalPart()))) {
- return java.awt.Image.class;
+ /* special case for apache xml soap types */
+ if (Constants.NS_URI_XMLSOAP.equals(qType.getNamespaceURI())) {
+ if ("Image".equals(qType.getLocalPart()) || "Image[]".equals(qType.getLocalPart())) {
+ return java.awt.Image.class;
+ } else if ("DataHandler".equals(qType.getLocalPart()) || "DataHandler[]".equals(qType.getLocalPart())) {
+ try {
+ return Class.forName("javax.activation.DataHandler");
+ }
+ catch (ClassNotFoundException e) {
+ // fall through
+ }
+ }
}
String packageName = getPackageNameFromQName(qType);