-1

私が使用している Web サービスは、Web 例外を返しました。サービスは Silverlight アプリケーションから呼び出されます。基本的に私は eps ファイルを png に変換しようとしています。localhost ではすべて正常に動作していますが、Web サーバーにデプロイすると、このエラーが発生します。Silverlight コードは --

  private void btnUploadImage_Click(object sender, RoutedEventArgs e)
        {
            string fileextn = string.Empty;
            OpenFileDialog openDialog = new OpenFileDialog();
            if (openDialog.ShowDialog() == true)
            {
                try
                {
                    string fileExtension = openDialog.File.Extension.ToString();
                    if (fileExtension.Contains("jpeg") || fileExtension.Contains("jpg") || fileExtension.Contains("png") || fileExtension.Contains("tif") || fileExtension.Contains("tiff") || fileExtension.Contains("bmp") || fileExtension.Contains("gif"))
                    {

                        using (Stream stream = openDialog.File.OpenRead())
                        {
                            HtmlPage.Window.Invoke("showProcessingAndBlockUI");
                            // Don't allow really big files (more than 2 MB).
                            if (stream.Length < 5 * 1024 * 1025)
                            {
                                MemoryStream tempStream = new MemoryStream();
                                byte[] data = new byte[stream.Length];
                                stream.Position = 0;
                                stream.Read(data, 0, (int)stream.Length);
                                tempStream.Write(data, 0, (int)stream.Length);
                                stream.Close();
                                ProductConfiguratorServiceClient pcs = new ProductConfiguratorServiceClient();
                                string virtualpath = HelperClass.GetVirtual();
                                pcs.Endpoint.Address = new System.ServiceModel.EndpointAddress(virtualpath + "/Services/ProductConfiguratorService.svc/basic");
                                pcs.GetFormattedImageCompleted += new EventHandler<GetFormattedImageCompletedEventArgs>(pcs_GetFormattedImageCompleted);
                                pcs.GetFormattedImageAsync(data);
                                pcs.CloseAsync();
                                tempStream.Close();
                            }
                            else
                            {
                                MessageBox.Show("Files must be less than 5 MB.");
                            }
                        }
                    }
                    else if (openDialog.File.Extension.Contains("eps"))
                    {
                        HtmlPage.Window.Invoke("showProcessingAndBlockUI");
                        using (Stream stream = openDialog.File.OpenRead())
                        {
                            if (stream.Length < 5 * 1024 * 1025)
                            {
                                MemoryStream tempStream = new MemoryStream();
                                byte[] data = new byte[stream.Length];
                                stream.Position = 0;
                                stream.Read(data, 0, (int)stream.Length);
                                tempStream.Write(data, 0, (int)stream.Length);
                                stream.Close();
                                ProductConfiguratorServiceClient pcs = new ProductConfiguratorServiceClient();
                                string virtualpath = HelperClass.GetVirtual();
                                pcs.Endpoint.Address = new System.ServiceModel.EndpointAddress(virtualpath +                                                                                              "/Services/ProductConfiguratorService.svc/basic");
                                pcs.GetEpsFileIntoPngCompleted += new EventHandler<GetEpsFileIntoPngCompletedEventArgs>(pcs_GetEpsFileIntoPngCompleted);
                                pcs.GetEpsFileIntoPngAsync(data);
                                tempStream.Close();
                            }
                            else
                            {
                                MessageBox.Show("Files must be less than 5 MB.");
                            }
                        }
                    }
                    else
                    {
                        MessageBox.Show("Please Check the Image Format.");
                    }
                }
                catch (Exception)
                {
                    HtmlPage.Window.Invoke("hideBlockUI");
                    MessageBox.Show("Somr Error Occured, Please Try Again Later .");
                }
            }

        }

        void pcs_GetEpsFileIntoPngCompleted(object sender, GetEpsFileIntoPngCompletedEventArgs e)
        {
                busi.CurrentlySelectedOverlayImage.UploadedImageStream = e.Result;
                busi.CurrentlySelectedOverlayImage.ImageFileType = "png";
                RefreshStatus();
                busi.CurrentlySelectedOverlayImageChanged = true;
                HtmlPage.Window.Invoke("hideBlockUI");
        }

        void pcs_GetFormattedImageCompleted(object sender, GetFormattedImageCompletedEventArgs e)
        {
            try
            {
                if (e.Error != null)
                {
                    MessageBox.Show(e.Error.ToString());
                }
                else
                {
                    busi.CurrentlySelectedOverlayImage.UploadedImageStream = e.Result;
                    busi.CurrentlySelectedOverlayImage.ImageFileType = "jpeg";
                    RefreshStatus();
                    busi.CurrentlySelectedOverlayImageChanged = true;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }

            //throw new NotImplementedException();
        }

エラーは にありSystem.Net.Browser.BrowserHttpWebRequestます。

これはどのような問題なのか教えてください。

4

1 に答える 1