Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
dcharya
Posts: 74
Registered: ‎03-04-2012
My Device: developer
My Carrier: developer
Accepted Solution

KSOAP PARSING

Hey hi All

 

I am trying my hands with KSOAP for the first time and after trying for long time i here writing for help,

 

i need to post this 

 

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <verifyLogin xmlns="http://mobile.expenseanywhere.com/">
      <AuthToken>
        <CorporateId>string</CorporateId>
<Username>string</Username>
<Password>string</Password>
</AuthToken>
</verifyLogin>
</soap:Body>
</soap:Envelope>

 

here i stuck with this <AuthToken> Tag i dont knw how to handle such requests with KSOAP
Please help me in this.

 

this is My Code

 

SoapObject rpc = new SoapObject(NameSpace, MethodName);
// SoapObject rpc = new SoapObject("", "AuthToken");
rpc.addProperty("CorporateId", "CID");
rpc.addProperty("Username", "uN");
rpc.addProperty("Password", "PWD");
// rpc1.addProperty("", rpc);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.bodyOut = rpc;
envelope.dotNet = true;
envelope.encodingStyle = SoapSerializationEnvelope.ENC;

HttpTransport ht = new HttpTransport(URL);

ht.debug = false;
ht.setXmlVersionTag("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
String result = null;
try 
{
ht.call(SOAPAction, envelope);
String s = ht.requestDump;
s = ht.responseDump;

result = (envelope.getResponse()).toString();
SoapObject body = (SoapObject)envelope.bodyIn;
result = (String)body.getProperty("verifyLoginResult").toString();
System.out.println(result);
}
catch(org.xmlpull.v1.XmlPullParserException ex2)
{
Dialog.inform(ex2.getMessage());
}
catch(Exception ex)
{
Dialog.inform(ex.getMessage());
}

 

Deepak Charya
Please use plain text.
Developer
dcharya
Posts: 74
Registered: ‎03-04-2012
My Device: developer
My Carrier: developer

Re: KSOAP PARSING

Please Help

Deepak Charya
Please use plain text.
Developer
simon_hain
Posts: 16,042
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: KSOAP PARSING

you have to add a class mapping for complex objects, at least if you want to get deserialized results.

see http://www.codeproject.com/Articles/29305/Consuming-NET-Web-Services-via-the-kSOAP-library or http://blog.bayestech.com/?p=78 for some background information.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Developer
dcharya
Posts: 74
Registered: ‎03-04-2012
My Device: developer
My Carrier: developer

Re: KSOAP PARSING

Hey Hi Simon

 

Thanks for reply but my problem is i am not able to post data as if 

<AuthToken>
        <CorporateId>string</CorporateId>
<Username>string</Username>
<Password>string</Password>
</AuthToken>

Here this <AuthToken> is troubling me as i shown there in my previous post the full structure that i need to post

Please me help me out in this
Deepak Charya
Please use plain text.
Developer
dcharya
Posts: 74
Registered: ‎03-04-2012
My Device: developer
My Carrier: developer

Problem solved   Thanks for Suggestions and help    Regar...

Problem solved

 

Thanks for Suggestions and help 

 

Regards

Deepak

Deepak Charya
Please use plain text.
Developer
simon_hain
Posts: 16,042
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: Problem solved   Thanks for Suggestions and help    Regar...

please mark the thread as solved, then
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.