를 작동하지 발생하지 않는 것은 내 문제가 데이터 IdMaquina 같은 XML/SOAP 오류하지만 웹 서비스 기록 0을 유발하지 마십시오 베이스. 삽입 된 값이 잘못되었습니다 (전송 한 값이 아닙니다). 웹 서비스 응답은 정상입니다.KSOAP 생성 된 SOAP 요청이 오류하지만 여기
<v:Envelope xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:d="http://www.w3.org/2001/XMLSchema" xmlns:c="http://schemas.xmlsoap.org/soap/encoding/" xmlns:v="http://schemas.xmlsoap.org/soap/envelope/"> <v:Header /> <v:Body> <IngresarMaquinaLog xmlns="http://tempuri.org/"> <maquinaLog> <IdMaquina>123</IdMaquina> </maquinaLog> </IngresarMaquinaLog> </v:Body> </v:Envelope>
Boomrang 크롬 플러그인에 의해 생성됨 : 올바르게 작동합니다. 데이터베이스에 삽입 된 값이 맞습니다 (이는 내가 보낸 값과 같습니다). 웹 서비스 응답은 정상입니다.
<x:Envelope xmlns:x="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/" xmlns:obe="http://schemas.datacontract.org/2004/07/myService.Entidades"> <x:Header/> <x:Body> <tem:IngresarMaquinaLog> <tem:maquinaLog> <obe:IdMaquina>4567</obe:IdMaquina> </tem:maquinaLog> </tem:IngresarMaquinaLog> </x:Body> </x:Envelope>
maquinaLog 정의로 사용 :
{ public class maquinaLog implements KvmSerializable { public int IdMaquina;
public maquinaLog(){}
public maquinaLog(int idMaquinaField) {
IdMaquina = idMaquinaField;
}
public Object getProperty(int arg0) {
switch(arg0)
{
case 0:
return IdMaquina;
}
return null;
}
public int getPropertyCount() {
return 1;
}
public void getPropertyInfo(int index, Hashtable arg1, PropertyInfo info) {
switch(index)
{
case 0:
info.type = PropertyInfo.INTEGER_CLASS;
info.name = "IdMaquina";
break;
default:break;
}
}
public void setProperty(int index, Object value) {
switch(index)
{
case 0:
IdMaquina = Integer.parseInt(value.toString());
break;
default:
break;
}
}
}
}
</code>
Using to build SOAP request: { public void WebServiceCallExample(Integer idmaquina) { String NAMESPACE = " http://tempuri.org/ "; String METHOD_NAME = "IngresarMaquinaLog"; String SOAP_ACTION = NAMESPACE + "IMyService/IngresarMaquinaLog"; String URL = " http://MyUrl/MyService/MyService.svc ";
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME); HttpTransportSE androidHttpTransport = new HttpTransportSE(URL); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); envelope.dotNet = true; envelope.implicitTypes = true; envelope.setAddAdornments(false); maquinaLog ML = new maquinaLog(); ML.IdMaquina = idmaquina; PropertyInfo pi = new PropertyInfo(); pi.setName("maquinaLog"); pi.setNamespace(NAMESPACE); pi.setValue(ML); pi.setType(ML.getClass()); request.addProperty(pi); envelope.setOutputSoapObject(request); envelope.addMapping(NAMESPACE, "maquinaLog",new maquinaLog().getClass()); androidHttpTransport.debug = true; try { //Log.i("app", androidHttpTransport.requestDump); androidHttpTransport.call(SOAP_ACTION, envelope); Log.i("appRQS", androidHttpTransport.requestDump); Log.i("appRSP", androidHttpTransport.responseDump); } catch(Exception e) { e.printStackTrace(); } } }