Я пытаюсь создать веб-сервиса между 2 сайтов, но когда я называю его я получаю следующее сообщение об ошибке:Ошибка в WebService вызова
System.Web.Services.Protocols.SoapException: System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary. at CreateAttendee..ctor() --- End of inner exception stack trace --- en System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) en System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) en CreateGlothosAttendee.CreateAttendee.Create(String parameters) en c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\godigix\0e20025a\e3315649\App_WebReferences.zfpla_cn.0.cs:línea 46 en events_EstudiosShopper2015.RegisterAttendee(String name, String email, Boolean acceptNotifications) en f:\SVN\goDigix\Web\www.goDigix.com\events\EstudiosShopper2015.aspx.cs:línea 106
У меня есть следующий код для вызова веб-сервиса:
string dataToSend="name=myName&[email protected]";
WSCreateAttendee.CreateAttendee webService = new CreateAttendee();
string webServiceResponse = webService.Create(dataToSend);
И у меня есть следующий в моем назначении:
/// <summary>
/// Web service used to create a new company
/// </summary>
[WebService(Namespace = "http://glothos.sureact.com", Name="CreateAttendee")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class CreateAttendee : System.Web.Services.WebService
{
public CreateAttendee()
{
//do nothing
}
[WebMethod]
public string Create(string parameters)
{
//Log into DB the name and email received
}
}
Может кто-нибудь мне помочь? Я не знаю, что я делаю неправильно.
Спасибо
Мы можем помочь вам, как только вы показать нам код –
Исключение брошено в 'CreateGlothosAttendee.CreateAttendee.Create()' который делает 'новый CreateAttendee()', где вы используйте «словарь [" ключ "]' где «ключ» не существует. – CodeCaster
Здравствуйте, я добавил дополнительную информацию по моему вопросу. Но я не использую «Key» не какой-либо «словарь» в моем веб-сервисе, или я не знаю, что я их использую. – Pimager