У меня ошибка при попытке собрать проект. В моем проекте, когда клиент отправляет номер телефона в сервис, serivce вернет всю информацию о пользователе, имеющую этот номер телефона.
это услуга
namespace ICService
{
public class ProfileService : IProfileService
{
public lbl_Profile ViewProfile(int phonenumber)
{
Profileview profile = new Profileview();
return profile.ViewProfile(phonenumber);
}
}
public class Profileview
{
public lbl_Profile ViewProfile(int phonenumber)
{
try
{
ToPiDataContext db = new ToPiDataContext();
var query = (from m in db.lbl_Accounts
from n in db.lbl_Profiles
where m.AccountID == n.AccountID && m.Phonenumber == phonenumber
select new
{
n.AccountID
}).First();
var profile = (from m in db.lbl_Profiles
where m.AccountID == query.AccountID
select m).First();
return profile;
}
catch
{
return null;
}
}
}
}
в клиенте
public partial class Profile : PhoneApplicationPage
{
public Profile()
{
InitializeComponent();
ProfileServiceClient profileClient = new ProfileServiceClient();
profileClient.ViewProfileCompleted += new EventHandler<ViewProfileCompletedEventArgs>(profileService_ViewProfileCompleted);
profileClient.ViewProfileAsync(phonenumber);
}
void profileService_ViewProfileCompleted(object sender, ViewProfileCompletedEventArgs e)
{
txbFirstName.Text = e.Result.FirstName;
txbLastName.Text = e.Result.LastName;
txbLocation.Text = e.Result.Location;
txbGenre.Text = e.Result.Genre;
}
}
Конфиг в веб-сервисе
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
в телефоне
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IAccountService" maxBufferSize="2147483647"
maxReceivedMessageSize="2147483647">
<security mode="None" />
</binding>
<binding name="BasicHttpBinding_IProfileService" maxBufferSize="2147483647"
maxReceivedMessageSize="2147483647">
<security mode="None" />
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:2183/AccountService.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IAccountService"
contract="AccountService.IAccountService" name="BasicHttpBinding_IAccountService" />
<endpoint address="http://localhost:2183/ProfileService.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IProfileService"
contract="ProfileService.IProfileService" name="BasicHttpBinding_IProfileService" />
</client>
</system.serviceModel>
и это ошибка