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

OEM CPU FAN & HEATSINK 14R0011 TSQC0039003--IBM SURE POS 4840-563 TOUCH SCREEN
$3.99
OEM CPU FAN & HEATSINK 14R0011 TSQC0039003--IBM SURE POS 4840-563 TOUCH SCREEN pictureIBM OEM STAPLE CARTRIDGE Infoprint 2085/2105 5000 Staples/Box 53P6725 2 FOR 1
$12.5
IBM OEM STAPLE CARTRIDGE Infoprint 2085/2105 5000 Staples/Box 53P6725 2 FOR 1 pictureRicoh 410508 Type H OEM Staple Ctge Savin-IBM-Toshiba-Lanier-Gestetner LOT OF 18
$54.95
Ricoh 410508 Type H OEM Staple Ctge Savin-IBM-Toshiba-Lanier-Gestetner LOT OF 18 pictureOEM IBM 2210 2210-12E Switch 16MD DRAM
$175.0
OEM IBM 2210 2210-12E Switch 16MD DRAM picture2 Genuine OEM IBM Cartridge Wheelwriter Printwheel
$39.0
2 Genuine OEM IBM Cartridge Wheelwriter Printwheel picture






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