http://mypage.iu.edu/~ehauser/attachment-test.tar.gz
Dhanush Gopinath wrote:
Eric..
I have got more to help you ..
I made a test interface as per your web services methods.
Added activation.jar and mail.jar to the class path and executed the Java2Wsdl tool ..
I got the WSDL which is attached.. it clearly mentions
<wsdl:message name="storeRequest">
<wsdl:part name="in0" type="apachesoap:DataHandler"/>
</wsdl:message>
and
<wsdl:message name="retrieveResponse">
<wsdl:part name="retrieveReturn" type="apachesoap:DataHandler"/>
</wsdl:message>
Now i hope things are pretty clear and will be helpful to you
This is the Java class i wrote from ur description
import javax.activation.DataHandler;
public class EricTest
{
public String store(DataHandler data) throws Exception
{
return "Success";
}
public DataHandler retrieve(String key) throws Exception
{
return null;
}
}
Please Make sure that U add activation.jar and mail.jar while you run the java2wsdl tool also. Please find the attached WSDL file <<TestEricService.wsdl>>
Regards
Dhanush
----- Original Message ----- *From:* Eric Hauser <mailto:[EMAIL PROTECTED]> *To:* [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> *Sent:* Tuesday, May 25, 2004 12:36 AM *Subject:* Re: Typemapping for DataHandler
Dhanush,
Thanks for the response. This is what my interface looks like:
public String store(DataHandler data) throws TransactionHistoryException;
public DataHandler retrieve(String key) throws TransactionHistoryException;
When I run the WSDL2Java task, I get the following error:
[axis-wsdl2java] WSDL2Java http://localhost:8080//apps/transaction/history/services/TransactionHistoryService?wsdl Parsing XML file: http://localhost:8080//apps/transaction/history/services/TransactionHistoryService?wsdl [axis-wsdl2java] java.io.IOException: Type {http://service.history.transaction.ai}DataHandler is referenced but not defined.
My WSDL file generated with tns1 as the namespace for the DataHandler type. I'm a little stumped, but I also haven't had any time to work on this. If there was a problem with DataHandler being defined, shouldn't that show up when I deploy the service?
Dhanush Gopinath wrote:
> Eric ,
> > I still dont know your interface definition. But still I will
comment on
> this as i have did a bit of R&D on this.
> > Lets assume u have a function in ur Webservice
> public string store (javax.activation.DataHandler dh) {}
> Now once u create WSDL file using java2wsdl tool. It should
generate a
> wsdl in which the parameter dh maps to a type apachesoap:DataHandler
> > <wsdl:message name="storeRequest">* *
> * * <wsdl:part name="*in0*" type="*apachesoap:DataHandler*" />
> </wsdl:message>
> > and then when u run WSDL2JAVA tool u will get the Stubs and
Skeletons
> and deploy.wsdd.
> > For me there was no typeMapping in it since I assume that its
already
> mapped in the WSDL. ( I dunno whether I am right here .. ) .
> > My Service did work fine and perfect where i could pass attachments.
> > > > Regards
> Dhanush
> > >
> ----- Original Message -----
> *From:* Eric Hauser <mailto:[EMAIL PROTECTED]>
> *To:* [EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> <mailto:[EMAIL PROTECTED]>
> *Sent:* Friday, May 21, 2004 10:39 PM
> *Subject:* Typemapping for DataHandler
>
> I'm having some issues using a typeMapping to define a
DataHandler.
> What I'm trying to write a service using attachements (which
is very
> similar to the echo example). The admin client deploys the
service
> fine, however there isn't a complex mapping for DataHandler. Here's my
> deploy.wsdd:
>
> <?xml version="1.0"?>
> <deployment xmlns="http://xml.apache.org/axis/wsdd/"
> xmlns:java="http://xml.apache.org/axis/wsdd/providers/java"
> > xmlns:transactionHistory="http://service.history.transaction.ai">
> <service name="TransactionHistoryService"
provider="java:RPC">
> > <endpointURL>http://localhost:8080/apps/transaction/history/services/TransactionHistoryService</endpointURL>
> > <namespace>http://localhost:8080/apps/transaction/history/services/TransactionHistoryService</namespace>
> <parameter name="className"
> value="ai.transaction.history.service.TransactionHistoryService" />
> <parameter name="wsdlServiceElement"
> value="TransactionHistoryService" />
> <parameter name="allowedMethods"
value="store,retrieve" />
> <operation name="retrieve" returnQName="data"
> returnType="ns1:DataHandler">
> <parameter name="key" type="tns:string"
> xmlns:tns="http://www.w3.org/2001/XMLSchema" />
> </operation>
> <operation name="store" returnQName="key"
> returnType="tns:string"
xmlns:tns="http://www.w3.org/2001/XMLSchema">
> <parameter name="data" type="ns1:DataHandler" />
> <typeMapping
> > deserializer="org.apache.axis.encoding.ser.JAFDataHandlerDeserializerFactory"
> > languageSpecificType="java:javax.activation.DataHandler"
> qname="transactionHistory:DataHandler"
> > serializer="org.apache.axis.encoding.ser.JAFDataHandlerSerializerFactory"
> > encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
> <beanMapping
> > qname="transactionHistory:TransactionHistoryException"
> > xmlns:transactionHistory="http://service.history.transaction.ai"
> > languageSpecificType="java:ai.transaction.history.exception.TransactionHistoryException"
>
> />
> </service>
> </deployment>
>
> I also attached the wsdl file that it generates. It seems to
generate
> fine, except there isn't a mapping for DataHandler. Also, out of
> curiousity, has anyone tried to do a service like this that
works with
> both Java and .NET? I saw some stuff in the example about
setting DIME
> encoding which I assuming is for .NET interoperability. Thanks in
> advance.
>
> --
> Eric W. Hauser
> Application Developer
> accessIndiana..."linking hoosiers to government"
> http://www.IN.gov
> 10 W. Market St., Suite 600
> Indianapolis, IN 46204
> Phone: (317) 233-4007
> Fax: (317) 233-2011
>
> **********************************************************************
> CONFIDENTIALITY NOTICE:
> This E-mail and any attachments are confidential. If you are
not the
> intended recipient, you do not have permission to disclose, copy,
> distribute, or open any attachments. If you have received
this E-mail
> in error, please notify us immediately by returning it to the
sender
> and
> delete this copy from your system.
> Thank you.
> accessIndiana, MyLocal.IN.gov, CivicNet
> **********************************************************************
>
> ------------------------------------------------------------------------
>
> <?xml version="1.0" encoding="UTF-8"?>
> <wsdl:definitions
> targetNamespace="http://localhost:8080/apps/transaction/history/services/TransactionHistoryService"
> xmlns="http://schemas.xmlsoap.org/wsdl/"
> xmlns:apachesoap="http://xml.apache.org/xml-soap"
> xmlns:impl="http://localhost:8080/apps/transaction/history/services/TransactionHistoryService"
> xmlns:intf="http://localhost:8080/apps/transaction/history/services/TransactionHistoryService"
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:tns1="http://service.history.transaction.ai"
> 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.2beta
> Built on Mar 31, 2004 (12:47:03 EST)-->
> <wsdl:types>
> <schema targetNamespace="http://service.history.transaction.ai"
> xmlns="http://www.w3.org/2001/XMLSchema">
> <import
namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
> <complexType name="TransactionHistoryException">
> <sequence/>
> </complexType>
> </schema>
> </wsdl:types>
>
> <wsdl:message name="storeRequest">
>
> <wsdl:part name="data" type="tns1:DataHandler"/>
>
> </wsdl:message>
>
> <wsdl:message name="retrieveResponse">
>
> <wsdl:part name="data" type="tns1:DataHandler"/>
>
> </wsdl:message>
>
> <wsdl:message name="TransactionHistoryException">
>
> <wsdl:part name="fault"
type="tns1:TransactionHistoryException"/>
>
> </wsdl:message>
>
> <wsdl:message name="retrieveRequest">
>
> <wsdl:part name="key" type="xsd:string"/>
>
> </wsdl:message>
>
> <wsdl:message name="storeResponse">
>
> <wsdl:part name="key" type="xsd:string"/>
>
> </wsdl:message>
>
> <wsdl:portType name="TransactionHistoryService">
>
> <wsdl:operation name="retrieve" parameterOrder="key">
>
> <wsdl:input message="impl:retrieveRequest"
> name="retrieveRequest"/>
>
> <wsdl:output message="impl:retrieveResponse"
> name="retrieveResponse"/>
>
> <wsdl:fault message="impl:TransactionHistoryException"
> name="TransactionHistoryException"/>
>
> </wsdl:operation>
>
> <wsdl:operation name="store" parameterOrder="data">
>
> <wsdl:input message="impl:storeRequest"
name="storeRequest"/>
>
> <wsdl:output message="impl:storeResponse"
> name="storeResponse"/>
>
> <wsdl:fault message="impl:TransactionHistoryException"
> name="TransactionHistoryException"/>
>
> </wsdl:operation>
>
> </wsdl:portType>
>
> <wsdl:binding name="TransactionHistoryServiceSoapBinding"
> type="impl:TransactionHistoryService">
>
> <wsdlsoap:binding style="rpc"
> transport="http://schemas.xmlsoap.org/soap/http"/>
>
> <wsdl:operation name="retrieve">
>
> <wsdlsoap:operation soapAction=""/>
>
> <wsdl:input name="retrieveRequest">
>
> <wsdlsoap:body
> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> namespace="http://localhost:8080/apps/transaction/history/services/TransactionHistoryService"
> use="encoded"/>
>
> </wsdl:input>
>
> <wsdl:output name="retrieveResponse">
>
> <wsdlsoap:body
> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> namespace="http://localhost:8080/apps/transaction/history/services/TransactionHistoryService"
> use="encoded"/>
>
> </wsdl:output>
>
> <wsdl:fault name="TransactionHistoryException">
>
> <wsdlsoap:fault
> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> name="TransactionHistoryException"
> namespace="http://localhost:8080/apps/transaction/history/services/TransactionHistoryService"
> use="encoded"/>
>
> </wsdl:fault>
>
> </wsdl:operation>
>
> <wsdl:operation name="store">
>
> <wsdlsoap:operation soapAction=""/>
>
> <wsdl:input name="storeRequest">
>
> <wsdlsoap:body
> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> namespace="http://localhost:8080/apps/transaction/history/services/TransactionHistoryService"
> use="encoded"/>
>
> </wsdl:input>
>
> <wsdl:output name="storeResponse">
>
> <wsdlsoap:body
> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> namespace="http://localhost:8080/apps/transaction/history/services/TransactionHistoryService"
> use="encoded"/>
>
> </wsdl:output>
>
> <wsdl:fault name="TransactionHistoryException">
>
> <wsdlsoap:fault
> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> name="TransactionHistoryException"
> namespace="http://localhost:8080/apps/transaction/history/services/TransactionHistoryService"
> use="encoded"/>
>
> </wsdl:fault>
>
> </wsdl:operation>
>
> </wsdl:binding>
>
> <wsdl:service name="TransactionHistoryService">
>
> <wsdl:port
binding="impl:TransactionHistoryServiceSoapBinding"
> name="TransactionHistoryService">
>
> <wsdlsoap:address
> location="http://localhost:8080/apps/transaction/history/services/TransactionHistoryService"/>
>
> </wsdl:port>
>
> </wsdl:service>
>
> </wsdl:definitions>
>
> *********************************************************
> Disclaimer: >
> This message (including any attachments) contains
> confidential information intended for a specific
> individual and purpose, and is protected by law.
> If you are not the intended recipient, you should
> delete this message and are hereby notified that
> any disclosure, copying, or distribution of this
> message, or the taking of any action based on it,
> is strictly prohibited.
>
> *********************************************************
> Visit us at http://www.mahindrabt.com
>
>
-- Eric W. Hauser
Application Developer
accessIndiana..."linking hoosiers to government"
http://www.IN.gov
10 W. Market St., Suite 600
Indianapolis, IN 46204
Phone: (317) 233-4007
Fax: (317) 233-2011
********************************************************************** CONFIDENTIALITY NOTICE: This E-mail and any attachments are confidential. If you are not the intended recipient, you do not have permission to disclose, copy, distribute, or open any attachments. If you have received this E-mail in error, please notify us immediately by returning it to the sender and delete this copy from your system. Thank you. accessIndiana, MyLocal.IN.gov, CivicNet **********************************************************************
*********************************************************
Disclaimer:
This message (including any attachments) contains confidential information intended for a specific individual and purpose, and is protected by law. If you are not the intended recipient, you should delete this message and are hereby notified that any disclosure, copying, or distribution of this message, or the taking of any action based on it, is strictly prohibited.
********************************************************* Visit us at http://www.mahindrabt.com
-- Eric W. Hauser Application Developer accessIndiana..."linking hoosiers to government" http://www.IN.gov 10 W. Market St., Suite 600 Indianapolis, IN 46204 Phone: (317) 233-4007 Fax: (317) 233-2011
**********************************************************************
CONFIDENTIALITY NOTICE:
This E-mail and any attachments are confidential. If you are not the intended recipient, you do not have permission to disclose, copy, distribute, or open any attachments. If you have received this E-mail
in error, please notify us immediately by returning it to the sender and delete this copy from your system.
Thank you.
accessIndiana, MyLocal.IN.gov, CivicNet
**********************************************************************
