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)*/,查询很快
  • 相关阅读:
    关于 Android 平台开发相关的有哪些推荐书籍?
    spring: 在表达式中使用类型
    spring: ?.运算符
    spring:使用会话和请求作用域
    spring:bean的作用域
    spring:自定义限定符注解@interface, 首选bean
    spring: 使用Spring提供的JDBC模板(使用profiles选择数据源/使用基于JDBC驱动的数据源)
    spring: 在Spring应用中使用JDBC(使用profiles选择数据源/使用基于JDBC驱动的数据源)
    python接口自动化-token参数关联登录(二)
    代码
  • 原文地址:https://www.cnblogs.com/Blogs-Wang/p/6140624.html
Copyright © 2011-2022 走看看