I have an issue where I am giving my Self Hosted WCF service more data than it can handle. I have set the maxReceivedMessageSize on my client, but in this case the client is passing the data to the server, so I need to set MaxReceivedMessageSize on the server. I am not using any config files, and I am not sure how to get it set within my current config...
Client:
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_Iplutocomm"
receiveTimeout="00:05:00" sendTimeout="00:05:00" maxReceivedMessageSize ="210242880">
<readerQuotas maxStringContentLength="2147483647" maxArrayLength="2147483647"/>
</binding>
</basicHttpBinding>
Self Hosted Service
Dim myServiceAddress As New Uri("http://" & LocalIpAddress & ":" & tcp_port & "/" & servicename)
myservicehost = New ServiceHost(GetType(plutocomm), myServiceAddress)
'Enable metadata publishing
Dim smb As New ServiceMetadataBehavior()
smb.HttpGetEnabled = True
smb.MetadataExporter.PolicyVersion = PolicyVersion.Policy15
myservicehost.Description.Behaviors.Add(smb)
myservicehost.Open()
New Changes / Update
Doing it like this, will that override the default basichhtp binding that I assume the framework setup because I did not initially specifically create a binding?
I short, will the below code, running on my service, allow my current client config to "plug in" to the new binding? Will I now still have only one binding a sbefore, but my created one, replacing the default one?
Dim myServiceAddress As New Uri("http://" & LocalIpAddress & ":" & tcp_port & "/" & servicename)
myservicehost = New ServiceHost(GetType(plutocomm), myServiceAddress)
'*******NEW CHANGES
Dim BasicBinding As New BasicHttpBinding
BasicBinding.MaxReceivedMessageSize = 2147483647
myservicehost.AddServiceEndpoint(GetType(plutocomm), BasicBinding, myServiceAddress)
'/*******NEW CHANGES
' Enable metadata publishing.
Dim smb As New ServiceMetadataBehavior()
smb.HttpGetEnabled = True
smb.MetadataExporter.PolicyVersion = PolicyVersion.Policy15
myservicehost.Description.Behaviors.Add(smb)
myservicehost.Open()