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

FANUC 0-TC A20B-2000-0175 OMC Mother Board
$985.0
FANUC 0-TC A20B-2000-0175 OMC Mother Board pictureABB Mother Board RINT-5211C ACS800-030-3
$1150.0
ABB Mother Board RINT-5211C ACS800-030-3  pictureEpson Stylus pro 9910 Mainboard-2122978 Original Epson Motherboard
$732.4
Epson Stylus pro 9910 Mainboard-2122978 Original Epson Motherboard pictureCarrier Transicold 22-02269-11 Mother Board Container Refrigeration Heating
$699.0
Carrier Transicold 22-02269-11 Mother Board Container Refrigeration Heating pictureGood computer and smart phone motherboard repair Copper Solder Enamelled Wire NH
$0.75
Good computer and smart phone motherboard repair Copper Solder Enamelled Wire NH picture






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