WebService Call in RunL

Login to reply to this topic.
Sat, 2008-05-17 14:23
Joined: 2007-09-25
Forum posts: 11

Hi all,
My console exe application has two active objects.
One of them(AO1) acquires latitude/longitude via assisted GPS
and records this location information in the database via web service
call(I am using Nokia WSDL to C++).
The other active object(AO2) makes a call to a web service and waits for response.
If the server sends any message it catches and show it in a notification.
Both of these active objects are to run for long time.

My problem is:

I am using a single active scheduler which is a member of AO1 to run both AO1 and AO2.

There is no timer in AO1 because the gps method itself behaves like a timer.
AO2 has a timer. Now AO1 is behaving normally when I run the program the trouble is
with AO2 which is supposed to make a web service call and wait for the server's message and upon receiving server's message it should make call, wait etc.
I have called the web services in the RunL's of AO1 and AO2. The second time AO2's RunL reaches the web service call and a panic is given E32USER 47.
I have looked into the SDK to see the meaning of the panic as it says:

"This panic is raised by the Error() virtual member function of an active scheduler, a CActiveScheduler. This function is called when an active object’s RunL() function leaves. Applications always replace the Error() function in a class derived from CActiveScheduler; the default behaviour provided by CActiveScheduler raises this panic."

But why the RunL is leaving on the second time I cannot make out.

I am giving the RunL code of my two active objects:

AO1(collects location data via gps):
=========================

void CtrygpswithnewwsdlAO::RunL()
{

switch ( iStatus.Int() )
{
// The fix is valid
case KErrNone:
// The fix has only partially valid information.
// It is guaranteed to only have a valid timestamp
case KPositionPartialUpdate:
{


iPositionInfo.GetPosition(pos);

location = new RLocation();

location->iAccuracy = pos.HorizontalAccuracy();;
location->iAltitude = pos.Altitude();
location->iLatitude = pos.Latitude();
location->iLongitude = pos.Longitude();

logloc.iLocation = location;
logloc.iSessionToken = tock;

TRAPD(error2, pService->LogLocationL(logloc, loglocrsp, &fault));

if(fault != NULL)

{

TPtrC8 mfault = fault->FaultString();

HBufC *pContent = SenXmlUtils::ToUnicodeLC(mfault);


TBuf<256> txt;
txt = *pContent;

ShowText(txt);
}

break;
}
default:

break;

}

iPositioner.NotifyPositionUpdate( iPositionInfo, iStatus );
SetActive();
}

AO2(waits for server's message): [this is the perhaps the problematic one]
======================================================

void CnotificationAO::RunL()
{


getMessage.iEmailId = Buf;
TRAPD(error, myNotService->GetMessageL(getMessage, getMessageResponse, &fault));


if(fault != NULL)
{

TPtrC8 mfault = fault->FaultString();
HBufC *pContent = SenXmlUtils::ToUnicodeLC(mfault);
TBuf<256> txt;
txt = *pContent;
ShowMessage(txt);
}

HBufC* my = getMessageResponse.iMessage;
ShowMessage(*my);




iTimer.After(iStatus, 5000000); // Set for 1 sec later


SetActive(); // Tell scheduler a request is active
}

Please help me. I am easperated. Sad(
Regards,
Tanvir.

NB. 1. I have kept high and low priority for AO1 and AO2 respectively.
2. I replaced the web service call with just a simeple static text to be displayed via global note and then AO1 and AO2 both worked fine. I think the problem is with the web service call used along with RTimer...

Please please please....help me....someone

  • Login to reply to this topic.