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 Qwzrl <qw...@tiscali.nl> on 2004/12/22 20:24:32 UTC
Attachements and .Net: The datatype 'DataHandler' is missing
I'm trying to make a testapp -using my own deployment, without the
axis.war- using attachements. I can't get it to work, Googled near and
far, surfed high and low looking for an answer. Hopefully I'll be able to
get it here. And yes, happyaxis.jsp claims attachement support should be
there (all the required jars are found).
When I use the Microsoft.NET wsdl.exe tool to create C# stubs I get the
following error:
Microsoft (R) Web Services Description Language Utility
[Microsoft (R) .NET Framework, Version 1.1.4322.573]
Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.
Error: Unable to import binding 'DeziroSoapBinding' from namespace
'http://localhost/api/Deziro'.
- Unable to import operation 'doAttachement'.
- The datatype 'DataHandler' is missing.
If you would like more help, please type "wsdl /?".
Using the wsdl tool from Apache I get a nice stub for my service:
package com.cuhka.soap.service;
public interface Deziro extends java.rmi.Remote {
public javax.activation.DataHandler doAttachement() throws
java.rmi.RemoteException;
public com.cuhka.soap.model.SomeType doFoo(java.lang.String foo,
java.lang.String bar) throws java.rmi.RemoteException;
}
Note that I've mapped 'SomeData' to 'SomeType', but it works fine.
The "service" I have created looks as follows:
package net.lerutte.deziro.soap;
public class Deziro {
public DataHandler doAttachement() {
return null;
}
public SomeData doFoo(String foo,String bar) {
return new SomeData();
}
}
My /WEB-INF/server-config.wsdd is as follows:
<?xml version="1.0" encoding="UTF-8"?>
<deployment xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java"
xmlns:deziro="urn:Deziro">
<handler name="LocalResponder"
type="java:org.apache.axis.transport.local.LocalResponder"/>
<handler name="URLMapper"
type="java:org.apache.axis.handlers.http.URLMapper"/>
<handler name="Authenticate"
type="java:org.apache.axis.handlers.SimpleAuthenticationHandler"/>
<service name="Deziro" provider="java:RPC">
<parameter name="className" value="net.lerutte.deziro.soap.Deziro"/>
<parameter name="allowedMethods" value="*"/>
</service>
<transport name="http">
<requestFlow>
<handler type="URLMapper"/>
<handler type="java:org.apache.axis.handlers.http.HTTPAuthHandler"/>
</requestFlow>
<parameter name="qs:list"
value="org.apache.axis.transport.http.QSListHandler"/>
<parameter name="qs:wsdl"
value="org.apache.axis.transport.http.QSWSDLHandler"/>
<parameter name="qs:method"
value="org.apache.axis.transport.http.QSMethodHandler"/>
</transport>
<transport name="local">
<responseFlow>
<handler type="LocalResponder"/>
</responseFlow>
</transport>
<beanMapping languageSpecificType="java:net.lerutte.deziro.soap.SomeData"
qname="cuhka:SomeType" xmlns:cuhka="http://www.cuhka.com/soap"/>
<typeMapping
deserializer="org.apache.axis.encoding.ser.JAFDataHandlerDeserializerFactory"
languageSpecificType="java:javax.activation.DataHandler"
qname="deziro:DataHandler"
serializer="org.apache.axis.encoding.ser.JAFDataHandlerSerializerFactory"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
/>
</deployment>
The wsdl, generated by Axis is as follows
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://localhost/api/Deziro"
xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:impl="http://localhost/api/Deziro"
xmlns:intf="http://localhost/api/Deziro"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns1="http://www.cuhka.com/soap"
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.2RC2
Built on Nov 16, 2004 (12:19:44 EST)-->
<wsdl:types>
<schema targetNamespace="http://www.cuhka.com/soap"
xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://xml.apache.org/xml-soap"/>
<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
<complexType name="SomeType">
<sequence>
<element name="bar" nillable="true" type="soapenc:string"/>
<element name="foo" nillable="true" type="soapenc:string"/>
<element name="fubar" nillable="true" type="soapenc:string"/>
<element name="timestamp" nillable="true" type="xsd:dateTime"/>
</sequence>
</complexType>
</schema>
</wsdl:types>
<wsdl:message name="doFooRequest">
<wsdl:part name="foo" type="soapenc:string"/>
<wsdl:part name="bar" type="soapenc:string"/>
</wsdl:message>
<wsdl:message name="doAttachementRequest">
</wsdl:message>
<wsdl:message name="doAttachementResponse">
<wsdl:part name="doAttachementReturn" type="apachesoap:DataHandler"/>
</wsdl:message>
<wsdl:message name="doFooResponse">
<wsdl:part name="doFooReturn" type="tns1:SomeType"/>
</wsdl:message>
<wsdl:portType name="Deziro">
<wsdl:operation name="doAttachement">
<wsdl:input message="impl:doAttachementRequest"
name="doAttachementRequest"/>
<wsdl:output message="impl:doAttachementResponse"
name="doAttachementResponse"/>
</wsdl:operation>
<wsdl:operation name="doFoo" parameterOrder="foo bar">
<wsdl:input message="impl:doFooRequest" name="doFooRequest"/>
<wsdl:output message="impl:doFooResponse" name="doFooResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="DeziroSoapBinding" type="impl:Deziro">
<wsdlsoap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="doAttachement">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="doAttachementRequest">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://soap.deziro.lerutte.net" use="encoded"/>
</wsdl:input>
<wsdl:output name="doAttachementResponse">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://localhost/api/Deziro" use="encoded"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="doFoo">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="doFooRequest">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://soap.deziro.lerutte.net" use="encoded"/>
</wsdl:input>
<wsdl:output name="doFooResponse">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://localhost/api/Deziro" use="encoded"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="DeziroService">
<wsdl:port binding="impl:DeziroSoapBinding" name="Deziro">
<wsdlsoap:address location="http://localhost/api/Deziro"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Re: Attachements and .Net: The datatype 'DataHandler' is missing
Posted by Praveen Peddi <pp...@contextmedia.com>.
I was also having the same exact problem (except that my input argument to
one of the methods is DataHandler).
I searched the previous mails on this topic and no one seems to have
suggested a good answer. Atleast I could find out that using DataHandler is
not a good solutions if you want to support non-java application. But whats
the best solution for this?
Praveen
----- Original Message -----
From: "Qwzrl" <qw...@tiscali.nl>
To: <ax...@ws.apache.org>
Sent: Wednesday, December 22, 2004 2:24 PM
Subject: Attachements and .Net: The datatype 'DataHandler' is missing
> I'm trying to make a testapp -using my own deployment, without the
> axis.war- using attachements. I can't get it to work, Googled near and
> far, surfed high and low looking for an answer. Hopefully I'll be able to
> get it here. And yes, happyaxis.jsp claims attachement support should be
> there (all the required jars are found).
>
> When I use the Microsoft.NET wsdl.exe tool to create C# stubs I get the
> following error:
>
> Microsoft (R) Web Services Description Language Utility
> [Microsoft (R) .NET Framework, Version 1.1.4322.573]
> Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.
>
> Error: Unable to import binding 'DeziroSoapBinding' from namespace
> 'http://localhost/api/Deziro'.
> - Unable to import operation 'doAttachement'.
> - The datatype 'DataHandler' is missing.
>
> If you would like more help, please type "wsdl /?".
>
> Using the wsdl tool from Apache I get a nice stub for my service:
> package com.cuhka.soap.service;
>
> public interface Deziro extends java.rmi.Remote {
> public javax.activation.DataHandler doAttachement() throws
> java.rmi.RemoteException;
> public com.cuhka.soap.model.SomeType doFoo(java.lang.String foo,
> java.lang.String bar) throws java.rmi.RemoteException;
> }
>
> Note that I've mapped 'SomeData' to 'SomeType', but it works fine.
>
> The "service" I have created looks as follows:
> package net.lerutte.deziro.soap;
>
> public class Deziro {
>
>
> public DataHandler doAttachement() {
> return null;
> }
>
> public SomeData doFoo(String foo,String bar) {
> return new SomeData();
> }
> }
>
> My /WEB-INF/server-config.wsdd is as follows:
> <?xml version="1.0" encoding="UTF-8"?>
> <deployment xmlns="http://xml.apache.org/axis/wsdd/"
> xmlns:java="http://xml.apache.org/axis/wsdd/providers/java"
> xmlns:deziro="urn:Deziro">
> <handler name="LocalResponder"
> type="java:org.apache.axis.transport.local.LocalResponder"/>
> <handler name="URLMapper"
> type="java:org.apache.axis.handlers.http.URLMapper"/>
> <handler name="Authenticate"
> type="java:org.apache.axis.handlers.SimpleAuthenticationHandler"/>
>
> <service name="Deziro" provider="java:RPC">
> <parameter name="className" value="net.lerutte.deziro.soap.Deziro"/>
> <parameter name="allowedMethods" value="*"/>
> </service>
>
> <transport name="http">
> <requestFlow>
> <handler type="URLMapper"/>
> <handler type="java:org.apache.axis.handlers.http.HTTPAuthHandler"/>
> </requestFlow>
>
> <parameter name="qs:list"
> value="org.apache.axis.transport.http.QSListHandler"/>
> <parameter name="qs:wsdl"
> value="org.apache.axis.transport.http.QSWSDLHandler"/>
> <parameter name="qs:method"
> value="org.apache.axis.transport.http.QSMethodHandler"/>
> </transport>
>
> <transport name="local">
> <responseFlow>
> <handler type="LocalResponder"/>
> </responseFlow>
> </transport>
>
> <beanMapping languageSpecificType="java:net.lerutte.deziro.soap.SomeData"
> qname="cuhka:SomeType" xmlns:cuhka="http://www.cuhka.com/soap"/>
>
> <typeMapping
> deserializer="org.apache.axis.encoding.ser.JAFDataHandlerDeserializerFactory"
> languageSpecificType="java:javax.activation.DataHandler"
> qname="deziro:DataHandler"
> serializer="org.apache.axis.encoding.ser.JAFDataHandlerSerializerFactory"
> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> />
> </deployment>
>
> The wsdl, generated by Axis is as follows
>
> <?xml version="1.0" encoding="UTF-8"?>
> <wsdl:definitions targetNamespace="http://localhost/api/Deziro"
> xmlns:apachesoap="http://xml.apache.org/xml-soap"
> xmlns:impl="http://localhost/api/Deziro"
> xmlns:intf="http://localhost/api/Deziro"
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:tns1="http://www.cuhka.com/soap"
> 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.2RC2
> Built on Nov 16, 2004 (12:19:44 EST)-->
> <wsdl:types>
> <schema targetNamespace="http://www.cuhka.com/soap"
> xmlns="http://www.w3.org/2001/XMLSchema">
> <import namespace="http://xml.apache.org/xml-soap"/>
> <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
> <complexType name="SomeType">
> <sequence>
> <element name="bar" nillable="true" type="soapenc:string"/>
> <element name="foo" nillable="true" type="soapenc:string"/>
> <element name="fubar" nillable="true" type="soapenc:string"/>
> <element name="timestamp" nillable="true" type="xsd:dateTime"/>
> </sequence>
> </complexType>
> </schema>
> </wsdl:types>
>
> <wsdl:message name="doFooRequest">
>
> <wsdl:part name="foo" type="soapenc:string"/>
>
> <wsdl:part name="bar" type="soapenc:string"/>
>
> </wsdl:message>
>
> <wsdl:message name="doAttachementRequest">
>
> </wsdl:message>
>
> <wsdl:message name="doAttachementResponse">
>
> <wsdl:part name="doAttachementReturn"
> type="apachesoap:DataHandler"/>
>
> </wsdl:message>
>
> <wsdl:message name="doFooResponse">
>
> <wsdl:part name="doFooReturn" type="tns1:SomeType"/>
>
> </wsdl:message>
>
> <wsdl:portType name="Deziro">
>
> <wsdl:operation name="doAttachement">
>
> <wsdl:input message="impl:doAttachementRequest"
> name="doAttachementRequest"/>
>
> <wsdl:output message="impl:doAttachementResponse"
> name="doAttachementResponse"/>
>
> </wsdl:operation>
>
> <wsdl:operation name="doFoo" parameterOrder="foo bar">
>
> <wsdl:input message="impl:doFooRequest" name="doFooRequest"/>
>
> <wsdl:output message="impl:doFooResponse" name="doFooResponse"/>
>
> </wsdl:operation>
>
> </wsdl:portType>
>
> <wsdl:binding name="DeziroSoapBinding" type="impl:Deziro">
>
> <wsdlsoap:binding style="rpc"
> transport="http://schemas.xmlsoap.org/soap/http"/>
>
> <wsdl:operation name="doAttachement">
>
> <wsdlsoap:operation soapAction=""/>
>
> <wsdl:input name="doAttachementRequest">
>
> <wsdlsoap:body
> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> namespace="http://soap.deziro.lerutte.net" use="encoded"/>
>
> </wsdl:input>
>
> <wsdl:output name="doAttachementResponse">
>
> <wsdlsoap:body
> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> namespace="http://localhost/api/Deziro" use="encoded"/>
>
> </wsdl:output>
>
> </wsdl:operation>
>
> <wsdl:operation name="doFoo">
>
> <wsdlsoap:operation soapAction=""/>
>
> <wsdl:input name="doFooRequest">
>
> <wsdlsoap:body
> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> namespace="http://soap.deziro.lerutte.net" use="encoded"/>
>
> </wsdl:input>
>
> <wsdl:output name="doFooResponse">
>
> <wsdlsoap:body
> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> namespace="http://localhost/api/Deziro" use="encoded"/>
>
> </wsdl:output>
>
> </wsdl:operation>
>
> </wsdl:binding>
>
> <wsdl:service name="DeziroService">
>
> <wsdl:port binding="impl:DeziroSoapBinding" name="Deziro">
>
> <wsdlsoap:address location="http://localhost/api/Deziro"/>
>
> </wsdl:port>
>
> </wsdl:service>
>
> </wsdl:definitions>