启用WCF的Web服务中的事务! [英] Transaction in WCF Enabled Web Service!.. HELP?

查看:98
本文介绍了启用WCF的Web服务中的事务!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
在我开发的Silverlight项目中,应该在加载子窗口时开始事务.如果用户单击OK,将提交所有工作,否则将回滚.
为此,我添加了启用wcf的Web服务,

web.config如下所示:

Hi all,
In a silverlight project which I develop, I should begin transaction when the child window loaded.If user clicks OK, all work will be commited, else will be rollback.
I added a wcf-enabled web service fot this purpose,

web.config is like below:

<customBinding>
 <binding name="myWebService.customBinding0">
                    <transactionFlow transactionProtocol="OleTransactions"/>
                    <httpTransport />
                </binding>
            </customBinding>



当我添加服务引用时,它将在clientConfig端添加配置设置,如下所示.



When I add service reference, it adds the config settings at clientConfig side like below.

clientConfig

 <customBinding>
   <binding name="CustomBinding_myWebService">
                    <binaryMessageEncoding />
                    <httpTransport maxReceivedMessageSize="2147" maxBufferSize="2147" />
                </binding>
            </customBinding>
  <endpoint address="http://localhost/myWebService.svc"
                binding="customBinding" bindingConfiguration="CustomBinding_myWebService"
                contract="myWebServiceReference.myWebService" name="CustomBinding_myWebService" />
 <endpoint/>


将我的方法添加到用于事务的服务后,更新后,它将删除clientConfig中的绑定设置.我无法创建服务的客户端.因为没有要添加的绑定.我该如何解决这个问题?
在此先感谢您的答复.


After I add my methods to the service for transaction, after updating , it removes the binding settings in clientConfig. I can not create the client of service. Because there is no binding to add. How can I solve this problem?
Thanks in advance for the replies..

推荐答案

我意识到 customBinding 不支持事务.我用 wsHttpBinding声明了我的服务这一次.但是当我添加reference时,客户端配置为空.关于绑定名称和相关设置,我应该没有任何东西来描述服务客户端属性.

我该怎么办?
谢谢..
I realized that customBinding does not support transaction.I declared my service with wsHttpBinding this time.But when I add reference , the client config is empty.There is nothing about the binding name and related settings which I should have, to decribe service client property.

What should I do about this?
Thank you..


这篇关于启用WCF的Web服务中的事务!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆