users@jax-rpc.java.net

Re: DII client programming...

From: Phil Goodwin <Phil.Goodwin_at_Sun.COM>
Date: Mon, 09 Sep 2002 14:10:00 -0700

In order for DII to recognize your types you have to register
serializers in the TypeMappingRegistry. These serializers must either be
generated by the tool or written by hand. Your documentation should tell
you how to write serializers for your particular platform. Be aware that
DII is considered to be an advanced feature of JAXRPC. The normal way to
access a web service is through the code generation tools.

Tevoi Andrea wrote:

>Thanks.
>So, Why "java.io.IOException: No serializer found for class com.cadit.ws.xas.city.servizi.DOCUMENT in registry org.apache.axis.encoding.TypeMappingImpl_at_55d93d" ?
>What should I do to pass a DOCUMENT object to invoke method?
>
>It seems that DII works only with simple types like string, integer...
>
>But, if I have to pass an instance of a class of my own (like DOCUMENT)?
>
>Andrea Tevoi
>
>
>-----Original Message-----
>From: Phil Goodwin [mailto:phil.goodwin_at_SFBAY.SUN.COM]
>Sent: gioved? 5 settembre 2002 22.03
>To: JAXRPC-INTEREST_at_JAVA.SUN.COM
>Subject: Re: DII client programming...
>
>
>DII is not required to construct client side artifacts or to register
>serializers for them on your behalf. If DII client code wishes to take
>advantage of generated artifacts then those artifacts should be
>available on the classpath and the serializers for them should be
>properly registered with the TypeMappingRegistry in the Service object.
>
>Tevoi Andrea wrote:
>
>>Hi,
>>
>>I'm trying to invoke a web service using DII:
>>
>>String wsdlUrl = "http://tevoi:8000/XasWebService/work/A2GWGI1_01_Net.wsdl";
>>String wsdlNamespace = "http://www.cadit.it/city/servizi/wsdl/AF/A2GWGI1_01";
>>String wsdlServiceName = "A2GWGI1_01Service";
>>String wsdlPortName = "A2GWGI1_01ServiceSoap";
>>String wsdlOperationName = "ServiceOperation";
>>QName serviceName = new QName(wsdlNamespace, wsdlServiceName);
>>QName portName = new QName(wsdlNamespace, wsdlPortName);
>>QName operationName = new QName(wsdlNamespace, wsdlOperationName);
>>ServiceFactory sF = ServiceFactory.newInstance();
>>Service service = sF.createService(new URL(wsdlUrl), serviceName);
>>Call call = service.createCall(portName, operationName);
>>DOCUMENT request = new DOCUMENT();
>>DOCUMENT response = (DOCUMENT) call.invoke(new Object[] {request});
>>
>>
>>
>>I use Axis implementation. I have this exception:
>>
>>AxisFault
>>faultCode: {http://xml.apache.org/axis/}Server.userException
>>faultString: java.io.IOException: No serializer found for class com.cadit.ws.xas.city.servizi.DOCUMENT in registry org.apache.axis.encoding.TypeMappingImpl_at_55d93d
>>faultActor: null
>>faultDetail:
>> stackTrace: java.io.IOException: No serializer found for class com.cadit.ws.xas.city.servizi.DOCUMENT in registry org.apache.axis.encoding.TypeMappingImpl_at_55d93d
>> at org.apache.axis.encoding.SerializationContextImpl.serializeActual(SerializationContextImpl.java:1191)
>> at org.apache.axis.encoding.SerializationContextImpl.serialize(SerializationContextImpl.java:744)
>> at org.apache.axis.encoding.SerializationContextImpl.outputMultiRefs(SerializationContextImpl.java:812)
>> at org.apache.axis.message.SOAPBody.outputImpl(SOAPBody.java:147)
>> at org.apache.axis.message.SOAPEnvelope.outputImpl(SOAPEnvelope.java:401)
>> at org.apache.axis.message.MessageElement.output(MessageElement.java:726)
>> at org.apache.axis.SOAPPart.getAsString(SOAPPart.java:408)
>> at org.apache.axis.SOAPPart.getAsBytes(SOAPPart.java:336)
>> at org.apache.axis.Message.getContentType(Message.java:381)
>> at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:343)
>> at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:125)
>> ...
>>
>>
>>It says that it can't find serializer for class DOCUMENT (this class was generated from WSDL with Wsdl2Java tool).
>>I think DII doesn't need specification for serializer, because it retrieves this information frow WSDL at runtime, isn't this?
>>
>>I mean: I'm trying to invoke a Web Service with DII getting WSDL informations dynamically at runtime without any client side artifacts, is it possible?
>>
>>thanks in advance,
>>
>>Andrea Tevoi
>>
>
>--
>-----------------------------------------------------------------------
>Phil Goodwin, Java Software, Sun Microsystems, 408.276.7090, or x17090
>
>For a bowl of water give a goodly meal;
>For a kindly greeting bow thou down with zeal;
>For a simple penny pay thou back with gold;
>If thy life be rescued, life do not withhold.
>Thus the words and actions of the wise regard;
>Every little service tenfold they reward.
>But the truly noble know all men as one,
>And return with gladness good for evil done.
>

--
-----------------------------------------------------------------------
Phil Goodwin, Java Software, Sun Microsystems, 408.276.7090, or x17090
For a bowl of water give a goodly meal;
For a kindly greeting bow thou down with zeal;
For a simple penny pay thou back with gold;
If thy life be rescued, life do not withhold.
Thus the words and actions of the wise regard;
Every little service tenfold they reward.
But the truly noble know all men as one,
And return with gladness good for evil done.