Convert SPFieldType to Copy.asmx FieldType

How do you convert a SPFieldType to a Copy.asmx FieldType?
I'm trying something like this, but with zero luck.
fieldInfo = new CopyWebServ.FieldInformation();
SPFieldType spType = item.Fields[sConfigField].Type;
fieldInfo.Type = spType;
Error:
Cannot implicitly convert type 'Microsoft.SharePoint.SPFieldType' to 'projectName.CopyWebServ.FieldType'. An explicit conversion exists (are you missing a cast?)
www.SharePointed.com

Hi,
Please try to use the code line below:
fieldInfo.Type = (FieldType)spType;
If you want to use the Copy.asmx web service, we need to use FieldType Enumeration to set the FieldInformation.Type.
http://msdn.microsoft.com/en-us/library/copy.fieldtype(v=office.12).aspx
Here is an example for your reference:
http://blog.jordanhopfner.com/2012/05/02/upload-a-file-to-sharepoint-2010-using-c-and-the-sharepoint-web-service/
If your code runs at in SharePoint server, I suggest you use Server Object Model to meet your requirement.
http://www.c-sharpcorner.com/Blogs/10493/programmatically-copy-items-from-one-list-to-another-in-shar.aspx
Thanks,
Dennis Guo
TechNet Community Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
[email protected]
Dennis Guo
TechNet Community Support

Similar Messages

  • Using CopyIntoItems from Copy.asmx from a remote soap client

    Hello,
    I have been working on a soap client that runs on a remote client (not on the SharePoint server) and is platform-independent so that it cannot use the SP Object Model. I have managed to get most of the functionality working using SharePoint web-services except for CopyIntoItems.
    My target server is a SharePoint 2007 server and I have a Document Library set up so I can upload files into it.
    My soap request looks as follows.
    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body>
    <CopyIntoItems xmlns="http://schemas.microsoft.com/sharepoint/soap/">
    <SourceUrl>http://null</SourceUrl>
    <DestinationUrls>
    <string>http://shpt.ad2010.local:35492/sites/targetsubsite/Test List/hello.txt</string>
    </DestinationUrls>
    <Fields>
    <FieldInformation Type="Text" DisplayName="Test Column2" InternalName="Test_x0020_Column20" Id="{8c35c0ca-d578-47fd-b7f3-aed199141c86}" Value="Value 0" />
    <FieldInformation Type="Text" DisplayName="Test Column3" InternalName="Test_x0020_Column30" Id="{6c0d3fe3-4f0d-4cff-997b-201747f83315}" Value="Value 1" />
    </Fields>
    <Stream>WW91IHNheSBoZWxsbywgSSBzYXkgZ29vZGJ5ZQ==
    </Stream>
    </CopyIntoItems>
    </soap:Body>
    </soap:Envelope>
    The URL I am invoking this on is: http://shpt.ad2010.local:35492/sites/targetsubsite/_vti_bin/Copy.asmx
    The response I get back is as follows:
    <?xml version="1.0" ?>
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soap:Body>
    <CopyIntoItemsResponse xmlns="http://schemas.microsoft.com/sharepoint/soap/">
    <CopyIntoItemsResult>
    0
    </CopyIntoItemsResult>
    <Results>
    <CopyResult DestinationUrl="http://shpt.ad2010.local:35492/sites/targetsubsite/Test List/hello.txt" ErrorCode="DestinationInvalid" ErrorMessage="The Copy web service method must be called on the same domain that contains the destination url."/>
    </Results>
    </CopyIntoItemsResponse>
    </soap:Body>
    </soap:Envelope>
    I am unable to find any help on the error mentioned here. I have tried setting the source URL to something valid (I have to make it up because there really is no source URL as I copy from the remote client).
    I wonder if I can even use the CopyIntoItems request (or the Copy web-service as a whole) from a remote soap client, and whether it was only meant to be used for copies between SharePoint Sites. Any clues are much appreciated.

    I am trying to use the copy.asmx service to upload a file from a custom sharepoint form into a document library, and I can only use javascript with jquery. (no visual studio)
    I have a similar soap envelope.
    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body>
    <CopyIntoItems xmlns="http://schemas.microsoft.com/sharepoint/soap/">
    <SourceUrl>C://dir/file.txt</SourceUrl>
    <DestinationUrls>
    <string>http://[server]/sites/subsite/Demo List/sample.txt</string>
    </DestinationUrls>
    <Fields>
    <FieldInformation Type="Text" DisplayName="Title" InternalName="Title" Id="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" Value="Test Value" />
    </Fields>
    <Stream>base64Binary</Stream>
    </CopyIntoItems>
    </soap:Body>
    </soap:Envelope>
    I'm getting a 500 "internal server error" back.
    Can anyone see what I'm doing wrong ?
    Kris Blair

  • Workflow- iTunes Convert to AAC, copy to ipod & delete converted files

    I like to save my music in either Apple Lossless or MP3 (320kb) formats. Unfortunately, when I go to save these onto my ipod mini the files are too large and take up too much space. Id like to try and mimic the software that comes with an ipod shuffle where it can take any file, compress it and copy it to my ipod mini without creating duplicates in my itunes.
    Can anyone offer some advice on how to create a workflow to do the following:
    1. Get selected itunes songs (any kind)
    2. Convert to AAC
    3. Copy to ipod
    4 Delete the converted files in itunes
    Ive looked at some of the automator actions and im a bit confused with the difference of
    - delete original selected tracks -OR-
    -delete files of the original selected tracks
    that are options with the "convert tracks" or "copy tracks to ipod" actions

    For the record, these 3rd party actions are not part of a default Automator installation. They're available for download here.
    Now, you could think of iTunes as basically a very fancy collection of aliases. When you delete a tack in iTunes, it asks if you want to move the files to the trash, or keep them in your music folder. If you select "Keep Files" what you end up with is a bunch of orphans: files that physically exist in your music folder, but are no longer accessible through the iTunes interface. You have, in effect, deleted the alias without deleting the file.
    And that, as far as I can tell, is the reasoning behind the two seemingly redundant check boxes in these actions.

  • Does COPY.ASMX support MTOM?

    Hi,
    We have a requirement to receive large files (approx 10 megs) in our SharePoint 2010 farm via the copy.asmx web service. Our company uses an Enterprise Service Bus product from IBM called Data Power that allows the transmittal of large files via MTOM.
    The way this works is that the consumer calls the web service from Data Power, which then calls copy.asmx from SharePoint. The point of having Data Power in the middle of the web service call is that it provides administrative services like auditing and
    alerting.
    So my question is, does copy.asmx support MTOM? Our SharePoint developers do not have experience with MTOM but if copy.asmx DOES support MTOM I can get a developer who is familiar with it.
    Thanks in advance for your time.
    Kathryn Buraczynski
    Buraczynski

    I didn't think so, but when I look at the web.config, it *does* appear that MTOM is available using the endpoints addresses:
     CellStorageService, which supports the StreamBinding binding
     CellStorageServiceBasic, which supports the StreamBindingBasic binding
     CellStorageServiceDigest, which supports the StreamBindingDigest binding
     CellStorageServiceNtlm, which supports the StreamBindingNtlm binding
     CellStorageServiceHttps, which supports the StreamBindingHttps binding
     CellStorageServiceHttpsBasic, which supports the StreamBindingHttpsBasic binding
     CellStorageServiceHttpsDigest, which supports the StreamBindingHttpsDigest binding
     CellStorageServiceHttpsNtlm, which supports the StreamBindingHttpsNtlm binding
    Scott Brickey
    MCTS, MCPD, MCITP
    www.sbrickey.com
    Strategic Data Systems - for all your SharePoint needs

  • Endashes and quotes are not converted correctly when copying FM files by reference

    I'm using FM7 in the TCS1 in a Windows XP environment. I am copying FM books by reference into my RH project.
    I'm noticing that endashes (–) and quotation marks (") are not consistently coming across correctly in my RH project.  Instead, I am getting &endash; for the endash, and &rdquor: instead of a quote.  Note: it appears to be only the first quote that encloses text that doesn't convert; the closing quote converts.
    Any ideas?

    I have RoboHelp 7 and the patches won't install unless I do a complete reinstall.  Since I'm at the end of a release, that will have to wait.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Mary K. Greer
    Information Developer - Learning Management Solutions
    Intelligent Automation Solutions Client Services
    407.771.8187

  • How to call COPY web service from sharepoint in SAP

    Hello Experts,
    I want to call COPY web service from SharePoint in SAP  web dynpro / JAVA application.
    However, when I try to connect to web service and download wsdl using   http:// <hostname:port>/_vti_bin/copy.asmx?wsdl
    it results in Unauthorized error and doesnt complete the setup. Detail error is :
     Error occurred while downloading WSIL file. Error message: Deserializing xml stream  http:// <hostname:port>/_vti_bin/copy.asmx?wsdl
    failed.com.sap.engine.services.webservices.espbase.wsdl.exceptions.WSDLException: Invalid Response Code: (401) Unauthorized. The requested URL was:"Connect to 
    http:// <hostname:port>/_vti_bin/copy.asmx?wsdl , used user to connect: userid"
    I am trying to connect with server user account. Any idea on what authorizations might be required or any help on the scenario .
    -Abhijeet

    Here's an example on how to delete a list item, hopefully this helps
    package com.jw.sharepoint.examples;
    import java.io.File;
    import java.text.SimpleDateFormat;
    import java.util.Calendar;
    import java.util.Date;
    import java.util.Properties;
    import org.apache.commons.logging.Log;
    import org.apache.commons.logging.LogFactory;
    import org.w3c.dom.Element;
    import org.w3c.dom.Node;
    import org.w3c.dom.NodeList;
    import com.microsoft.sharepoint.webservices.CopySoap;
    import com.microsoft.sharepoint.webservices.GetListItems;
    import com.microsoft.sharepoint.webservices.GetListItemsResponse;
    import com.microsoft.sharepoint.webservices.ListsSoap;
    import com.microsoft.sharepoint.webservices.UpdateListItems.Updates;
    import com.microsoft.sharepoint.webservices.UpdateListItemsResponse.UpdateListItemsResult;
    public class SharePointDeleteListItemExample extends SharePointBaseExample {
     private String delete = null;
     private String deleteListItemQuery = null;
     private String queryOptions = null;
     private static final Log logger = LogFactory.getLog(SharePointUploadDocumentExample.class);
     private static Properties properties = new Properties();
     public Properties getProperties() {
      return properties;
      * @param args
     public static void main(String[] args) {
      logger.debug("main...");
      SharePointDeleteListItemExample example = new SharePointDeleteListItemExample();
      try {
       example.initialize();
       CopySoap cp = example.getCopySoap();
       example.uploadDocument(cp, properties.getProperty("copy.sourceFile"));
       ListsSoap ls = example.getListsSoap();
       example.executeQueryAndDelete(ls);
      } catch (Exception ex) {
       logger.error("Error caught in main: ", ex);
     public void executeQueryAndDelete(ListsSoap ls) throws Exception {
      Date today = Calendar.getInstance().getTime();
      SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
      String formattedDate = simpleDateFormat.format(today);
      String queryFormatted = String.format(deleteListItemQuery,formattedDate);  
      GetListItems.QueryOptions msQueryOptions = new GetListItems.QueryOptions();
      GetListItems.Query msQuery = new GetListItems.Query();
      msQuery.getContent().add(createSharePointCAMLNode(queryFormatted));
      msQueryOptions.getContent().add(createSharePointCAMLNode(this.queryOptions));
      GetListItemsResponse.GetListItemsResult result = ls.getListItems(
        properties.getProperty("folder"), "", msQuery, null, "",
        msQueryOptions, "");
      writeResult(result.getContent().get(0), System.out);
      Element element = (Element) result.getContent().get(0);
      NodeList nl = element.getElementsByTagName("z:row");
      for (int i = 0; i < nl.getLength(); i++) {
       Node node = nl.item(i);
       String id = node.getAttributes().getNamedItem("ows_ID").getNodeValue();
       String fileRefRelativePath = node.getAttributes().getNamedItem("ows_FileRef").getNodeValue();
       logger.debug("id: " + id);
       logger.debug("fileRefRelativePath: " + fileRefRelativePath);
       String fileRef = properties.getProperty("delete.FileRef.base") + fileRefRelativePath.split("#")[1];
       logger.debug("fileRef: " + fileRef);
       deleteListItem(ls, properties.getProperty("folder"), id, fileRef);
     public void deleteListItem(ListsSoap ls, String listName, String listId, String fileRef) throws Exception {
      String deleteFormatted = String.format(delete, listId, fileRef);  
      Updates u = new Updates();
      u.getContent().add(createSharePointCAMLNode(deleteFormatted));
      UpdateListItemsResult ret = ls.updateListItems(listName, u);
      writeResult(ret.getContent().get(0), System.out);
     public void initialize() throws Exception {
      logger.info("initialize()...");
      properties.load(getClass().getResourceAsStream("/SharePointDeleteListItemExample.properties"));
      super.initialize();
      this.delete = new String(readAll(new File(this.getClass().getResource("/Delete.xml").toURI())));
      this.deleteListItemQuery = new String(readAll(new File(this.getClass().getResource("/DeleteListItemQuery.xml").toURI())));
      this.queryOptions = new String(readAll(new File(this.getClass().getResource("/QueryOptions.xml").toURI())));
    Brandon James SharePoint Developer/Administrator

  • How can I change the default video conversion applied when I copy an AVI file from my PC to my Android HTC One M8 phone?

    Here's the situation...
    I have an Android HTC One M8 phone which I connect via USB cable to my PC, then I use Windows Explorer to drag and drop an AVI file from my PC onto a target folder on the phone. When I would do this after I had first purchased my phone a message box
    would come up with the heading "Convert and Copy" and ask me  "Do you want to convert <filename> before it's copied to your device?" and give me the options "Yes, convert and copy (recommended)" or "No, just
    copy Your file will be copied, but might not play on your device."
    If I chose to convert it converted the file to MP4. No problem, that's what I wanted.
    The problem I now have is that after doing some work with other video applications a while ago where I was outputting WMV files I now find that the default conversion for the above described copy from PC to Android phone now converts files to WMV.
    I simply want it to go back to converting video files copied to my phone as MP4, but I can't seem to find where I can set this!
    It appears that the copy/conversion process in Explorer is being handled in the "Portable Devices Shell Extension" dll - WPDSHEXT.DLL
    Can anyone tell me what I need to do to set the default video conversion back to MP4 ???
    Thanks

    Thanks Rob.
    I actually had no clue what the core problem was caused by. So it's Windows itself...that helps some.
    I'll resubmit there. It might actually have saved time for it to simply have been moved to there instead of off-topic, though I suppose you have to follow protocol.

  • Copy Attachments of sharepoint list item to a document library using Javascript on click of a button

    The requirement is as follows:
    1. We have a SP list. All items in the list have mulitple attachments.
    2. On click of a button, All the attachments of all items should be copied to a document library
    This is to be done from client side only. No server code is acceptable. We have tried following things:
    1. USing Asynch call
    context = new SP.ClientContext("my site name");
             this.oWebsite = context.get_web();
             var lists = oWebsite.get_lists();
             var list = lists.getByTitle('my list name');         
             context.load(oWebsite);
             var folderPath = 'Lists/<my list name>/Attachments/' + folderId;
             var Folder = oWebsite.getFolderByServerRelativeUrl(folderPath);
             context.load(Folder);
             Files = Folder.get_files();
             context.load(Files);
             context.executeQueryAsync(Function.createDelegate(this, this.ExecuteCopyOnSuccess), Function.createDelegate(this, this.ExecuteCopyOnFailure));
    function ExecuteCopyOnSuccess(sender, args) {        
             for(var p=0;p<this.Files.get_count();p++)
         var file = Files.itemAt(p);    
              var filename = file.get_name();      
              if (filename != null) {
                  var newUrl = 'document library url';
                  file.copyTo(newUrl, true);
                  context.executeQueryAsync(null,null);
    In this case, Files.get_count() throws error - The collection has not been initialized. It has not been requested or the request has not been executed. It may need to be explicitly requested.
    2. Using copy.asmx service
    It copies files to document library but some files are blank and are having size 0.
    Thanks!

    Hi,
    I think you can use Document Content types or document sets -
    Here are links that you can refer to
    http://office.microsoft.com/en-us/windows-sharepoint-services-help/introduction-to-content-types-HA010121570.aspx
    http://msdn.microsoft.com/en-us/library/office/ms472236(v=office.14).aspx
    http://office.microsoft.com/en-us/sharepoint-server-help/create-and-configure-a-new-document-set-content-type-HA101782461.aspx
    http://office.microsoft.com/en-us/sharepoint-server-help/introduction-to-document-sets-HA101782466.aspx?CTT=5&origin=HA101782461
    Hope this helps!
    MCITP: SharePoint 2010 Administrator
    MCTS - MOSS 2007 Configuring, .NET 2.0
    | SharePoint Architect | Evangelist |
    http://www.sharepointdeveloper.in/
    http://ramakrishnaraja.blogspot.com/

  • Forcing Audition to copy media rather than reference

    Hi all,
    How do you force Ausition to copy media locally rather than reference it by default. So that when I drag a sound effect from my networked library on to a multitrack session it copies it, rather than referencing the original. By doing this I am safe to make modifications to the sound file and when playing back files they are playing back locally rather than over the network.
    I know i can do this to individual files, but it's a pain. Ideally I want this to the default behaviour.
    Thanks
    R

    Thanks!
    Unfortuantely the iterative nature of working in sound design makes this unworkable as I'm constantly adding and tweaking new sounds; I never know when I'm finished adding/swapping out sounds so I'd be constantly having to exprot the session. I guess I'll have to stick with what I'm currently doing which is to 'convert to unique copy' (or whatever it's called) each file that isn't copied over. It's just a bit of a drag to always have to worry about this when a simple check box in the settings would fix this.
    Thanks again!

  • Convert scanned PDF to PDF containing text?

    Before my last laptop crashed, there was an amazing new (new to me, anyway) feature in Adobe that would attempt to convert a scanned copy of a PDF to a PDF containing text that could be highlighted. I was ecstatic! Whenever I opened a PDF, Adobe would prompt me with a message about trying to convert the PDF to one that could read and recognize text. I would click yes and after the conversion, I could highlight text. After my computer crashed and I re-installed Adobe, I no longer had or could find this feature. I cannot find any information on any type of plug-in or any information related to this feature actually. Please help! What is the plug-in or version of Adobe that will attempt to convert a scanned PDF to a PDF containing text that can be highlighted? Thanks

    Adobe Reader doesn't have support for recognising text. Please try Adobe Acrobat XI for enjoying this feature.
    Here's a link from where you can download Trial Version.
    http://www.adobe.com/cfusion/tdrc/index.cfm?product=acrobat_pro&loc=en

  • Converting From Mp3 to Wav and also dividing a song.

    Is it possible to convert an mp3 to .wav and then split the entire song into 10-second wavs. If there is a way, please share. Thank you. I'm using Quicktime Pro

    Nathan, welcome to these discussions.
    Open the .mp3 file with QT Pro.
    Set the "in and out" (selection markers) to the ten seconds you wish to convert and use "Copy" from the Edit menu.
    Open a new QT Player window (Control-N) and then Control-V (paste).
    Choose "Export" (File menu) and then choose Sound to Wave.
    Repeat for all the conversion you want to make.

  • Converting CLOB to BLOB at once

    Hello all!
    I have to convert CLOB to BLOB in my application. My CLOB contains XML document built with dbms_xmldom, an I need to put it into column of type BLOB. Knowing several ways to do it, I'm searching for the best one. So I considered the folowing:
    - Size of XML data can be more then 4000 bytes.
    - I can convert it "piecewise", copying through varchar2 and raw buffers by chunks. But this is not efficient for me.
    - I can write CLOB to file, then read it into BLOB. But it is not efficient too.
    - I can not change column type to CLOB since it may contain other BLOB data, not XML.
    Actually, I need a way to "cast" CLOB data as binary data when inserting into table. I believe Oracle must have it, but where?
    I'll be very grateful for help from anyone.
    P.S. Using Oracle 9.2

    You could use UTL_RAW.CAST_TO_RAWhttp://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96612/u_raw2.htm#998330
    The XML data can be 32k (the varchar2 limit in PLSQL is 32k, not 4000 bytes)
    If your documents exceeds 32k you need process chunks

  • System copy of GTS - Productive to Test - How to ?

    Dear all,
    We are planning a copy of our SAP sytems from productive to test. We did this already several times including ERP, BW and CRM systems. Now for the first time GTS is involved, too. Is there any special information available on how to do this for GTS 8.0?
    I know that information about ERP - Logical System is included in customs document data (/SAPSLL/CUHD_0251_S-ORGLOGSYS) and suppose that this has to be changed to Logical System ID of the ERP test system after the copy.
    Any information regarding this topic would be much appreciated.
    Regards,
    Ulrich

    Hello Dave,
    Thank you for your feedback!
    Concerning Logical System I already talked to our basis guys. They will use trx BDLS to convert it during copy/refresh process.
    Concerning Logical System Group I think we are safe as we are using the same Logical System Groups (GRPERP for ERP system + GRPGTS for GTS system) across our system landscape for Dev, Test and Prod. After system copy we just need to check/change the grouping table /SAPSLL/TCOGVA itself for correct entries.
    Thanks again and regards,
    Ulrich

  • Facing a problem reading converted PDF chinese document

    Hello I m facing a problem reading Chinese simplified document,,I  converted a TIFF file into PDF and installed Chinese simplified font,,my  need is to select the contents of the converted pdf and copy,paste into  a translator(google or systran) inorder to translate the chinese fonts  into English..but i could not select the converted pdf's contents in  text format,,it copies as images again..Please help with this..

    As the PDF page content is a image (the TIFF) there is no text to to select/copy or save as to text.
    Running the PDF through OCR would provide what OCR "thinks" are the characters.
    However, Adobe Reader does not provide OCR capability.
    Be well...

  • Raw stills in...converted?

    Just wondering.
    When I import my RAW stills, do they remain RAW or does FCPX convert them?
    What about if imported as optimised...or not.
    Does that make a difference?
    Trying to maximise the quality.
    geoff

    When you import images into FCPX, if you leave them at their original location, they stay just like they are. What shows up in the Library is a symbolic link to the original media. They are not converted even when Copied into the Library. This includes CR2, RAW or whatever other format you use. Any conversion occurs in "real time" in the storyline.
    When you import any image and have it Optimized, FCPX will convert it to 10 seconds of ProRes 422 video (of the same dimensions as the original).  This only makes a difference when you apply it to the storyline. When you apply still images (not optimized) to the storyline, FCPX will use the Preferences setting for Still Images:Editing duration length (so that it is possible to apply single frame images by default.) Otherwise, once optimized, no matter what the setting is for still images, FCPX will apply the "image" as a short clip of fixed time.
    The quality of ProRes is regarded as "virtually lossless". You cannot really tell the difference. It should also have the same bit depth (12) as the original RAW images (although somebody with better knowledge about this should chime in here).

Maybe you are looking for