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

PROCESSOR BOARD ABB DSPC 172 57310001 - ML
$1800.0
PROCESSOR BOARD ABB DSPC 172 57310001 - ML pictureTeltronics Vision 150-3090-0002 SRX System II CPU Card N80286-12 Intel 1982 Card
$49.99
Teltronics Vision 150-3090-0002 SRX System II CPU Card N80286-12 Intel 1982 Card pictureABB YT 204001-JH YXU 170E TRIGGER PULSE COMPUTER BOARD CPU
$450.0
ABB YT 204001-JH YXU 170E TRIGGER PULSE COMPUTER BOARD CPU pictureHoneywell 620-0080 IPC 620-25/35 Processor Module VR 3.1 NEW IN SEALED BOX
$479.99
Honeywell 620-0080 IPC 620-25/35 Processor Module VR 3.1 NEW IN SEALED BOX pictureNEC Nitsuko 124i CPU Card Version 5.06 92005 DX2NA-32CPRU-S1 Refurbished
$159.99
NEC Nitsuko 124i CPU Card Version 5.06 92005 DX2NA-32CPRU-S1 Refurbished picture






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