using System.Collections.Generic;
using System.Xml.Serialization;
using System.ServiceModel.Description;
using System.ServiceModel.Channels;
using System.ServiceModel.Web;
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
[System.ServiceModel.ServiceContractAttribute(Namespace = "urn:ANDR_service", ConfigurationName = "ANDR_servicePort")]
public interface ANDR_servicePort
[System.ServiceModel.OperationContractAttribute(Action = "http://soapAction", ReplyAction = "*")]
[System.ServiceModel.XmlSerializerFormatAttribute(Style = System.ServiceModel.OperationFormatStyle.Rpc, Use = System.ServiceModel.OperationFormatUse.Encoded)]
WORKResponse WORK(WORKRequest request);
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
[System.ServiceModel.MessageContractAttribute(WrapperName = "WORK", WrapperNamespace = "http://soapEndpoint", IsWrapped = true)]
public partial class WORKRequest
[System.ServiceModel.MessageBodyMember(Name = "data", Namespace = "", Order = 0)]
public CDataWrapper DataCData { get { return data; } set { data = value; } }
public WORKRequest(string data)
[XmlSchemaProvider("GenerateSchema")]
public sealed class CDataWrapper : IXmlSerializable
public static implicit operator string(CDataWrapper value)
return value == null ? null : value.Value;
public static implicit operator CDataWrapper(string value)
return value == null ? null : new CDataWrapper { Value = value };
public System.Xml.Schema.XmlSchema GetSchema()
public static XmlQualifiedName GenerateSchema(XmlSchemaSet xs)
return XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.String).QualifiedName;
public void WriteXml(XmlWriter writer)
if (!string.IsNullOrEmpty(Value))
writer.WriteCData(Value);
public void ReadXml(XmlReader reader)
if (reader.IsEmptyElement)
case XmlNodeType.EndElement:
Value = reader.ReadContentAsString();
throw new InvalidOperationException("Expected text/cdata");
public string Value { get; set; }
public override string ToString()
public static void Test()
var request = new WORKRequest(GetXml());
var requestXml = MessageContractSerializerHelper.ToMessageXml(request, "post");
Console.WriteLine(requestXml);
public static string GetXml()
string xml = @"<Invoice><Samples><Sample><AccountNumber>55761598808</AccountNumber></Sample></Samples></Invoice>";
public static class MessageContractSerializerHelper
public static Message ToMessage<T>(this T typedMessage, string action)
var converter = TypedMessageConverter.Create(typedMessage.GetType(), action);
return converter.ToMessage(typedMessage);
public static string ToMessageXml<T>(this T typedMessage, string action)
return typedMessage.ToMessage(action).ToString();
public static Message ToMessage<T>(this T typedMessage, string action, string defaultNamespace)
var converter = TypedMessageConverter.Create(typedMessage.GetType(), action, defaultNamespace);
return converter.ToMessage(typedMessage);
public static string ToMessageXml<T>(this T typedMessage, string action, string defaultNamespace)
return typedMessage.ToMessage(action, defaultNamespace).ToString();
public static void Main()
Console.WriteLine("Roslyn 2.0 Compiler; Environment version: " + Environment.Version);
Console.WriteLine("Uncaught exception: ");