调用WebService的问题
按照网上的例子,自己用S60自带的API写了访问WebService的代码
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);
}
调用时
CWebEngine* engine=CWebEngine::NewL();
engine->ConnectL();
engine->SayHello();
但当执行iConnection->SendL(*env)的时候,就会跳到HandleErrorL,aErrorCode为-30295
请问我的代码错在哪里?应该怎样改?
[解决办法]
帮顶!
[解决办法]
不顶还好,顶了我删不了
[解决办法]
地址不对。。。
[解决办法]
地址应该怎样写?
[解决办法]
:(
[解决办法]
还是要感谢你的好意
[解决办法]
const TInt KErrSenNotInitialized = -30291;
const TInt KErrSenServiceConnectionBusy = -30292;
const TInt KErrConnectionInitializing = -30293;
const TInt KErrConnectionExpired = -30294;
const TInt KErrSubmitting = -30295;
const TInt KErrSenSoapFault = -30296;
const TInt KErrSenInternal = -30297;
const TInt KErrSenNoEndpoint = -30298;
const TInt KErrSenNoContract = -30299;
const TInt KErrSenProviderIdInUseByAnotherEndpoint = -30305;
const TInt KErrSenNoContractNoEndPoint = -30306;
const TInt KErrSenBrokenSoapEnvelope = -30307;
const TInt KErrSenBrokenSoapFault = -30308;
const TInt KErrSenCancelled = -30309;