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);
}
Most important, the DataContractSerializer is used to serialize and deserialize data sent in Windows Communication Foundation (WCF) messages. Apply the DataContractAttribute attribute to classes, and the DataMemberAttribute attribute to class members to specify properties and fields that are serialized.
Windows Communication Foundation (WCF) uses the DataContractSerializer as its default serialization engine to convert data into XML and to convert XML back into data. The DataContractSerializer is designed to serialize data contract types.
A data contract is a formal agreement between a service and a client that abstractly describes the data to be exchanged. That is, to communicate, the client and the service do not have to share the same types, only the same data contracts.
The process forms a sequence of bytes into a logical object; this is called an encoding process. At runtime when WCF receives the logical message, it transforms them back into corresponding . Net objects. This process is called serialization.
I've had this problem numerous times. The problem is due to the size of the WSDL that you have from Amadeus. The larger the number of services, the slower it performs. If you create software for air, hotel and car products you end up with a large number of services.
You have two options in this respect;
I go with option 2 as getting Amadeus to implement option 1 is painful and not worth the hassle.
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?
I've made Amadeus integration. Unfortunately, sending HTTP requests was the only solution for me as well. I'm composing Envelopes and "inject" data and send such to webservice and then filling responses by XDocument.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With