1 Reply Latest reply on Jul 29, 2011 12:48 PM by Rodrigo_Oliveira

    Using storeContentAPI method ocurr CSInvalidParameterException error.

    Rodrigo_Oliveira

      Hi all,

       

      I have a C# application that access DocumentManagementService web service. I'm tring to use the storeContentAPI, but a get the exception below:

       

       

      ALC-CSV-30106-000: com.adobe.livecycle.contentservices.client.exceptions.CSInvalidParameterException: ALC-CSV-030-106-No Content type specified while invoking [storeContent].; nested exception is:

      ALC-CSV-30106-000: com.adobe.livecycle.contentservices.client.exceptions.CSInvalidParameterException: ALC-CSV-030-106-No Content type specified while invoking [storeContent].

       

       

      My code:

       

       

       

      Details:

      WebService URL: https://localhost:8443/soap/services/DirectoryManagerService?wsdl&lc_version=9.0.1

       

      Can you explain what is wrong?

       

      Thanks in advanced.

       

      Rodrigo

        • 1. Re: Using storeContentAPI method ocurr CSInvalidParameterException error.
          Rodrigo_Oliveira Level 1

          Sorry, my code below:

           

          DocumentManagementServiceService contentSpaceService = new DocumentManagementServiceService

                                                                                 {

                                                                                     Credentials =

                                                                                         new NetworkCredential(_username,

                                                                                                                _password)

                                                                                 };

           

                      string filename = Path.GetFileName(filePath);

           

                      //Create a BLOB object that PDF data

                      BLOB inData = new BLOB();

           

                      FileStream fs = new FileStream(filePath, FileMode.Open);

           

                      //Get the length of the file stream and create a byte array

                      int len = (int) fs.Length;

                      byte[] byteArray = new byte[len];

           

                      //Populate the byte array with the contents of the file stream

                      fs.Read(byteArray, 0, len);

           

                      //Populate the BLOB object

                      inData.binaryData = byteArray;

                      inData.MTOM = byteArray;

           

                      //Set the Description attribute

                      MyMapOf_xsd_string_To_xsd_anyType_Item desAttribute = new MyMapOf_xsd_string_To_xsd_anyType_Item

                                                                                {

                                                                                    key = "{http://www.alfresco.org/model/content/1.0}description",

                                                                                    value = "File stored"

                                                                                };

           

                      ////Set the creator attribute

                      MyMapOf_xsd_string_To_xsd_anyType_Item title = new MyMapOf_xsd_string_To_xsd_anyType_Item

                                                                           {

                                                                               key = "{http://www.alfresco.org/model/content/1.0}title",

                                                                               value = filename

                                                                           };

           

                      ////Set the creator attribute

                      MyMapOf_xsd_string_To_xsd_anyType_Item nodeContentType = new MyMapOf_xsd_string_To_xsd_anyType_Item

                                                                           {

                                                                               key = "{http://www.alfresco.org/model/content/1.0}node-type",

                                                                               value = "application/pdf"

                                                                           };

           

                      //Set the items to the MyMapOf_xsd_string_To_xsd_anyType_Item instance

                      List<MyMapOf_xsd_string_To_xsd_anyType_Item> inputs = new List<MyMapOf_xsd_string_To_xsd_anyType_Item>

                                                                                {

                                                                                    desAttribute,

                                                                                    title,

                                                                                    nodeContentType

                                                                                };

           

                      const string NODE_TYPE = "{http://www.alfresco.org/model/content/1.0}content";

                      const string NODE_ENCODING = "UTF-8";

           

                      string browseLink;

                      CRCResult crcResult;

           

                      contentSpaceService.storeContentAPI(CustomProperties.ContentService_StoreName,

                                                          CustomProperties.ContentSpace_ContentPath, filename,

                                                          NODE_TYPE, inData, NODE_ENCODING, UpdateVersionType.INCREMENT_MINOR_VERSION,

                                                          true, null, inputs.ToArray(), out browseLink, out crcResult);