I have used external web service in which one of the operation methods contains XElement as a parameter.I am getting an exception which is shown below.
The IXmlSerializable type 'System.Xml.Linq.XElement' cannot be deserialized in partial trust because it does not have a public parameterless constructor
I have tried
XmlElement instead of XElement but this service method return XElementThanks in advance

M B53 reputationPosted Feb 10, 2017, 5:14 AM EST
myBinding.Security.Mode = BasicHttpsSecurityMode.Transport;
myBinding.Security.Transport.ClientCredentialType = HttpClientCredentialType.None;
myBinding.Security.Message.ClientCredentialType = BasicHttpMessageCredentialType.UserName;
// Endpoint Address defining the asmx Service to be called.
EndpointAddress endPointAddress = new EndpointAddress(@"Webservice URL");
// Call to the Web Service using the Binding and End Point Address.
CustomerLinkV2SoapClient myClient = new CustomerLinkV2SoapClient(myBinding, endPointAddress);
// iATSCustomerLinkUS.CustomerLinkV2SoapClient myC = new iATSCustomerLinkUS.CustomerLinkV2SoapClient(myBinding, endPointAddress);
localContext.TracingService.Trace("Process Step 4");
XML response = myClient.CreateCreditCardCustomerCode(parameter1,parameter2,parameter3,parameter4);
Nilesh ShahRank #42 · 34.2K reputationPosted Feb 10, 2017, 4:43 AM EST