NET_2_1 is also defined whenever we define MOBILE, so they have the same effect. Silverlight was 2.1 but it's been dead for a while now, and we do not even support it.
The namespace declarations existed when the entire Message is read but not
in the partial body contents. They caused regressions when we use
serialization stack from referencesource.
It is possible that more namespaces may be requied, but we will be importing
System.ServiceModel later on and then the issue will go away.
So far we don't want regression as long as they show up in our NUnit tests.
This patch is from Brendan Zagaeski and fixes bug 11307
The description of the problem was:
In Mono 2.10.12, the BasicHttpBinding property no longer supports
EnableHttpCookieContainer because it is Depreciated. The replacement
is AllowCookies, but this property does not work. Upon inspection of
the source source, we find that the HttpCookieContainerBindingElement
is added in accordance with EnableHttpCookieContainer, but not
AllowCookies.
The conditional compile logic at [1] is no longer needed for
Xamarin.iOS or Xamarin.Android.
* We now export simple <wsp:Policy>, currently supporting only
those elements that WsdlImporter can import.
WsdlImporter:
https://github.com/mono/mono/commit/cdc98dba1b83341c25a1daab4ae7c217d4961ad1
* Implement `MetadataExporter.Errors' and use it for error
reporting.
* Fixed WsdlExporter's caching to correclty deal with duplicate
ExportContract() and ExportEndpoint() calls.
* Emit <soap12:operation> depending on the binding's MessageVersion.
(FIXME: I didn't implement soap faults yet).
* MetadataTests: Check whether the policy elements are correct.
* MetadataTests: Add test containing simple [OperationContract] method
for http and net.tcp; checks the <soap:operation> / <soap12:operation>
elements.
* New test to check WsdlExporter's behavior regarding duplicate
contracts and endpoints.
* ConnectionOrientedTransportBindingElement.cs, CustomBindingTests.cs,
HttpTransportBindingElementTest.cs: Added test for custom message
encodings.
The WsdlImporter can now import Bindings and Endpoints
from the WSDL, currently supporting BasicHttpBinding,
BasicHttpsBinding and NetTcpBinding.
There is also - limited and still experimental - support
for WS-Policy 1.5. I only did the very basic pieces so
far, for instance things like TransportWithMessageCredentials
are not supported yet.
The policy importer will emit lots of warnings via
`MetadataImporter.Errors` (as warnings, not errors) whenever
it encounters something that it doesn't understand and
is also forgiving towards unknown and/or mal-formed
policy assertions.
This behavior is different from the MS runtime, which is
very strict, but there are simply too many missing pieces
to be more pedentic here. Check whether Errors.Count == 0
to see whether all policy assertions have been correctly
imported.
There are also a few metadata samples, which are part of the
new nunit tests. These are currently working:
BasicHttp.xml, BasicHttp_Mtom.xml, BasicHttp_NtlmAuth.xml,
BasicHttp_TransportSecurity.xml, BasicHttps.xml,
BasicHttps_NtlmAuth.xml, NetTcp.xml, NetTcp_TransferMode.xml,
NetTcp_TransportSecurity.xml
There are a few more in the Tests/MetadataTests/Resources/
directory which demonstrate missing pieces.
This allows
HttpRequestMessageProperty request = new HttpRequestMessageProperty ();
request.Headers.Add ("Foo", "Bar");
OperationContext.Current.OutgoingMessageProperties.Add (HttpRequestMessageProperty.Name, request);
The code was already there, but disabled for the NET_2_1 profile.
.NET throws a EndpointNotFoundException encapsulating a WebException when a
REST request returns a 404.
The attached patch tests for a 404 and throws the same exception chain thrown
by .NET.
OutgoingWebRequestContext throws a NullReferenceException when making a REST
call. The exception is thrown because there are no Headers in the context.
Attached patch simply tests for null before copying values from Headers.
System.ServiceModel.Channels.HttpRequestChannel never added the configured
certificate to the HttpWebRequest which prevented client side authentication.
The attached patch does exactly that if a certificate has been configured.