I have a large third party webservice; the reference.cs is 33 Mbyte. Using Visual Studio 2017, the proxy uses the XML Serializer, which causes a 5 second delay when creating the channel. I opened a case at Microsoft, and they showed me partially how to modify the reference.cs to use the Datacontract serializer. On the same machine the channel is created in 20 mseconds, which would perfect match my needs.
Unfortunatly the messages fail with small differences, and Microsoft support cannot help.
Are there known restrictions? Any patterns I should look for which makes it for sure it will not work at all and I should start rewriting everything using HTTP Requests?
Actual method which results in overall delay:
public XmlMembersMapping ImportMembersMapping(string elementName, string ns,
XmlReflectionMember[] members, bool hasWrapperElement, bool writeAccessors,
bool validate, XmlMappingAccess access) {
ElementAccessor element = new ElementAccessor();
element.IsSoap = true;
element.Name = elementName == null || elementName.Length == 0 ? elementName :
XmlConvert.EncodeLocalName(elementName);
}