Php ANDROID中带有WSDL和ksoap2的错误
我在访问所创建的web服务时遇到问题在PHP中。我尝试了许多代码,但不知道我是否有一个愚蠢的错误,使我无法工作 我认为Web服务是好的,因为如果我在PHP中从页面调用,那么它可以工作,但是如果我通过Android访问,那么我在Android中的调用也不能工作 错误发生在:transport.callSOAP_ACTION,信封,null 错误为:org.xmlpull.v1.XmlPullParserException:应为:START_标记{http://www.w3.org/2003/05/soap-envelope}信封位置:java.io中的START_标记@8:43。InputStreamReader@405d9f50 谢谢 WSDL: 请求转储: 响应转储:Php ANDROID中带有WSDL和ksoap2的错误,php,android,soap,wsdl,android-ksoap2,Php,Android,Soap,Wsdl,Android Ksoap2,我在访问所创建的web服务时遇到问题在PHP中。我尝试了许多代码,但不知道我是否有一个愚蠢的错误,使我无法工作 我认为Web服务是好的,因为如果我在PHP中从页面调用,那么它可以工作,但是如果我通过Android访问,那么我在Android中的调用也不能工作 错误发生在:transport.callSOAP_ACTION,信封,null 错误为:org.xmlpull.v1.XmlPullParserException:应为:START_标记{http://www.w3.org/2003/0
将URL更改为extension.asmx而不是.wsdl
<definitions
name='SMB_GestionBoda'
targetNamespace='http://localhost/webservice/SMB_GestionBoda.wdsl'
xmlns:tns='http://localhost/webservice/SMB_GestionBoda.wdsl'
xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'
xmlns:soap12='http://schemas.xmlsoap.org/wsdl/soap12/'
xmlns='http://schemas.xmlsoap.org/wsdl/'>
<message name='GetProvidersRequest'>
<part name='id_task' type='xsd:int'/>
<part name='city' type='xsd:string'/>
</message>
<message name='GetProvidersResponse'>
<part name='result'/>
</message>
<portType name='SMB_GestionBodaPortType'>
<operation name='GetProviders'>
<input message='tns:GetProvidersRequest'/>
<output message='tns:GetProvidersResponse'/>
</operation>
</portType>
<binding name='SMB_GestionBodaBinding' type='tns:SMB_GestionBodaPortType'>
<soap:binding style='rpc'
transport='http://schemas.xmlsoap.org/soap/http'/>
<operation name='GetProviders'>
<soap:operation soapAction='urn:localhost-SMB_GestionBoda#GetProviders'/>
<input>
<soap:body use='encoded' namespace='urn:localhost-SMB_GestionBoda'
encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
</input>
<output>
<soap:body use='encoded' namespace='urn:localhost-SMB_GestionBoda'
encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
</output>
</operation>
</binding>
<service name='SMB_GestionBodaService'>
<port name='SMB_GestionBodaPort' binding='SMB_GestionBodaBinding'>
<soap:address location='http://localhost/webservice/GetProviders.php'/>
</port>
</service>
</definitions>
//Constantes para la invocacion del web service
final String NAMESPACE = "http://localhost/webservice/SMB_GestionBoda.wdsl";
final String URL="http://192.168.0.10/webservice/SMB_GestionBoda.wdsl";
final String METHOD_NAME = "GetProviders";
final String SOAP_ACTION = "urn:localhost-SMB_GestionBoda#GetProviders";
/*Se crea un objeto SoapObject para poder realizar la peticion
para consumir el ws SOAP. El constructor recibe
el namespace. Por lo regular el namespace es el dominio
donde se encuentra el web service*/
request = new SoapObject(NAMESPACE, METHOD_NAME);
request.addProperty("id_task",0);
request.addProperty("city","valencia");
/*Se crea un objeto SoapSerializationEnvelope para serealizar la
peticion SOAP y permitir viajar el mensaje por la nube
el constructor recibe la version de SOAP*/
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER12);
envelope.dotNet = false; //se asigna true para el caso de que el WS sea de dotNet
//Se envuelve la peticion soap
envelope.setOutputSoapObject(request);
//Objeto que representa el modelo de transporte
//Recibe la URL del ws
HttpTransportSE transporte = new HttpTransportSE(URL);
transporte.debug=true;
try {
System.setProperty("http.keepAlive", "false");
//Hace la llamada al ws
transporte.call(SOAP_ACTION, envelope,null);
//Se crea un objeto SoapPrimitive y se obtiene la respuesta
//de la peticion
resultsRequestSOAP = (SoapPrimitive)envelope.getResponse();
//result = (SoapObject)envelope.bodyIn;
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (XmlPullParserException e) {
// TODO Auto-generated catch block
Log.d("MI APP","dump : " + transporte.responseDump);
e.printStackTrace();
}
<v:Envelope
xmlns:i="http://www.w3.org/2001/XMLSchema-instance"
xmlns:d="http://www.w3.org/2001/XMLSchema"
xmlns:c="http://www.w3.org/2003/05/soap-encoding"
xmlns:v="http://www.w3.org/2003/05/soap-envelope">
<v:Header />
<v:Body>
<n0:GetProviders id="o0" c:root="1" xmlns:n0="http://localhost/webservice/SMB_GestionBoda.wdsl">
<id_task i:type="d:int">0</id_task>
<city i:type="d:string">valencia</city>
</n0:GetProviders>
</v:Body>
</v:Envelope>
<?xml version="1.0" encoding="utf-8"?>
<definitions
name='SMB_GestionBoda'
targetNamespace='http://localhost/webservice/SMB_GestionBoda.wdsl'
xmlns:tns='http://localhost/webservice/SMB_GestionBoda.wdsl'
xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'
xmlns:soap12='http://schemas.xmlsoap.org/wsdl/soap12/'
xmlns='http://schemas.xmlsoap.org/wsdl/'>
<message name='GetProvidersRequest'>
<part name='id_task' type='xsd:int'/>
<part name='city' type='xsd:string'/>
</message>
<message name='GetProvidersResponse'>
<part name='result'/>
</message>
<portType name='SMB_GestionBodaPortType'>
<operation name='GetProviders'>
<input message='tns:GetProvidersRequest'/>
<output message='tns:GetProvidersResponse'/>
</operation>
</portType>
<binding name='SMB_GestionBodaBinding' type='tns:SMB_GestionBodaPortType'>
<soap:binding style='rpc'
transport='http://schemas.xmlsoap.org/soap/http'/>
<operation name='GetProviders'>
<soap:operation soapAction='urn:localhost-SMB_GestionBoda#GetProviders'/>
<input>
<soap:body use='encoded' namespace='urn:localhost-SMB_GestionBoda'
encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
</input>
<output>
<soap:body use='encoded' namespace='urn:localhost-SMB_GestionBoda'
encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
</output>
</operation>
</binding>
<service name='SMB_GestionBodaService'>
<port name='SMB_GestionBodaPort' binding='SMB_GestionBodaBinding'>
<soap:address location='http://localhost/webservice/GetProviders.php'/>
</port>
</service>
</definitions>