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 Mala Rathinasamy <ma...@PacketVideo.COM> on 2001/08/22 21:55:11 UTC

using vectors in JavaBeans

Hai,
    
          I've a JavaBean which has got 3 properties
1.int 
2.String
3.Vector

this needs to be passed from the Server to the client.

In the Client code,the mappings are


    SOAPMappingRegistry smr = new SOAPMappingRegistry();
	BeanSerializer beanSer = new BeanSerializer();
	

	// Map the types.
	smr.mapTypes(
		Constants.NS_URI_SOAP_ENC,
		new QName("urn:TestPV-Provisioning", "ProvisioningResult"),
		ProvisioningResult.class,
		beanSer,
		beanSer);

and in the deployment descriptor,

<isd:map 
	
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"             
			xmlns:x="urn:TestPV-Provisioning"
		 	qname="x:ProvisioningResult"             
			javaType="com.test.ProvisioningResult"
java2XMLClassName="org.apache.soap.encoding.soapenc.BeanSerializer"
xml2JavaClassName="org.apache.soap.encoding.soapenc.BeanSerializer" />   


I get the exception 

SOAPException fault code: SOAP-ENV:Client message: The
'http://schemas.xmlsoap.org/soap/encoding/:arrayType' attribute must be
specified for every array.

while running the client.

Where do I need to specify the array type attribute?

Thanks.



Re: using vectors in JavaBeans

Posted by Bob Cotton <bc...@synxis.com>.
>>>>> "Mala" == Mala Rathinasamy <ma...@PacketVideo.COM> writes:

    Mala> Hai,
    Mala>           I've a JavaBean which has got 3 properties
    Mala> 1.int 2.String 3.Vector

What is the signature for the getVector() method? Does it return a
Vector or array?

I've been able to use the BeanSerializer for JavaBeans that have a
Vector internally but have for accessors:
        Foo[] getFoos();
        setFoos(Foo[] fa);

I don't think it can handle getters and setters that use Vectors.

Hope this helps.
- Bob

    Mala> this needs to be passed from the Server to the client.

    Mala> In the Client code,the mappings are


    Mala>     SOAPMappingRegistry smr = new SOAPMappingRegistry();
    Mala> 	BeanSerializer beanSer = new BeanSerializer();
	

    Mala> 	// Map the types.
    Mala> 	smr.mapTypes(
    Mala> 		Constants.NS_URI_SOAP_ENC, new
    Mala> 		QName("urn:TestPV-Provisioning",
    Mala> 		"ProvisioningResult"),
    Mala> 		ProvisioningResult.class, beanSer, beanSer);

    Mala> and in the deployment descriptor,

    Mala> <isd:map
	
    Mala> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
    Mala> 			xmlns:x="urn:TestPV-Provisioning"
    Mala> 		 	qname="x:ProvisioningResult"             
    Mala> 			javaType="com.test.ProvisioningResult"
    Mala> java2XMLClassName="org.apache.soap.encoding.soapenc.BeanSerializer"
    Mala> xml2JavaClassName="org.apache.soap.encoding.soapenc.BeanSerializer"
    Mala> />


    Mala> I get the exception

    Mala> SOAPException fault code: SOAP-ENV:Client message: The
    Mala> 'http://schemas.xmlsoap.org/soap/encoding/:arrayType'
    Mala> attribute must be specified for every array.

    Mala> while running the client.

    Mala> Where do I need to specify the array type attribute?

    Mala> Thanks.



-- 
SynXis Corporation      | bob@synxis.com    | Obstacles are those frightful 
1610 Wynkoop, Suite 400 | Ph: (303)595-2511 | things you see when you take your
Denver, CO  80202       | Fax:(303)534-4257 | eyes off your goal.  -Henry Ford



                                    


Re: using vectors in JavaBeans

Posted by Bob Cotton <bc...@synxis.com>.
>>>>> "Mala" == Mala Rathinasamy <ma...@PacketVideo.COM> writes:

    Mala> Hai,
    Mala>           I've a JavaBean which has got 3 properties
    Mala> 1.int 2.String 3.Vector

What is the signature for the getVector() method? Does it return a
Vector or array?

I've been able to use the BeanSerializer for JavaBeans that have a
Vector internally but have for accessors:
        Foo[] getFoos();
        setFoos(Foo[] fa);

I don't think it can handle getters and setters that use Vectors.

Hope this helps.
- Bob

    Mala> this needs to be passed from the Server to the client.

    Mala> In the Client code,the mappings are


    Mala>     SOAPMappingRegistry smr = new SOAPMappingRegistry();
    Mala> 	BeanSerializer beanSer = new BeanSerializer();
	

    Mala> 	// Map the types.
    Mala> 	smr.mapTypes(
    Mala> 		Constants.NS_URI_SOAP_ENC, new
    Mala> 		QName("urn:TestPV-Provisioning",
    Mala> 		"ProvisioningResult"),
    Mala> 		ProvisioningResult.class, beanSer, beanSer);

    Mala> and in the deployment descriptor,

    Mala> <isd:map
	
    Mala> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
    Mala> 			xmlns:x="urn:TestPV-Provisioning"
    Mala> 		 	qname="x:ProvisioningResult"             
    Mala> 			javaType="com.test.ProvisioningResult"
    Mala> java2XMLClassName="org.apache.soap.encoding.soapenc.BeanSerializer"
    Mala> xml2JavaClassName="org.apache.soap.encoding.soapenc.BeanSerializer"
    Mala> />


    Mala> I get the exception

    Mala> SOAPException fault code: SOAP-ENV:Client message: The
    Mala> 'http://schemas.xmlsoap.org/soap/encoding/:arrayType'
    Mala> attribute must be specified for every array.

    Mala> while running the client.

    Mala> Where do I need to specify the array type attribute?

    Mala> Thanks.



-- 
SynXis Corporation      | bob@synxis.com    | Obstacles are those frightful 
1610 Wynkoop, Suite 400 | Ph: (303)595-2511 | things you see when you take your
Denver, CO  80202       | Fax:(303)534-4257 | eyes off your goal.  -Henry Ford