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)*/,查询很快
  • 相关阅读:
    webpack源码学习总结
    并发容器(三)非阻塞队列的并发容器
    并发容器(二)阻塞队列详细介绍
    并发容器(一)同步容器 与 并发容器
    java内存模型(二)深入理解java内存模型的系列好文
    java内存模型(一)正确使用 Volatile 变量
    原子操作类(二)原子操作的实现原理
    原子操作类(一)原子操作类详细介绍
    同步锁源码分析(一)AbstractQueuedSynchronizer原理
    并发工具类(五) Phaser类
  • 原文地址:https://www.cnblogs.com/Blogs-Wang/p/6140624.html
Copyright © 2011-2022 走看看