BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 11-13-2009, 05:32 AM   #1 (permalink)
New Member
 
Join Date: Oct 2009
Model: 7100T
PIN: N/A
Carrier: Vodafone
Posts: 2
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Ksoap passing complex type input to ws

Please Login to Remove!

I am trying to use Ksoap to call a .net webservice.

Sample request is as follows:
<soap:Body>
<RegisterUserDetails xmlns=" ">
<User>
<SPName>string</SPName>
<Mode>string</Mode>
<UserID>int</UserID>
<UserFirstName>string</UserFirstName>
<UserLastName>string</UserLastName>
<UserPassword>string</UserPassword>
<UserEmail>string</UserEmail>
<UserName>string</UserName>
<UserPhoto>string</UserPhoto>
<Msg>string</Msg>
<UserAge>int</UserAge>
<UserMobilePhone>string</UserMobilePhone>
<UserAlternateEmail>string</UserAlternateEmail>
<UserAddress>string</UserAddress>
<UserFavouriteQuote>string</UserFavouriteQuote>
<UserGender>boolean</UserGender>
</User>
</RegisterUserDetails>
</soap:Body>
</soap:Envelope>

I have coded as follows:

Code:
SoapObject soap = new SoapObject(URN, methodName);

SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
					SoapEnvelope.VER11);
PropertyInfo pinfo = new PropertyInfo();
pinfo.name="User";
pinfo.namespace="mynamespace"
 pinfo.type=Prop_User.EVENT_CLASS;
Prop_User userObj = new Prop_User();
userObj.setSpName("spname");
userObj.setMode("mode");
userObj.setUserid(28);
userObj.setFName("baj");
userObj.setLName("baj");
userObj.setPwd("baj");
.........................	         	           
soap.addProperty(pinfo,userObj);
envelope.bodyOut = soap;
envelope.dotNet = true;
//envelope.setOutputSoapObject(soap);

HttpTransport ht = new HttpTransport(address);
ht.debug = true;
ht.call(soapAction, envelope);
I am getting a Faultstring as:
Server was unable to read request. ---&gt; There is an error in XML document (1, 301). ---&gt; The specified type was not recognized: name='anyType',

Can somebody point out my mistake. Thanks
Offline  
Old 11-13-2009, 05:58 AM   #2 (permalink)
New Member
 
Join Date: Oct 2009
Model: 7100T
PIN: N/A
Carrier: Vodafone
Posts: 2
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Working now after changing the below lines:

soap.addProperty("User",userObj);
envelope.addMapping(namespace, "Prop_User", Prop_User.EVENT_CLASS);
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

5Pcs Kbu606 Diotec Semiconductor Kbu606 Ic New U
$2.3
5Pcs Kbu606 Diotec Semiconductor Kbu606 Ic New U pictureNEW IN BOX Bussmann FWH-400A Semiconductor FUSE 400A 500V
$20.0
NEW IN BOX Bussmann FWH-400A Semiconductor FUSE 400A 500V pictureFWP-150A - Bussmann - FUSE Semiconductor, 150A
$25.58
FWP-150A  -  Bussmann  -  FUSE Semiconductor, 150A pictureNEW Motorola Semiconductor Power Transistor PNP PN#- 2N5345
$2.75
NEW Motorola Semiconductor Power Transistor PNP   PN#- 2N5345 pictureNEW IN BOX Bussmann FWP-250A Semiconductor FUSE 250A 700V
$29.0
NEW IN BOX Bussmann FWP-250A Semiconductor FUSE 250A 700V picture






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