从android应用程序访问php Web服务
我试图从我的android应用程序访问php Web服务。但它给出了一个错误“`”,应该是:START\u标记{http://schemas.xmlsoap.org/soap/envelope/}信封(在java io中的位置:START_TAG@11.43)。inputStreamReader@4052d300) " . 这是我的wsdl文件从android应用程序访问php Web服务,php,android,web-services,ksoap2,Php,Android,Web Services,Ksoap2,我试图从我的android应用程序访问php Web服务。但它给出了一个错误“`”,应该是:START\u标记{http://schemas.xmlsoap.org/soap/envelope/}信封(在java io中的位置:START_TAG@11.43)。inputStreamReader@4052d300) " . 这是我的wsdl文件 <?xml version ='1.0' encoding ='UTF-8' ?> <definitions name='pro
<?xml version ='1.0' encoding ='UTF-8' ?>
<definitions
name='product'
targetNamespace='urn:PHP_SOAP_RPC'
xmlns:tns='urn:PHP_SOAP_RPC'
xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'
xmlns:xsd='http://www.w3.org/2001/XMLSchema'
xmlns:soapenc='http://schemas.xmlsoap.org/soap/encoding/'
xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/'
xmlns='http://schemas.xmlsoap.org/wsdl/'>
<message name='gettestRequest'>
<part name='id' type='xsd:string'/>
</message>
<message name='gettestRespones'>
<part name='id' type='xsd:string'/>
</message>
<portType name='productPortType'>
<operation name='gettest'>
<input message='tns:gettestRequest'/>
<output message='tns:gettestRespones'/>
</operation>
</portType>
<binding name='productBinding' type='tns:productPortType'>
<soap:binding style='rpc'
transport='http://schemas.xmlsoap.org/soap/http'/>
<operation name='gettest'>
<soap:operation soapAction='urn:xmethods-delayed-quotes#gettest'/>
<input>
<soap:body use='encoded' namespace='urn:xmethods-delayed-quotes'
encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
</input>
<output>
<soap:body use='encoded' namespace='urn:xmethods-delayed-quotes'
encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
</output>
</operation>
</binding>
<service name='product'>
<port name='productPortType' binding='productBinding'>
<soap:address location='http://111.223.189.236/webservice/server1.php'/>
</port>
</service>
这是我的php文件
<?php
echo "ccc";
function gettest($id) {
return $id;
}
$server1 = new SoapServer(null, array('uri'=> "urn://tyler/res"));
$server1->addFunction("gettest");
$server1->handle();
?>
更改url和delete.wsdl,然后也尝试一下 SoapPrimitive结果字符串=(SoapPrimitive)SOAPEnvelope.getResponse();
.not getresponse使用bodyin是,我在不使用wsdl的情况下检查它,如果getresponse(),则检查bodyin。但它给出了同样的错误。我办不到,请帮帮我。谢谢。
<?php
echo "ccc";
function gettest($id) {
return $id;
}
$server1 = new SoapServer(null, array('uri'=> "urn://tyler/res"));
$server1->addFunction("gettest");
$server1->handle();
?>