.net 調用java service 代理類方法

來源:互聯網
上載者:User

標籤:strong   oracle   輸入   參數   sdl   config   rpo   程式   需要   

    通過Svcutil.exe 工具組建代理程式類調用

            1.找到如下地址“C:\Windows\System32\cmd.exe”  命令列工具,右鍵以管理員身份運行(視系統是否為win7 而定) 

            2.輸入如下命令:"C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\SvcUtil.exe" /out:C:\WCFClint\ClientCode.cs /config:C:\WCFClint\app.config http://localhost:81/WCFServiceTest/CNPatentSearchService.svc

              說明:

              參數1:  “C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\SvcUtil.exe”   ,是指 SvcUtil.exe 工具的地址

              參數2:  “C:\WCFClint\ClientCode.cs ”   ,是指產生的代理類輸出存放到的地址

              參數3:  “C:\WCFClint\app.config ”   ,是指存放到調用WCF服務程式目錄下的設定檔的輸出存放地址

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

              

            3.運行以上命令後,會在"C:\WCFClint\"目錄下產生兩個檔案,ClientCode.cs  和app.config

          (C:\WCFClint\app.config 中已經為我們配置好了WCF服務的根節點等必須的資訊,當然,如果您也可以自己對部分參數進行修改)

            4.將ClientCode.cs  和app.config 添加到需要調用WCF服務的項目中

            5.在需要調用WCF服務的項目中添加對"System.ServiceModel" 和"System.Runtime.Serialization" 程式集的引用

            6.自此就完成了部署和代理類產生的所有操作,我們只需要在項目中執行個體化 ClientCode.cs 中的服務類 ,並調用其中的方法即可

 我的實際操作"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\SvcUtil.exe" /out:C:\WCFClint\ClientCode.cs /config:C:\WCFClint\app.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:\WCFClint\ClientCode.cs
C:\WCFClint\app.config

C:\WINDOWS\system32>exit oracle  查詢使用 WmsCancelAllocateoutServiceClient client= new WmsCancelAllocateoutServiceClient();                   blResult=("1" ==client.cancleAllocateout(allocateOut.AllocateOutNo,allocateOut.TargetWareHouseNo));  發現dblink如果很慢可以用這種方式加個/*+driving_site(xxx)*/,查詢很快

 

.net 調用java service 代理類方法

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.