Il mio servizio web .net è apparentemente in esecuzione soap 1.2 (verificando il file .wsdl) e sto tentando di accedere al servizio web helloworld per il test ma ho riscontrato errori. Sto cercando di farlo tramite l'emulatore.soap 1.2 android Fornire un'azione sapone valida
Così quando uso la versione soap 1.2, ottengo l'errore che è "impossibile gestire la richiesta senza un parametro di azione valido. Fornire un sapone valido" Voglio sapere cosa mi manca e cosa dovrei fare .
Grazie!
Le cose che mi hanno già fatto:
- Aggiungi il permesso per Android per utilizzare internet
- Cambiamento dal sapone versione 1.1 e 1.2
- Passaggio da SoapObject a Object (sia per SOAP 1.1 e 1.2)
- Usato 10.0.2.2 per l'emulatore
- Controllato per errori di ortografia negli indirizzi e nomi dei metodi
miei codici:
private static final String NAMESPACE = "http://localhost/WebService/";
private static final String URL = "http://10.0.2.2:1672/Eventurous/WsEventurousMobile.asmx";
private static final String HelloWorld_SOAP_ACTION = "http://localhost/WebService/HelloWorld";
private static final String METHOD_NAME1 = "HelloWorld";
...
...
public static String GetHelloWorld() {
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME1);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
SoapEnvelope.VER12);
envelope.dotNet = true;
envelope.setOutputSoapObject(request);
HttpTransportSE androidHttpTransport = new HttpTransportSE(URL,60000);
try {
androidHttpTransport.setXmlVersionTag("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
androidHttpTransport.call(HelloWorld_SOAP_ACTION, envelope);
SoapObject response = (SoapObject)envelope.getResponse();
String result = response.getProperty(0).toString();
return result;
} catch (Exception e) {
return e.toString();
}
}
errore per la versione Soap 1,2
Code: soap:Sender, Reason: System.Web.Services.Protocols.SoapException: Unable to handle request without a valid action parameter. Please supply a valid soap action.
at System.Web.Services.Protocols.Soap12ServerProtocolHelper.RouteRequest()
at System.Web.Services.Protocols.SoapServerProtocol.RouteRequest(SoapServerMessage message)
at System.Web.Services.Protocols.SoapServerProtocol.Initialize()
at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean
errore per la versione Soap 1,1
SoapFault - faultcode: 'soap:Client' faultstring: 'System.Web.Services.Protocols.SoapException: Server did not recognize the value of HTTP Header SOAPAction: http://localhost/WebService/HelloWorld.
at System.Web.Services.Protocols.Soap11ServerProtocolHelper.RouteRequest()
at System.Web.Services.Protocols.SoapServerProtocol.RouteRequest(SoapServerMessage message)
at System.Web.Services.Protocols.SoapServerProtocol.Initialize()
at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing)' faultactor: 'null' detail: [email protected]