扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
作者:朱先忠编译 来源:天极开发 2007年11月4日
关键字:
<span class="pf">Class="MyService" |
<span class="pf">Class="TransactableTemperatures</span>" |
<?xml version="1.0"?> <configuration xmlns= "http://schemas.microsoft.com/.NetConfiguration/v2.0"> <system.serviceModel> <services> <service type="TransactableTemperatures"> <endpoint contract="ITransactableTemperatures" binding="wsHttpBinding" bindingConfiguration="Binding1"/> </service > </services > <bindings> |
<wsHttpBinding> <binding configurationName="Binding1" transactionFlow="true" /> </wsHttpBinding> </bindings> </system.serviceModel> <system.web> <compilation debug="true"> <assemblies> <add assembly="System.Transactions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> </assemblies> </compilation> </system.web> </configuration> |
![]() 图2.运行服务-该图显示出示例事务性服务从一个浏览器中运行的结果。 |
![]() 图3.设计客户-该图显示出Visual Studio表单设计器中的Windows表单客户应用程序。 |
<?xml version="1.0" encoding="utf-8" ?> <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0"> <system.serviceModel> <client> <endpoint configurationName="default" address= "http://atlas/TransactableService/Service.svc/" binding="wsHttpBinding" bindingConfiguration="Binding1" contract="ITransactableTemperatures"/> </client> <bindings> <wsHttpBinding> <binding configurationName="Binding1" transactionFlow="true" /> </wsHttpBinding> </bindings> </system.serviceModel> </configuration> |
private void btnConvert_Click(object sender, EventArgs e){ using(TransactableTemperaturesProxy theProxy = new TransactableTemperaturesProxy("default")) { TransactionOptions transactionOptions = new TransactionOptions(); transactionOptions.IsolationLevel =IsolationLevel.ReadCommitted; using ( TransactionScope tx = new TransactionScope( TransactionScopeOption.RequiresNew,transactionOptions)) { double d = Convert.ToDouble(txtIn.Text); double dResult = 0.0D; if (rbCToF.Checked) dResult = theProxy.ctof(d); else dResult = theProxy.ftoc(d); lblOut.Text = dResult.ToString(); tx.Complete(); } } } |
濠碘€冲€归悘澶愬箖閵娾晜濮滈悽顖涚摃閹烩晠宕氶崶鈺傜暠闁诡垰鍘栫花锛勬喆椤ゅ弧濡澘妫楅悡娆撳嫉閳ь剟寮0渚€鐛撻柛婵呮缁楀矂骞庨埀顒勫嫉椤栨瑤绻嗛柟顓у灲缁辨繈鏌囬敐鍕杽閻犱降鍨藉Σ鍕嚊閹跺鈧﹦绱旈幋鐐参楅柡鍫灦閸嬫牗绂掔捄铏规闁哄嫷鍨遍崑宥夋儍閸曨剚浠樺ù锝嗗▕閳ь剚鏌ㄧ欢鐐寸▕鐎b晝顏遍柕鍡嫹
现场直击|2021世界人工智能大会
直击5G创新地带,就在2021MWC上海
5G已至 转型当时——服务提供商如何把握转型的绝佳时机
寻找自己的Flag
华为开发者大会2020(Cloud)- 科技行者