We are attempting to use System.ServiceModel.dll to enact calls on our WCF web service. Our app builds and deploys OK but at runtime the following error is generated..
System.MissingMethodException: The method 'System.Void System.ServiceModel.BasicHttpBinding::.ctor()' has no implementation.
The application is built with System.ServiceModel.dll located in Assets/Plugins/WSA/x86/ and configured to be used on the Hololens platform (WSAPlayer) as seen below. How to address missing method exception?
We tried using different variations of System.ServiceModel.dll available at "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework" and "C:\Program Files\Unity\Editor\Data\" with no luck. Unsure how this error started as our application used to work without complication.
Client calling code
#if !UNITY_EDITOR
public static Service1Client client;
#endif
void Awake()
{
#if !UNITY_EDITOR
client = new Service1Client(new BasicHttpBinding(),
new EndpointAddress("http://myServer/myService/myService.Service1.svc"));
((BasicHttpBinding)client.Endpoint.Binding).MaxBufferSize = 200000000;
((BasicHttpBinding)client.Endpoint.Binding).SendTimeout = System.TimeSpan.FromMinutes(3);
((BasicHttpBinding)client.Endpoint.Binding).MaxReceivedMessageSize = 200000000;
#endif
}
MyServiceClient.cs (generated using Svcutil.exe from the command line)
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#if !UNITY_EDITOR
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
[System.ServiceModel.ServiceContractAttribute(ConfigurationName = "IService1")]
public interface IService1
{
[System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/IService1/getFolderNames", ReplyAction = "http://tempuri.org/IService1/getFolderNamesResponse")]
string[] getFolderNames();
[System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/IService1/getFileNames", ReplyAction = "http://tempuri.org/IService1/getFileNamesResponse")]
string[] getFileNames(string fldrPath);
[System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/IService1/getFileData", ReplyAction = "http://tempuri.org/IService1/getFileDataResponse")]
byte[] getFileData(string filePath);
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
public interface IService1Channel : IService1, System.ServiceModel.IClientChannel
{
}
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
public partial class Service1Client : System.ServiceModel.ClientBase<IService1>, IService1
{
public Service1Client()
{
}
public Service1Client(string endpointConfigurationName) :
base(endpointConfigurationName)
{
}
public Service1Client(string endpointConfigurationName, string remoteAddress) :
base(endpointConfigurationName, remoteAddress)
{
}
public Service1Client(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) :
base(endpointConfigurationName, remoteAddress)
{
}
public Service1Client(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
base(binding, remoteAddress)
{
}
public string[] getFolderNames()
{
return base.Channel.getFolderNames();
}
public string[] getFileNames(string fldrPath)
{
return base.Channel.getFileNames(fldrPath);
}
public byte[] getFileData(string filePath)
{
return base.Channel.getFileData(filePath);
}
}
#endif
The service is working fine as seen below