You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@ws.apache.org by Ralf Bierig <so...@yahoo.com> on 2001/05/15 12:14:35 UTC
How to serialize a URL? HELP!!!
How can I serialize a URL? I have tried to do it with
the BeanSerializer...
(see the following sourcecode)
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, beanserializer, beanserializer);
call.setSOAPMappingRegistry(smr);
call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
call.setTargetObjectURI("urn:myservice");
call.setMethodName("URLmethod");
Vector parameters=new Vector();
Class parameter_0_type = java.net.URL.class;
parameters.addElement(new Parameter("parameter_0",
parameter_0_type, (URL)parameter_0,
Constants.NS_URI_SOAP_ENC));
call.setParams(parameters); Response
response = call.invoke(this.getServiceLocation(),"");
I got the SOAPException, that there is no serializer
for java.lang.Object...
I dont know, URL is a bean, I think because I can
reconstruct a URL with all informaiton I get from the
Getters. So it should work. Why not???
Thanks in advance!
Ralf Bierig
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org
RE: How to serialize a URL? HELP!!!
Posted by Jean-Louis Vila <jl...@cosmosbay.com>.
Hi Ralf,
URL doesn't contains default constructor URL() and
it must be present for a bean. So, you can try
to extend URL with a default constructor and
deploy this new object.
public class MyURL extends java.net.URL{
public MyURL(){}
}
This must work
Hope that helps....
Jean-Louis
> -----Message d'origine-----
> De : Ralf Bierig [mailto:soap_news@yahoo.com]
> Envoye : mardi 15 mai 2001 12:15
> A : soap-user@xml.apache.org
> Objet : How to serialize a URL? HELP!!!
>
>
> How can I serialize a URL? I have tried to do it with
> the BeanSerializer...
>
> (see the following sourcecode)
>
> 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, beanserializer, beanserializer);
>
> call.setSOAPMappingRegistry(smr);
> call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
> call.setTargetObjectURI("urn:myservice");
> call.setMethodName("URLmethod");
>
>
> Vector parameters=new Vector();
> Class parameter_0_type = java.net.URL.class;
> parameters.addElement(new Parameter("parameter_0",
> parameter_0_type, (URL)parameter_0,
> Constants.NS_URI_SOAP_ENC));
> call.setParams(parameters);
> Response
> response = call.invoke(this.getServiceLocation(),"");
>
>
> I got the SOAPException, that there is no serializer
> for java.lang.Object...
>
> I dont know, URL is a bean, I think because I can
> reconstruct a URL with all informaiton I get from the
> Getters. So it should work. Why not???
>
>
> Thanks in advance!
>
> Ralf Bierig
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Auctions - buy the things you want at great prices
> http://auctions.yahoo.com/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> For additional commands, email: soap-user-help@xml.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org
RE: How to serialize a URL? HELP!!!
Posted by Jean-Louis Vila <jl...@cosmosbay.com>.
Hi Ralf,
URL doesn't contains default constructor URL() and
it must be present for a bean. So, you can try
to extend URL with a default constructor and
deploy this new object.
public class MyURL extends java.net.URL{
public MyURL(){}
}
This must work
Hope that helps....
Jean-Louis
> -----Message d'origine-----
> De : Ralf Bierig [mailto:soap_news@yahoo.com]
> Envoye : mardi 15 mai 2001 12:15
> A : soap-user@xml.apache.org
> Objet : How to serialize a URL? HELP!!!
>
>
> How can I serialize a URL? I have tried to do it with
> the BeanSerializer...
>
> (see the following sourcecode)
>
> 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, beanserializer, beanserializer);
>
> call.setSOAPMappingRegistry(smr);
> call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
> call.setTargetObjectURI("urn:myservice");
> call.setMethodName("URLmethod");
>
>
> Vector parameters=new Vector();
> Class parameter_0_type = java.net.URL.class;
> parameters.addElement(new Parameter("parameter_0",
> parameter_0_type, (URL)parameter_0,
> Constants.NS_URI_SOAP_ENC));
> call.setParams(parameters);
> Response
> response = call.invoke(this.getServiceLocation(),"");
>
>
> I got the SOAPException, that there is no serializer
> for java.lang.Object...
>
> I dont know, URL is a bean, I think because I can
> reconstruct a URL with all informaiton I get from the
> Getters. So it should work. Why not???
>
>
> Thanks in advance!
>
> Ralf Bierig
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Auctions - buy the things you want at great prices
> http://auctions.yahoo.com/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> For additional commands, email: soap-user-help@xml.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org