Symbian学习笔记 8 之 初探WebServices API的使用(下)
?继续,看看如何取出结果值,就是<HelloWorldResult>Hello World</HelloWorldResult>中的字串HelloWorld,这个代码在CHelloWorldResult中: view plaincopy to clipboardprint?TPtrC8 CHelloWorldResult::Result()? ???{? ???CSenElement * pElement = AsElement().Element(KHelloResult);? ?if(pElement)? ?? ?? ?{? ?? ???_LIT(STR,"result----");? ? ? ? LOG(STR);? ?return pElement->Content();? ?? ???}? ?else {? ?LOG(_L("no result"));? ?return KNullDesC8();? ?? ???}? ? }??TPtrC8 CHelloWorldResult::Result()? ? ? ? {? ? ? ? ? ? ? ? CSenElement * pElement = AsElement().Element(KHelloResult);? ? ? ? ? ? ? ? if(pElement)? ? ? ? ? ? ? ? ? ? ? ? {? ? ? ? ? ? ? ? ? ? ? ? _LIT(STR,"result----");? ? ? ? ? ? ? ? ? ? ? ? LOG(STR);? ? ? ? ? ? ? ? ? ? ? ? return pElement->Content();? ? ? ? ? ? ? ? ? ? ? ? }? ? ? ? ? ? ? ? else {? ? ? ? ? ? ? ? ? ? ? ? LOG(_L("no result"));? ? ? ? ? ? ? ? ? ? ? ? return KNullDesC8();? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? }? ? ? ? }其实这儿也好理解,看看CSenElement的SDK文档就知道个八九不离十了。总结一下:1.利用Symbian中的Web Services API实现一个WEB服务客户端是比较烦人的事情,主要的麻烦点在于SOAP请求与响应的XML内容都得自己去构造和解析。2.常用的WebService只有EndPoint没有ID服务,所以它应该是基础型的WS框架。 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |