You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-dev@xml.apache.org by Ralf Bierig <so...@yahoo.com> on 2001/05/11 21:35:17 UTC

URL via BeanSerializer???

Hi,

I have tried to use BeanSerializer to (de)serialize
the java.net.URL type.

Some source:
------------------------------------------------------
Call call=new Call();
SOAPMappingRegistry smr = new SOAPMappingRegistry();
BeanSerializer beanser = new BeanSerializer();	
smr.mapTypes(Constants.NS_URI_SOAP_ENC,
	 new QName("urn:xml-soap-echo-demo", "url"),		
java.net.URL.class, beanser, beanser);
call.setSOAPMappingRegistry(smr);
call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
call.setTargetObjectURI("urn:myservice");
call.setMethodName("urlMethod");

Vector parameters=new Vector();
parameters.addElement(new
Parameter("parameter_0",java.net.URL.class,(URL)parameterURL,Constants.NS_URI_SOAP_ENC));
call.setParams(parameters);

Response
response=call.invoke(this.getServiceLocation(),"");
------------------------------------------------------

Looks normal: SOAP give me the following
SOAPException:

[SOAPException: faultCode=SOAP-ENV:Client; msg=No
Serializer found to serialize a 'java.lang.Object'
using encoding style
'http://schemas.xmlsoap.org/soap/encoding/'.;
targetException=java.lang.IllegalArgumentException: No
Serializer found to serialize a 'java.lang.Object'
using encoding style
'http://schemas.xmlsoap.org/soap/encoding/'.]



Does anybody know, why I cannot serialize URL via
BeanSerializer. I mean it should be possible because I
can reconstruct a URL with the properties I get from
calling all GETers. So it is a bean, right? 

Thanks!

Ralf Bierig




__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/