Hi,
I'm failing with using the Web Services framework:
I've used wsdl2cpp to create the required classes.
In my code I call NewL on my service class.
The consumer class's SetStatus method is called with KSenConnectionStatusReady, which should be the value after
connecting. Strangely enough, it doesn't seem as if a connection has been established, because:
- No access point selection popup was presented.
- It all happens too fast (<8 miliseconds).
- The server is located behind a private network, and to reach it, a specific wireless network must be connected.
When I then try to send the SOAP request (using the generated class's service methods), I get a strange error code: -23654.
What am I missing here?
Code fragments can be found below.
Please help,
Thanks,
Nadav
Code:
void
CLoginConnectConsumer::ServiceL()
{
...
CSenXmlServiceDescription * serviceDesc =
CSenXmlServiceDescription::NewL( KMyServicesUrl, KNullDesC8() );
serviceDesc->SetFrameworkIdL( KDefaultBasicWebServicesFrameworkID );
// After this call, SetStatus is called
iLoginConnectService = CLoginConnectServiceService::NewL(
*this, *serviceDesc );
}
void
CLoginConnectConsumer::SetStatus(
const TInt aStatus )
{
switch( aStatus )
{
...
case KSenConnectionStatusReady:
// ===> This is called, and now, sending request...
{
TInt err = SendRequest(); // <=== This fails. See below
if ( err == KErrNone )
return;
}
break;
...
}
delete iLoginConnectService;
iLoginConnectService = NULL;
}
TInt
CLoginConnectConsumer::SendRequest()
{
RLoginConnectRequest request;
RLoginConnectResponse response;
CSenSoapFault * soapFault = NULL;
InitRequest( request ); // Initializing the request's parameters
// ====> Following line returns with err = -23654
TRAPD( err, iLoginConnectService->LoginConnectL( request, response, &soapFault ) );
if ( soapFault )
{
HandleSoapFaultL( *soapFault );
delete soapFault;
}
response.Close();
request.Close();
return err;
}
From generated code:
Code:
void
CLoginConnectServiceService::LoginConnectL(
const RLoginConnectRequest & aLoginConnectRequest,
RLoginConnectResponse & aResult,
CSenSoapFault ** aFault)
{
if (NULL != aFault)
*aFault = NULL;
TPtrC8 reqStr;
// ===> Following line leaves with code -23654
Xsd::SenOps::ProcessOutgoingMessageLC(
aLoginConnectRequest,
"loginConnectRequest",
"http://myCompany.com/services/myServices",
"xdb",
reqStr );
...
}