BlackBerry Forums Support Community
              

Closed Thread
 
LinkBack Thread Tools
Old 11-13-2009, 04: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, 04: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

DIY Kits Mini Plasma Music Loudspeakers Arc Ignition Lighter Coil Test SSTC
$0.01
DIY Kits Mini Plasma Music Loudspeakers Arc Ignition Lighter Coil Test SSTC pictureSolenoid valve MFH-5-1/8-B 19758 220V coil
$39.0
Solenoid valve MFH-5-1/8-B 19758 220V coil pictureDELTROL CONTROLS RR28A-U RR2BA-U DC24V COIL RELAY
$7.99
DELTROL CONTROLS RR28A-U RR2BA-U DC24V COIL RELAY picture27 AWG Gauge Magnet Wire Red 800' 155C Solderable Enameled Copper Coil Winding
$9.0
27 AWG Gauge Magnet Wire Red 800' 155C Solderable Enameled Copper Coil Winding picture5 Rolls Dental Orthodontic Niti Open Coil Springs Dia. 012*030″ 914mm ( 3feet )
$31.99
5 Rolls Dental Orthodontic Niti Open Coil Springs Dia. 012*030″ 914mm ( 3feet ) picture






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