"Unable to import wsdl: binding error" when trying to add Silverlight service

I get this error when trying to add a new web service in silverlight 4. I opened the client at the data access object level and created the business logic to invoke the service. The error result displayed refers to the launch of a Windows batch file, which should generate the files necessary to invoke the new web service. I searched everywhere for a solution, and I tried changing the type of the reference link to the general list and did not mark “reuse types in shared assemblies” as indicated in another solution (checkbox by right-clicking the instance of the service link in the solution explorer and selecting the reference options services in VS 2010.) Error: cannot import wsdl: binding and error: cannot import wsdl: porttype continue. Any input would be appreciated.

An attempt was made to download metadata from "http: // localhost: 64903 / Services / ServiceWcfS.svc" using WS metadata exchange or DISCO metadata.

Error: Failed to import wsdl: portType
Details: when starting the WSDL import extension, an exception was thrown:
System.ServiceModel.Description.DataContractSerializerMessageContractImporter Error: ISerializable type with the data contract name "PropertyChangedEventHandler" in the namespace "http://schemas.datacontract.org/2004/07/System.ComponentModel" could not be imported. The data contract namespace cannot be configured for ISerializable types, and the generated AccessPoint.WcfServices.ServiceWcfS namespace does not match the required CLR namespace System.ComponentModel. Verify that the required namespace has been mapped to another data contract namespace and view it explicitly using the namespace collection.
XPath to Error Source: // wsdl: definitions [@targetNamespace = 'http://tempuri.org'] / wsdl: portType [@ name = 'IServiceWcfS']

Error: cannot import wsdl: binding Details: Import error of wsdl: portType, on which wsdl: binding depends.
XPath for wsdl: portType: //wsdl:definitions[@targetNamespace='http://tempuri.org']/wsdl:portType[@name='IServiceWcfS']
XPath for error source: //wsdl:definitions[@targetNamespace='http://tempuri.org']/wsdl:binding[@name='BasicHttpBinding_IServiceWcfS']

Error: cannot import wsdl: port
Details: a wsdl: binding import error occurred on which wsdl: port depends.
XPath to wsdl: binding: //wsdl:definitions[@targetNamespace='http://tempuri.org']/wsdl:binding[@name='BasicHttpBinding_IServiceWcfS']
XPath for error source: //wsdl:definitions[@targetNamespace='http://tempuri.org']/wsdl:service[@name='ServiceWcfS']/wsdl:port[@name='BasicHttpBinding_IServiceWcfS']

Error: No Silverlight 4 compatible endpoints were found. The generated client class will not be provided if endpoint information is not provided through the constructor.

+4
source share
1 answer

I know this a bit later, but I think your mistake is right here:

 System.ServiceModel.Description.DataContractSerializerMessageContractImporter Error: ISerializable type with data contract name 'PropertyChangedEventHandler' in namespace... 

PropertyChangedEventHandler is a delegate type and therefore is not serializable, find what uses it (either a data contract or a service method), and delete it.

+1
source

Source: https://habr.com/ru/post/1397484/


All Articles