2013-05-15 49 views
0

我正在编程一个小小的windows phone 7应用程序。它应该消费Web服务。我在xammp(local)环境中成功测试了代码,但是如果在免费webhoster上,我会收到错误“notFound”。我测试了一切,现在我需要帮助。windows手机,wsdl函数“not found”错误

wsdl文件

<?xml version="1.0" encoding="UTF-8"?> 
<wsdl:definitions 
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" 
xmlns:xs="http://www.w3.org/2001/XMLSchema" 
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" 
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:tns="http://schwarzes-imperium.de/witzeAppWp" 
targetNamespace="http://schwarzes-imperium.de/witzeAppWp"> 
<wsdl:types> 
<xs:schema targetNamespace="http://schwarzes-imperium.de/witzeAppWp.wsdl" elementFormDefault="qualified"/> 
</wsdl:types> 
<wsdl:message name="loginCheckRequest"> 
<wsdl:part name="name" type="xs:string"/> 
<wsdl:part name="password" type="xs:string"/> 
</wsdl:message> 
<wsdl:message name="loginCheckResponse"> 
<wsdl:part name="Result" type="xs:string"/> 
</wsdl:message> 
<wsdl:message name="ausgabeRequest"> 
<wsdl:part name="text" type="xs:string"/> 
</wsdl:message> 
<wsdl:message name="ausgabeResponse"> 
<wsdl:part name="Result" type="xs:string"/> 
</wsdl:message> 
<wsdl:portType name="witzeAppWpPortType"> 
<wsdl:operation name="loginCheck"> 
    <wsdl:input message="tns:loginCheckRequest"/> 
    <wsdl:output message="tns:loginCheckResponse"/> 
</wsdl:operation> 
<wsdl:operation name="ausgabe"> 
    <wsdl:input message="tns:ausgabeRequest"/> 
    <wsdl:output message="tns:ausgabeResponse"/> 
</wsdl:operation> 
</wsdl:portType> 
<wsdl:binding name="witzeAppWpBinding" type="tns:witzeAppWpPortType"> 
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> 
<wsdl:operation name="loginCheck"> 
    <soap:operation soapAction="urn:#loginCheck" style="document"/> 
    <wsdl:input> 
    <soap:body use="literal"/> 
    </wsdl:input> 
    <wsdl:output> 
    <soap:body use="literal"/> 
    </wsdl:output> 
</wsdl:operation> 
<wsdl:operation name="ausgabe"> 
    <soap:operation soapAction="urn:#ausgabe" style="document"/> 
    <wsdl:input> 
    <soap:body use="literal"/> 
    </wsdl:input> 
    <wsdl:output> 
    <soap:body use="literal"/> 
    </wsdl:output> 
</wsdl:operation> 
</wsdl:binding> 
<wsdl:service name="witzeAppWpService"> 
<wsdl:port name="witzeAppWpPort" binding="tns:witzeAppWpBinding"> 
    <soap:address location="http://schwarzes-imperium.de/witzeAppWp.php"/> 
</wsdl:port> 
</wsdl:service> 
</wsdl:definitions> 

PHP文件

<?php 
include 'sql.php'; 
function loginCheck($name, $password){ 
if ($password == "test") 
{ 
    return "JA"; 
}else 
{ 
    return "NEIN"; 
} 
} 
function ausgabe($id){ 
#$result = sqlQuery("SELECT * FROM witze_tb"); 
#return mysql_result($result, $id, 1); 
return $id; 
} 
$server = new SoapServer("witzeAppWp.wsdl"); 
$server->addFunction("loginCheck"); 
$server->addFunction("ausgabe"); 
$server->handle(); 
?> 

任何想法? Thx

回答

0

WSDL链接应该是一个绝对路径,你确定你的功能正确吗? 我记得webservices总是希望有一个数组中的参数。如:

$webserivce = new SoapClient('http://localhost:8080/Service.svc?wsdl'); 
$welcome = array('name' => 'Marijke', 
      'surname' => 'Hakvoort'); 
$response = $webservice->WelcomeMessage($welcome); 
echo $response->WelcomeMessageResult; 

其中WelcomeMessage是一个函数,名字和姓氏的参数。

相关问题