According to a Example which is found out by google, I wrote some codes to call a WebService as a test.
call the WebServiceCode:void CWebEngine::HandleErrorL(const TInt aErrorCode,const TDesC8& aError) { const TDesC8& error=aError; const TInt code=aErrorCode; } void CWebEngine::ConnectL() { CSenXmlServiceDescription* pattern = CSenXmlServiceDescription::NewLC(); pattern->SetFrameworkIdL(KDefaultBasicWebServicesFrameworkID); pattern->SetEndPointL(_L8("http://webservice.webxml.com.cn/WebServices/WeatherWebService.asmx")); delete iConnection; iConnection = NULL; iConnection = CSenServiceConnection::NewL(*this, *pattern); CleanupStack::PopAndDestroy(pattern); } void CWebEngine::SayHello() { //send CSenSoapEnvelope *env = CSenSoapEnvelope::NewL(); CleanupStack::PushL(env); env->SetSoapActionL(_L8("http://WebXml.com.cn/getSupportProvince")); CSenElement& request=env->BodyL().AddElementL(_L8("http://WebXml.com.cn/"), _L8("getSupportProvince")); //CSenElement& userName = request.AddElementL(_L8("userName")); //userName.SetContentL(_L8("Test")); //CSenElement& loginPassword = request.AddElementL(_L8("loginPassword")); //loginPassword.SetContentL(_L8("Test")); iConnection->SendL(*env); CleanupStack::PopAndDestroy(env); }
But when execute to “iConnection->SendL(*env)”, it will jump to “HandleErrorL”.Code:CWebEngine* engine=CWebEngine::NewL(); engine->ConnectL(); engine->SayHello();
The value of aErrorCode is -30295
the definition of “CWebEngine”
Can soemone tell me where is the error of my codes, and how to fix.Code:class CWebEngine : public CSenBaseFragment, public MSenServiceConsumer { public: //~CWebEngine(); static CWebEngine* NewL(); static CWebEngine* NewLC(); void ConnectL(); void SayHello(); //from MSenServiceConsumer virtual void HandleMessageL(const TDesC8& aMessage); virtual void HandleErrorL(const TInt aErrorCode,const TDesC8& aError); virtual void SetStatus(const TInt aStatus); protected: /* //from CSenBaseFragment virtual void StartElementL(const TDesC8& aNsUri, const TDesC8& aLocalName, const TDesC8& aQName, const Xml::RAttributeArray& aAttrs); virtual void EndElementL(const TDesC8& aNsUri, const TDesC8& aLocalName, const TDesC8& aQName); */ private: CWebEngine(); void ConstructL(); private: CSenServiceConnection* iConnection; CSenXmlServiceDescription* iSession; CSenXmlReader* iXmlReader; };
thank you advance !



