找回密码
 立即注册

QQ登录

只需一步,快速开始

lxj

初级会员

6

主题

26

帖子

202

积分

初级会员

积分
202
lxj
初级会员   /  发表于:2018-4-25 14:22  /   查看:9763  /  回复:20
本帖最后由 lxj 于 2018-4-25 14:25 编辑

系统环境用的:vs2015+leadtools-v19+webService例子引用的是leadtools32位dll类库,
之前例子在leadtools v20的环境下,本地跑过,可以使用,使用VS编译发布到iis上,失败。报错:


附上 例子的代码。源代码文件,27mb只能用百度云盘,附上 下载地址。调用dicom影像的组件,百度云盘下载地址
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.Services;
  6. using Leadtools.Medical.WebViewer.ExternalControl;
  7. using Leadtools;
  8. using Leadtools.Codecs;
  9. namespace LeadTools
  10. {
  11.     /// <summary>
  12.     /// LeadTools 的摘要说明
  13.     /// </summary>
  14.     [WebService(Namespace = "http://tempuri.org/")]
  15.     [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
  16.     [System.ComponentModel.ToolboxItem(false)]
  17.     // 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务,请取消注释以下行。
  18.     // [System.Web.Script.Services.ScriptService]
  19.     public class LeadTools : System.Web.Services.WebService
  20.     {

  21.         [WebMethod]
  22.         public string HelloWorld()
  23.         {
  24.             return "Hello World";
  25.         }
  26.         [WebMethod]
  27.         public void GetImage(string patientId)
  28.         {
  29.             string applicationName;
  30.             string version;
  31.             int externalControlPort = 500;
  32.             // Username a password to log in
  33.             // This will be the username and password that you created when running the CSPacsDatabaseConfig.exe demo
  34.             string username = "a";
  35.             string password = "a";
  36.             MedicalWebViewerExternalController controller = new MedicalWebViewerExternalController("http://localhost/MedicalViewer19");
  37.             //MedicalWebViewerExternalController controller = new MedicalWebViewerExternalController("http://47.98.247.113/MedicalViewer20");
  38.            controller.ServiceURL = "http://localhost/MedicalViewerService19";
  39.              //controller.ServiceURL = "http://47.98.247.113/MedicalViewerServiceWcf20/";
  40.             controller.Timeout = 30;
  41.             controller.InitApplication(out applicationName, out version, externalControlPort);
  42.             controller.SelectedBrowser = MedicalWebViewerBrowser.GoogleChrome;
  43.             ControllerReturnCode loginRes = controller.UserLogin(username, password);
  44.             controller.ShowPatient(patientId);
  45.             /*
  46.             FindPatientOptions optins = new FindPatientOptions();
  47.             List<PatientInfo> patients = new List<PatientInfo>();
  48.             List<StudyInfo> studyList = new List<StudyInfo>();
  49.             ControllerReturnCode findRes = controller.FindPatient(null, optins, patients);
  50.             
  51.             foreach (PatientInfo element in patients)
  52.             {
  53.                
  54.                 //studies += "StudyInstanceUid = " + element.StudyInstanceUid + ";</br>";
  55.             }
  56.             Console.WriteLine(patients);
  57.             controller.FindStudies(null, studyList);
  58.             string studies = "";
  59.             foreach (StudyInfo element in studyList)
  60.             {
  61.                 studies += "StudyInstanceUid = " + element.StudyInstanceUid;
  62.             }
  63.             return studies;
  64.             */
  65.            // controller.CloseApplication();

  66.             // Shutdown the command queue
  67.            // controller.Shutdown();
  68.         }

  69.     }
  70. }
复制代码




本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x

20 个回复

倒序浏览
Richard.Ma讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2018-4-25 16:50:39
沙发
最有可能的问题是iis设置的问题, 64位或者32位需要对应(启用32位应用程序)




本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
回复 使用道具 举报
lxj
初级会员   /  发表于:2018-4-26 09:05:03
板凳
Richard.Ma 发表于 2018-4-25 16:50
最有可能的问题是iis设置的问题, 64位或者32位需要对应(启用32位应用程序)

好的。我试试看。
回复 使用道具 举报
Richard.Ma讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2018-4-26 09:25:45
地板
好的,有问题的话再讨论
回复 使用道具 举报
lxj
初级会员   /  发表于:2018-4-26 10:21:56
5#
Richard.Ma 发表于 2018-4-25 16:50
最有可能的问题是iis设置的问题, 64位或者32位需要对应(启用32位应用程序)

VS 运行调用影像的demo 需要管理员权限 才能跳出影像界面。部署到iis的demo,是直接用的原本的代码。没有用打包后的代码。已经可以跳到页面了。但是没办法跳出影像界面。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
回复 使用道具 举报
lxj
初级会员   /  发表于:2018-4-26 11:00:20
6#
本帖最后由 lxj 于 2018-4-26 13:43 编辑
Richard.Ma 发表于 2018-4-26 09:25
好的,有问题的话再讨论

如果VS不是用管理员的权限运行。登录的代码就会报错,只有用了管理员权限才能正常登录。部署到iis,可以访问,但是调不出影像。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
回复 使用道具 举报
lxj
初级会员   /  发表于:2018-4-26 13:38:08
7#
本帖最后由 lxj 于 2018-4-26 13:39 编辑

需要 vs 用管理员的模式才能运行调用出影像,不然的话调不出来影像,就会报错
  1. 用户代码未处理 System.Runtime.InteropServices.COMException
  2.   ErrorCode=-2147024891
  3.   HResult=-2147024891
  4.   Message=拒绝访问。

  5.   Source=System.DirectoryServices
  6.   StackTrace:
  7.        在 System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)
  8.        在 System.DirectoryServices.DirectoryEntry.Bind()
  9.        在 System.DirectoryServices.DirectoryEntry.get_IsContainer()
  10.        在 System.DirectoryServices.DirectoryEntries.ChildEnumerator..ctor(DirectoryEntry container)
  11.        在 Leadtools.Demos.IISTools.VirtualDirectory.FindAll(String machine)
  12.        在 Leadtools.Demos.IISTools.VirtualDirectory.Find(String machine, String name)
  13.        在 Leadtools.Medical.WebViewer.ExternalControl.MedicalWebViewerExternalController.IsLocalAndInvalid(String value)
  14.        在 Leadtools.Medical.WebViewer.ExternalControl.MedicalWebViewerExternalController.UserLogin(String username, String password)
  15.        在 ImageWebView.webView.GetImage(String patientId) 位置 D:\LXJ\我的文档\357003544\FileRecv\workspace\LeadTools\LeadTools\ImageView.asmx.cs:行号 44
  16.   InnerException:
复制代码

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
回复 使用道具 举报
Richard.Ma讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2018-4-26 15:21:17
8#
方便的话,您还是将项目打包发上来,我帮你验证问题
回复 使用道具 举报
lxj
初级会员   /  发表于:2018-4-26 17:12:35
9#
Richard.Ma 发表于 2018-4-26 15:21
方便的话,您还是将项目打包发上来,我帮你验证问题

超过20mb ,用百度 网盘了。
https://pan.baidu.com/s/16FuzZVpIk8ya4VQSGItDtA

有问题可以随时联系
回复 使用道具 举报
lxj
初级会员   /  发表于:2018-4-26 17:12:48
10#
Richard.Ma 发表于 2018-4-26 15:21
方便的话,您还是将项目打包发上来,我帮你验证问题

超过20mb ,用百度 网盘了。
https://pan.baidu.com/s/16FuzZVpIk8ya4VQSGItDtA

有问题可以随时联系
回复 使用道具 举报
123下一页
您需要登录后才可以回帖 登录 | 立即注册
返回顶部