Mobile App for Sharepoint

拈花ヽ惹草 提交于 2020-01-02 10:05:48

问题


I'm trying to develop a mobile app that will integrate with Sharepoint 2010 so that my clients can make approvals and stuff from a mobile device. (I'm hoping to build a HTML5/Android Native app that will call webservices and get the job done)

I looked it up and there is a RESTful API for Sharepoint that I think I can use with the ECMAScript library. Can I use this same REST API to view pending approvals, to approve/reject, etc or is the functionality limited to viewing data?

Sorry but i'm a newbie to Sharpoint. Could someone throw a little light on whether I have the right idea?

Thanks


回答1:


For my needs I am using custom SOAP Web Services to do what I want in SharePoint side. Unfortunately, I have no experience with the built-in services, may be it is enough for your needs, but I don't think so. But you can start your investigation here:

http://msdn.microsoft.com/en-us/library/ff521587.aspx

http://msdn.microsoft.com/en-us/library/ee705814.aspx

Creation of custom Web Services is simple and it can give you great possibilities.

On the mobile part I am using Cordova (PhoneGap) to create mobile application (based on Html+JS). For WebService invokation I am using code like this:

var url=server+"/_layouts/CustomWebServices/MyCustomWebService.asmx";
var req = createXMLHTTPObject();
req.onreadystatechange= function(){
    if(req.readyState != 4) return;
    if(req.status != 200) {
        if (onerror)
            onerror('status: '+req.status+req.responseCode+req.responseText);
        return;
    }
    callback();
};
var soapBodyDoc=mkXML(soapBody);
req.open("POST",url,true);
req.setRequestHeader('SOAPAction', 'http://mysite/'+soapAction);
req.setRequestHeader('Content-Type', 'text/xml; charset=utf-8');
req.setRequestHeader('Authorization', 'Basic '+auth);
req.setRequestHeader('Expect', '100-continue');
req.setRequestHeader('Connection', 'Keep-Alive');
req.send(soapBodyDoc);

As you can see I am using Basic authorization. Maybe it is not the best approach, but I am a newbie too :). I can't remember for the moment, what I exactly did to allow Basic authentication, but if you couldn't find this information let me know, I'll try to remember.

To create UI you can use jQuery mobile. It is very useful.

If you have additional questions - let me know.



来源:https://stackoverflow.com/questions/12294274/mobile-app-for-sharepoint

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!