问题描述
您好,我是Windows Phone 7应用程序的初学者.我已通过服务参考在Windows Phone 7应用程序中添加了PHP WSDL Web服务.它已成功添加,但是当我尝试使用下面的代码调用它时,会显示错误"ENDPOINTNOTFOUNDEXCEPTION".
Hi I am beginner in Windows phone 7 application. I have added PHP WSDL web service in my windows phone 7 app by service reference. Its added successfully but when i try to call it using below code it show me error "ENDPOINTNOTFOUNDEXCEPTION".
请检查以下错误消息
我在这里附上我用来致电服务的代码.
Here i am attaching my code which i use to call service.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using System.Windows.Media.Imaging;
using MyFristMobApp.MyService;
using System.IO;
using System.Xml.Linq;
namespace MyFristMobApp
{
public partial class AddEvent : PhoneApplicationPage
{
public AddEvent()
{
InitializeComponent();
ImageBrush brush = new ImageBrush();
brush.ImageSource = new BitmapImage(new Uri(@"../Images/main-background.jpg", UriKind.Relative));
LayoutRoot.Background = brush;
MyService.getLoginRequest objrequest = new getLoginRequest();
objrequest.username = "test";
objrequest.password = "test";
MyService.Demo_wsdlPortTypeClient objclinet = new Demo_wsdlPortTypeClient();
objclinet.getLoginCompleted += new EventHandler<getLoginCompletedEventArgs>(objclinet_getLoginCompleted);
objclinet.getLoginAsync(objrequest);
}
void objclinet_getLoginCompleted(object sender, getLoginCompletedEventArgs e)
{
MyService.getLoginResponse objresponse = new getLoginResponse();
objresponse = e.Result;
}
}
}
请我走出来.我在Google上搜索了很多.
Please me to come out of this. i Searched a lot for on google. but didnt get proper solution.
推荐答案
您是否尝试过Web服务响应?您能否公开您的添加服务参考"?对话? :)
Have you tried your web service response? Can you expose your "Add Service Reference" dialog? :)
最诚挚的问候.
这篇关于我收到错误"ENDPOINTNOTFOUNDEXCEPTION";在Windows Phone 7应用中调用php服务时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!