Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

ASP.NET error when using LC Web Services

Avatar

Level 2

I have installed LiveCycle in JBOSS and I have developed an application using ASP.NET (C#) to allow PDF Form upload and extract the PDF Form data into XML.

My program runs OK under VS 2008 debugging mode but when I tried to deploy the program into IIS. It has the following problem.

"The URI prefix is not recognized"

And My program code is shown below:

public string Convert(string pdfPath, string pdfFile)
        {
           
            string outputXml = "";
            try
            {

                LiveCycleLogin lcl = new LiveCycleLogin();
                //Create an OutputServiceClient object
                FormDataIntegrationClient dataClient = new FormDataIntegrationClient();
                dataClient.Endpoint.Address = new System.ServiceModel.EndpointAddress(lcl.ServiceWeb);
                //Enable BASIC HTTP authentication
                BasicHttpBinding b = (BasicHttpBinding)dataClient.Endpoint.Binding;
                b.MessageEncoding = WSMessageEncoding.Mtom;
                dataClient.ClientCredentials.UserName.UserName = lcl.UserName;
                dataClient.ClientCredentials.UserName.Password = lcl.PassWord;
                b.Security.Transport.ClientCredentialType = HttpClientCredentialType.Basic;
                b.Security.Mode = BasicHttpSecurityMode.TransportCredentialOnly;
                b.MaxReceivedMessageSize = 2000000;
                b.MaxBufferSize = 2000000;
                b.ReaderQuotas.MaxArrayLength = 2000000;

                //Create a BLOB object to store the form from which data is exported
                BLOB inForm = new BLOB();

                //Reference the form that contains data
                string inputFileName2 = pdfPath;

                FileStream fs2 = new FileStream(inputFileName2, FileMode.Open);

                //Get the length of the file stream and create a byte array
                int len2 = (int)fs2.Length;
                byte[] byteArray2 = new byte[len2];

                //Populate the byte array with the contents of the file stream
                fs2.Read(byteArray2, 0, len2);

                //Populate the BLOB object
                inForm.MTOM = byteArray2;

                //Export form data
                BLOB outData = dataClient.exportData(inForm);  <----------------- Program flow error

                //Write the XML data to a XML file
                byte[] outByteArray = outData.MTOM;

                //Create a new file to store result data
                string FILE_NAME = "C:\\Inetpub\\wwwroot\\pages\\" + pdfFile +".xml";
                 FileStream fs3 = new FileStream(FILE_NAME, FileMode.OpenOrCreate);

                //Create a BinaryWriter object
                BinaryWriter w = new BinaryWriter(fs3);
                w.Write(outByteArray);
                w.Close();
                fs3.Close();
                outputXml += FILE_NAME; 
            }
            catch (Exception ee)
            {
                outputXml += ee.Message;
            }

            return outputXml;
        }

}

Can anyone help me to figure out the problem and provide some solutions for that? Thank you.

0 Replies