此方案的正确WCF net.tcp绑定安全性是什么?(What is the correct WCF net.tcp binding security for this scenario?)
我有一个WCF服务,它托管在Windows服务中并具有net.tcp端点。 客户端与服务位于同一LAN(工作组)中,但它们没有服务器的Windows用户帐户。
PS:当我在客户端和服务器中将Security.Mode设置为None时,我收到以下错误:
'{SERVICE ADDRESS}'不支持请求的升级。这可能是由于绑定不匹配(例如客户端而不是服务器上启用了安全性)。
I have a WCF service which is hosted in a Windows Service and has net.tcp endpoint. The clients are in the same LAN (Workgroup) as the service but they don't have the server's Windows user accounts.
PS: When I set the Security.Mode to None in both client and server, I receive the following error:
The requested upgrade is not supported by '{SERVICE ADDRESS}'This could be due to mismatched bindings (for example security enabled on the client and not on the server).
原文:https://stackoverflow.com/questions/3159824
最满意答案
未允许的参数:amount_attributes
根据您的关联,您需要在
event_params
方法amounts_attributes
amount_attributes
更改为amount_attributes
。def event_params params.require(:event).permit(:id, :_destroy, :start_at, :end_at, :title, :detail, :room_id, :category, :ccy, :amount, amount_attributes: [:id, :schedule_id, :room_id, :event_id, :ccy, :amount]) end
Unpermitted parameter: amount_attributes
As per your associations, you need to change
amounts_attributes
toamount_attributes
inevent_params
method.def event_params params.require(:event).permit(:id, :_destroy, :start_at, :end_at, :title, :detail, :room_id, :category, :ccy, :amount, amount_attributes: [:id, :schedule_id, :room_id, :event_id, :ccy, :amount]) end
相关问答
更多-
accepted_nested_attributes_for儿童关联验证失败(accepts_nested_attributes_for child association validation failing)[2023-10-31]
使用Rails 2的这个答案,否则见下面的:inverse_of答案 如果相关联的项目有效,您可以通过检查project_id来解决此问题。 class Task < ActiveRecord::Base belongs_to :project validates_presence_of :project_id, :unless => lambda {|task| task.project.try(:valid?)} validates_associated :project end Us ... -
哦,我明白了这个问题。 几乎没有可能的解决方案。 一种是使用raw html属性手动操作表单 您可以检查表单构建器对象的对象是否是新记录? 然后条件可能如下所示: = f.semantic_fields_for @estimate.moneys.build do |money| - if money.object.new_record? = add your form attribute here 因此,这只会让您显示表单以为表单创建新的嵌套记录。 我希望这个答案至少能给出一个想法。 Oke ...
-
只是一个平庸的问题,如果你在联系表格中使用这个问题不应该是单数地址? <% f.fields_for :address, @contact.address do |builder| %>
<%= builder.label :street1, "Street 1" %> <%= builder.text_field :street1 %>
<% end %> 在你的行动中,你也必须这样做 @ycontact.build_address 如 ...
-
好的,创建一个双(或多于两个)嵌套窗体。 以下是我遵循的步骤来完成工作。 定义正确的关联(如果需要,记得添加class_name: "NameOfClass"和/或inverse_of: :model_name class_name: "NameOfClass" ,以消除Rails的猜测) 例如: teacher.rb class Teacher < ActiveRecord::Base attr_accessible :first_name, :last_name, :address_attribut ...
-
如何使用accepts_nested_attributes_for保存模型?(How to save a model with accepts_nested_attributes_for?)[2023-11-11]
您需要正确设置表单以使用accepts_nested_attributes_for 。 因此,在您的User模型中,您将拥有: accepts_nested_attributes_for :child 并以您的形式,你可以这样做: form_for @user do |f| f.text_field :name #or whatever your user attributes f.fields_for :child, @user.build_child do |child| child ... -
未允许的参数:amount_attributes 根据您的关联,您需要在event_params方法amounts_attributes amount_attributes更改为amount_attributes 。 def event_params params.require(:event).permit(:id, :_destroy, :start_at, :end_at, :title, :detail, :room_id, :category, :ccy, :amount, amount_at ...
-
你没有以正确的格式获得params Parameters: {"utf8"=>"?", "authenticity_token"=>"xxx", "schedule"=>{"title"=>"test", "departure_date"=>"2016-06-24", "room"=>{"room"=>"test name"}}, "commit"=>"Create my schedule"} Unpermitted parameter: room 你的参数应该包含rooms_attributes而不是r ...
-
我刚把回调移到Book而不是BookVersion : after_save :delete_invalid_book_versions def delete_invalid_book_versions book_versions.each do |book_version| book_version.destroy if book_version.price.blank? end end I just moved the callback to Book instead of Book ...
-
我找到了解决问题的方法,我认为保存没有考虑那些标记为_destroy的内容。 此链接更好地描述了问题,并且也得到了答案。 http://homeonrails.com/2012/10/validating-nested-associations-in-rails/ 基本上他拒绝那些被标记为毁灭的人并计算其余的。 I found the fix to my question, I was right that the save doesn't take into account those that are ...
-
代替 validates_uniqueness_of :code, :scope => :parent_id 尝试 validates_uniqueness_of :code, :scope => :parent 除此之外,您还需要在Category类中进行设置: has_many :children, :inverse_of => :category # or whatever name the relation is called in Child 使用inverse_of会在保存之前设置chil ...