{
public class XmlSerializerOperationBehavior
: IOperationBehavior
-#if !NET_2_1
+#if !MOBILE
, IWsdlExportExtension
#endif
{
public XmlSerializerOperationBehavior (
OperationDescription operation,
- XmlSerializerFormatAttribute format)
+ XmlSerializerFormatAttribute attribute)
{
- if (format == null)
- format = new XmlSerializerFormatAttribute ();
- this.format = format;
+ if (operation == null)
+ throw new ArgumentNullException ("operation");
+ if (attribute == null)
+ attribute = new XmlSerializerFormatAttribute ();
+ this.format = attribute;
this.operation = operation;
}
OperationDescription description,
BindingParameterCollection parameters)
{
- throw new NotImplementedException ();
}
-#if !NET_2_1
void IOperationBehavior.ApplyDispatchBehavior (
OperationDescription description,
DispatchOperation dispatch)
{
- throw new NotImplementedException ();
+ if (description == null)
+ throw new ArgumentNullException ("description");
+ if (dispatch == null)
+ throw new ArgumentNullException ("dispatch");
+ dispatch.Formatter = new XmlMessagesFormatter (description, format);
}
-#endif
void IOperationBehavior.ApplyClientBehavior (
OperationDescription description,
ClientOperation proxy)
{
- throw new NotImplementedException ();
+ if (description == null)
+ throw new ArgumentNullException ("description");
+ if (proxy == null)
+ throw new ArgumentNullException ("proxy");
+ proxy.Formatter = new XmlMessagesFormatter (description, format);
}
void IOperationBehavior.Validate (
OperationDescription description)
{
- throw new NotImplementedException ();
}
-#if !NET_2_1
+#if !MOBILE && !XAMMAC_4_5
void IWsdlExportExtension.ExportContract (
WsdlExporter exporter,
WsdlContractConversionContext context)