zoukankan      html  css  js  c++  java
  • .net 调用java service 代理类方法

        通过Svcutil.exe 工具生成代理类调用

                1.找到如下地址“C:WindowsSystem32cmd.exe”  命令行工具,右键以管理员身份运行(视系统是否为win7 而定) 

                2.输入如下命令:"C:Program FilesMicrosoft SDKsWindowsv7.0AinSvcUtil.exe" /out:C:WCFClintClientCode.cs /config:C:WCFClintapp.config http://localhost:81/WCFServiceTest/CNPatentSearchService.svc

                  说明:

                  参数1:  “C:Program FilesMicrosoft SDKsWindowsv7.0AinSvcUtil.exe”   ,是指 SvcUtil.exe 工具的地址

                  参数2:  “C:WCFClintClientCode.cs ”   ,是指生成的代理类输出存放到的地址

                  参数3:  “C:WCFClintapp.config ”   ,是指存放到调用WCF服务程序目录下的配置文件的输出存放地址

                  参数4:  “http://localhost:81/WCFServiceTest/CNPatentSearchService.svc ”   ,是指部署到IIS 的WCF服务的地址

                  

                3.运行以上命令后,会在"C:WCFClint"目录下生成两个文件,ClientCode.cs  和app.config

              (C:WCFClintapp.config 中已经为我们配置好了WCF服务的根节点等必须的信息,当然,如果您也可以自己对部分参数进行修改)

                4.将ClientCode.cs  和app.config 添加到需要调用WCF服务的项目中

                5.在需要调用WCF服务的项目中添加对"System.ServiceModel" 和"System.Runtime.Serialization" 程序集的引用

                6.自此就完成了部署和代理类生成的所有操作,我们只需要在项目中实例化 ClientCode.cs 中的服务类 ,并调用其中的方法即可

     
    我的实际操作
    "C:Program Files (x86)Microsoft SDKsWindowsv7.0AinSvcUtil.exe" /out:C:WCFClintClientCode.cs /config:C:WCFClintapp.config http://local:8001/womaiapp/wmsServiceCancelAllocateout?wsdl
    Microsoft (R) Service Model Metadata Tool
    [Microsoft (R) Windows (R) Communication Foundation, Version 3.0.4506.2152]
    Copyright (c) Microsoft Corporation.  All rights reserved.

    Attempting to download metadata from 'http://local:8001/womaiapp/wmsServic
    eCancelAllocateout?wsdl' using WS-Metadata Exchange or DISCO.
    Generating files...
    C:WCFClintClientCode.cs
    C:WCFClintapp.config

    C:WINDOWSsystem32>exit
     
    oracle  查询
    使用
     WmsCancelAllocateoutServiceClient client= new WmsCancelAllocateoutServiceClient();
                       blResult=("1" ==client.cancleAllocateout(allocateOut.AllocateOutNo,allocateOut.TargetWareHouseNo));
     
     
    发现dblink如果很慢可以用这种方式加个/*+driving_site(xxx)*/,查询很快
  • 相关阅读:
    测试精进之路
    访问Apache服务器自动跳转到https协议
    如何安装Chrome OS系统
    遇到Project Target Framework Not Installed解决方法
    2019开发者调查结果和总结
    「工具神器」推荐一个扒网页的神器
    Linux 使用Unzip提示write error (disk full?). Continue? (y/n/^C)的解决方法
    安卓编译Failed to authenticate Jack server certificate错误问题解决办法
    如何手动给APK文件签名
    如何给个人网站添加免费的SSL
  • 原文地址:https://www.cnblogs.com/Blogs-Wang/p/6140624.html
Copyright © 2011-2022 走看看