Windows Phone 7 + PHP Web服务

问题描述:

HI,

我是Windows Phone 7的初学者.今天,我在Windows Phone 7中创建了一个应用程序,并开发了hello world应用程序.现在我想从我的主应用程序开始.并且我开始添加PHP Web服务参考.但它向我显示了以下错误.


HTML文档不包含Web服务发现信息.
元数据包含无法解析的引用:"http://mydomain.com/webservices/getLogin.php".
响应消息的内容类型text/html与绑定的内容类型不匹配(application/soap + xml; charset = utf-8).如果使用自定义编码器,请确保正确实施IsContentTypeSupported方法.响应的前80个字节为:``{"userLogin":{"status":"NO","error":请输入有效的用户名\/password"}}''.
如果服务是在当前解决方案中定义的,请尝试构建解决方案并再次添加服务引用.

我搜索了很多,但没有得到适当的解决方案.请帮助我解决此问题.如何添加php服务.

在此先谢谢您.



i am beginner in windows phone 7. today i create one application in windows phone 7. and develop hello world app. now i want to start with my main app. and i start to add PHP web service reference. but it show me below error to me.


The HTML document does not contain Web service discovery information.
Metadata contains a reference that cannot be resolved: ''http://mydomain.com/webservices/getLogin.php''.
The content type text/html of the response message does not match the content type of the binding (application/soap+xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 80 bytes of the response were: ''{"userLogin":{"status":"NO","error":"Please enter valid user name \/ password"}}''.
If the service is defined in the current solution, try building the solution and adding the service reference again.

i search a lot but i didnt get proper solution. please help me to resolve this issue. how to add php service.

Thanks in advance.

我想,您已尝试添加服务引荐".而是直接从webclient调用php.

I guess, you have tried adding the "Service Referemce". Instead call the php directly from webclient.

public Sample()
{
            InitializeComponent();
            WebClient wc = new WebClient();
            wc.DownloadStringCompleted += new     DownloadStringCompletedEventHandler(doProcess); 
            wc.DownloadStringAsync(new     Uri("http://mydomain.com/webservices/getLogin.php") );
            return;
}   

void doProcess(object sender, DownloadStringCompletedEventArgs e)
{
            string res = (String)e.Result;
            //do your stuff
}



这应该起作用.

欢呼



This should work.

cheers