首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > Symbian >

调用WebService的有关问题

2012-12-16 
调用WebService的问题按照网上的例子,自己用S60自带的API写了访问WebService的代码void CWebEngine::Handl

调用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; 

热点排行