BlackBerry Forums Support Community
              

Closed Thread
 
LinkBack Thread Tools
Old 05-07-2009, 04:53 AM   #1 (permalink)
New Member
 
Join Date: Apr 2009
Model: 8120
PIN: N/A
Carrier: a
Posts: 5
Post Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy adding properties to SoapObject

Please Login to Remove!

Dear All,

I am unable to add multilevel properites to a SoapObject. Please help me.

The format of the Input parametres is like

<m30:message name>
<m30:property1>abc</m30:property1>
<m30:property2>
<m30:property21>123</m30:property21>
<m30:property22>lmn</m30:property22>
</m30:property2>

</m30:message name>

Please help me in adding property to Input SoapObject
the code is as below:

SoapObject rpc = new SoapObject("--message block--m30 namespace", "message name");

rpc.addProperty("property1","abc");
Object o= new Object();
SoapObject sub= (SoapObject)o;
sub.addProperty("property21","123");
sub.addProperty("property22","lmn");
rpc.addProperty("prperty2",sub);


But I am getting exceptions ... Please help me out --to add this hierarchy input field.
Offline  
Old 05-08-2009, 04:19 AM   #2 (permalink)
New Member
 
Join Date: Apr 2009
Model: 8120
PIN: N/A
Carrier: a
Posts: 5
Post Thanks: 0
Thanked 0 Times in 0 Posts
Thumbs up Gottacha!!!!

I got the solution after trying all posssible trial-n-error methods

The code can be written like this to add such properties:

rpc.addProperty("property1","abc");

SoapObject sub = new SoapObject("--message block--m30 namespace", "message name.property2");

sub.addProperty("property21","123");
sub.addProperty("property22","lmn");

rpc.addProperty("property2",sub);


Then I have got the appropriate Input envelope structure

<m30:message name>
<m30:property1>abc</m30:property1>
<m30:property2>
<m30:property21>123</m30:property21>
<m30:property22>lmn</m30:property22>
</m30:property2>

</m30:message name>
Offline  
Old 05-20-2009, 10:02 AM   #3 (permalink)
New Member
 
Join Date: Apr 2009
Model: 8300
PIN: N/A
Carrier: AT&T
Posts: 5
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default thank you

Thanks very much for posting your findings. Once explained, it makes sense.
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Vintage AIR-VAC DVM4ESS Vacuum Module
$79.99
Vintage AIR-VAC DVM4ESS Vacuum Module pictureSpencer turbine Fastvac vortex vacuum blower 5hp Industravac Nice
$1190.0
Spencer turbine Fastvac vortex vacuum blower 5hp Industravac Nice pictureCASTROL BRAYCOTE 804-25007-AESY HIGH VACUUM GREASE 2oz NEW, TYPE 1.
$42.54
CASTROL BRAYCOTE 804-25007-AESY HIGH VACUUM GREASE 2oz NEW, TYPE 1. pictureThomas Compressor Vacuum Pump Model No. 915CA23TFE-217 Motor No. 600107B
$99.95
Thomas Compressor Vacuum Pump Model No. 915CA23TFE-217 Motor No. 600107B  pictureStainless Steel Coconut Scrapper Crusher With Vacuum Base ) Silver Color Size...
$17.61
Stainless Steel Coconut Scrapper Crusher With Vacuum Base ) Silver Color Size... picture






Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.