你好我是一名学生,我试图实现android指纹应用程序。我需要将值传递给webservice,但我不能这样做。
这里是Xml
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetKisiYetkiBilgiByBioInfo xmlns="http://tempuri.org/">
<bioTemplate>base64Binary</bioTemplate>
<sGecis>
<GecisID>long</GecisID>
<KisiID>long</KisiID>
<GecisNoktasiID>int</GecisNoktasiID>
<GecisTurID>int</GecisTurID>
<Tarih>dateTime</Tarih>
<TarihBilgisi>string</TarihBilgisi>
<AdiSoyadi>string</AdiSoyadi>
<GecisNoktasiAdi>string</GecisNoktasiAdi>
<GecisTuruAdi>string</GecisTuruAdi>
<Limit>double</Limit>
<ElleMudahale>boolean</ElleMudahale>
<YemekErtelemeUrunBazli>boolean</YemekErtelemeUrunBazli>
<TimeLog>string</TimeLog>
<ReferenceID>string</ReferenceID>
</sGecis>
<bioTemplateType>FingerPrintByNeuroTech or FingerPrintByNEC or FaceByNEC or FaceByNeuroTech or FingerVeinByNEC or FingerImage</bioTemplateType>
</GetKisiYetkiBilgiByBioInfo>
</soap:Body>
</soap:Envelope>
当我请求我得到Soap错误时:无法识别指定的类型:name ='sGecis'任何人都可以帮助我。
这里是我的代码(我有sGecis类和marshal类)
public static String GirisYetki(byte[] Image,String webMethName) {
String resTxt = null;
// Create request
SoapObject request = new SoapObject(NAMESPACE, webMethName);
request.addProperty("sGecis", sGecis);
request.addProperty("bioTemplate", Image);
request.addProperty("bioTemplateType", "FingerImage");
// Create envelope
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
SoapEnvelope.VER11);
//Set envelope as dotNet
envelope.dotNet = true;
// Set output SOAP object
envelope.setOutputSoapObject(request);
MarshalDouble mdouble = new MarshalDouble();
mdouble.register(envelope);
MarshalDate md = new MarshalDate();
md.register(envelope);
envelope.addMapping(NAMESPACE, "sGecis",new sGecis().getClass());
// Create HTTP call object
HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
try {
// Invoke web service
androidHttpTransport.call(SOAP_ACTION+webMethName, envelope);
// Get the response
Girisresult = (SoapObject) envelope.getResponse();
resTxt=Girisresult.toString();
} catch (Exception e) {
//Print error
e.printStackTrace();
resTxt= resTxt + e.getMessage();
}
//Return resTxt to calling object
return resTxt;
}
肥皂故障
SoapFault - faultcode: 'soap:Client' faultstring: 'System.Web.Services.Protocols.SoapException: Server was unable to read request. ---> System.InvalidOperationException: There is an error in XML document (334, 36). ---> System.InvalidOperationException: The specified type was not recognized: name=':', namespace='http://tempuri.org/', at <sGecis xmlns='http://tempuri.org/'>.
at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read18_SGecis(Boolean isNullable, Boolean checkType)
at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read72_GetKisiYetkiBilgiByBioInfo()
at Microsoft.Xml.Serialization.GeneratedAssembly.ArrayOfObjectSerializer64.Deserialize(XmlSerializationReader reader)
at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
--- End of inner exception stack trace ---
at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle)
at System.Web.Services.Protocols.SoapServerProtocol.ReadParameters()
--- End of inner exception stack trace ---
at System.Web.Services.Protocols.SoapServerProtocol.ReadParameters()
at System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()' faultactor: 'null' detail: org.kxml2.kdom.Node@4319ef50