標籤: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 代理類方法