偷偷摘套内射激情视频,久久精品99国产国产精,中文字幕无线乱码人妻,中文在线中文a,性爽19p

進(jìn)行WCF Web Service創(chuàng)建與編寫(xiě)

開(kāi)發(fā) 后端
WCF Web Service有很多值得學(xué)習(xí)的地方,這里我們主要介紹WCF Web Service,在向大家詳細(xì)介紹XX之前,首先讓大家了解下什么是WCF Web Service

今天上導(dǎo)師的課,在里課堂里提到WCF Web Service創(chuàng)建者在設(shè)計(jì)此項(xiàng)技術(shù)時(shí)的一個(gè)基本原則:“服務(wù)具有自主性:服務(wù)及其客戶端同意它們之間的接口,但相互獨(dú)立。它們可以采用不同的語(yǔ)言編寫(xiě)。#t#

可以使用不同的運(yùn)行時(shí)環(huán)境(如   CLR   和   Java   虛擬機(jī)),可以運(yùn)行在不同操作系統(tǒng)上,還可以存在其他方面的不同?!?nbsp;  我想這就說(shuō)明   Indigo   的   Service   可以發(fā)布成一個(gè)標(biāo)準(zhǔn)的WCF Web Service ,客戶端可以是任意語(yǔ)言編寫(xiě)的程序,只要它能通過(guò)WCF Web Service    的方式與其他程序交互。  

我做了以下嘗試:   

1.   用   WCF   寫(xiě)一個(gè)   Service。

  1. <configuration       
  2.         xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">     
  3.       <system.serviceModel>     
  4.           <services>     
  5.                    
  6.               <service   name="WcfServer.MathService"     
  7.                                 behaviorConfiguration="MathServiceBehavior">     
  8.                   <host>     
  9.                       <baseAddresses>     
  10.                           <add   baseAddress="http://localhost:8000/MathService"/>     
  11.                       baseAddresses>     
  12.                   host>     
  13.                        
  14.                   <endpoint       
  15.                       address=""     
  16.                       binding="basicHttpBinding"     
  17.                       contract="WcfServer.IMath"/>     
  18.               service>     
  19.           services>     
  20.           <behaviors>     
  21.               <serviceBehaviors>     
  22.                   <behavior   name="MathServiceBehavior">     
  23.                       <serviceMetadata   httpGetEnabled="True"/>     
  24.                       <serviceDebug   includeExceptionDetailInFaults="False"   />     
  25.                   behavior>     
  26.               serviceBehaviors>     
  27.           behaviors>     
  28.       system.serviceModel>     
  29.   configuration>     
  30.       
  31.   2.   運(yùn)行這個(gè)程序啟動(dòng)   WCF   服務(wù)     
  32.       
  33.   3.   用   WSDL   工具生成一個(gè)代理類(lèi)     
  34.       
  35.   在控制臺(tái)中輸入:wsdl   http://localhost:8000/MathService?wsdl     
  36.       
  37.   4.   創(chuàng)建一個(gè)客戶端工程,把生成的代理加入這個(gè)工程中:     
  38.       
  39.   namespace   UsingWebServiceMode     
  40.   {     
  41.           class   Program     
  42.           {     
  43.                   static   void   Main(string[]   args)     
  44.                   {     
  45.                           MathService   proxy   =   new   MathService();     
  46.                           int   result;     
  47.                           bool   resultSpecified;     
  48.                           proxy.Add(4,   true,   5,   true,   out   result,   out   resultSpecified);     
  49.                           Console.WriteLine(result);     
  50.                           Console.WriteLine(resultSpecified);     
  51.                           Console.ReadLine();     
  52.                   }     
  53.           }     
  54.   }     

我的最終目的是要讓 Java 寫(xiě)的程序與WCF 技術(shù)實(shí)現(xiàn)的Service進(jìn)行交互,要想讓 Java 的程序和.Net的程序交互,我想最好的方法就是WCF Web Service  。我寫(xiě)的那些代碼就是想先試一下C# 的代碼能否用WCF Web Service 的方式與WCF技術(shù)實(shí)現(xiàn)的Service 進(jìn)行交互,但現(xiàn)在的問(wèn)題是我沒(méi)法精確控制這個(gè)WCF Web Service 的接口。

責(zé)任編輯:chenqingxiang 來(lái)源: 計(jì)世網(wǎng)
相關(guān)推薦

2009-12-08 18:14:53

WCF Service

2009-11-06 10:11:34

WCF和Web Ser

2009-12-08 11:34:40

WCF Windows

2009-08-11 13:27:22

C#創(chuàng)建Web Ser

2009-04-13 11:31:55

IBMdWWebService

2009-12-07 18:33:31

WCF Service

2009-12-08 16:42:48

WCF Service

2011-03-24 09:36:48

AzureWCF Service

2009-12-08 10:35:29

WCF地址

2009-12-08 16:01:50

WCF Service

2011-04-28 15:18:59

2009-11-09 10:43:51

WCF Web編程模型

2011-10-27 16:24:48

API

2009-12-08 18:31:58

WCF WEB

2009-12-07 18:47:16

WCF流

2019-11-23 15:45:38

Web指紋識(shí)別指紋

2009-12-08 11:08:27

WCF雙向

2009-12-08 13:46:16

Silverlight

2009-12-08 17:08:13

WCF Service

2009-11-06 13:59:09

WCF Service
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)