2
votes

I'm working on a SharePoint mobile solution where I'm using the web services exposed in server/_vti_bin/sitedata.asmx, server/_vti_bin/Lists.asmx and server/_vti_bin/copy.asmx.
I'm able to successfully fetch the list of sites, document libraries and files using the services defined in server/_vti_bin/sitedata.asmx.
Now I'm actually trying to upload an image file from Photo Albums available in iOS to SharePoint. For this, I tried using CopyIntoItems web service, where in I'm getting the following error response.

    <CopyResult ErrorCode="DestinationInvalid" ErrorMessage="The Copy web service method must be called on the same domain that contains the destination url." DestinationUrl="http://xxxxserveripxxxxxx/Shared Documents/image1.png"/>

But came to know that this service is used only if the file to be uploaded is also from the same source(i.e., from sharepoint). Is there any other way to upload a file available in iPhone to SharePoint.

Also tired addAttachment service defiend in server/_vti_bin/Lists.asmx but I'm unable to identify the input parameters which requires list name and list Item ID.

I'm trying to upload a file to Shared Documents, so I've List Name value which is the one in curly braces of Shared Documents but now what should be the List Item Id value?

These are the details I've with regard to "Shared Documents" document library.

    {
                    AllowAnonymousAccess = false;
                    AnonymousViewListItems = false;
                    BaseTemplate = DocumentLibrary;
                    BaseType = DocumentLibrary;
                    DefaultViewUrl = "/Shared Documents/Forms/AllItems.aspx";
                    Description = "Share a document with the team by adding it to this document library.";
                    InheritedSecurity = true;
                    InternalName = "{425F837A-F110-4876-98DE-C92902446935}";
                    LastModified = "2013-07-26 20:09:58Z";
                    ReadSecurity = 1;
                    Title = "Shared Documents";
                },

So, I'm using the using InternalName value for listName tag.
What should be the value of listItemID?

Am I going in the right way or is there any other approach to upload a local file from mobile to SharePoint?

Thanks Sudheer

1

1 Answers

0
votes

Are you actually calling a URL or are you using the IP (you x'ed it out and said server IP)? If you don't have Alternate Access Mappings defined for the IP, uploads will fail but the GET requests will generally work ok.