2
Answers

The IXmlSerializable type 'System.Xml.Linq.XElement' cannot

Photo of M B

M B

8y
228
1
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 XElement
 
Thanks in advance 

Answers (2)

1
Photo of M B
NA 51 4.1k 8y
Code Here :-
 
BasicHttpsBinding myBinding = new BasicHttpsBinding();
myBinding.Name = "CustomerLinkV2Soap";
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);

0
Photo of Nilesh Shah
NA 22.3k 215.1k 8y
always post your code snippet or upload source code for someone to help you