0
我需要一些帮助。Android客户端Web服务
我正在开发一个应用程序android发送一个字节数组和一个字符串到Web服务。我的Android代码的
配件:
private static final int SELECT_VIDEO = 100;
private static final String NAMESPACE = "org.me.WebService";
private static final String URL = "http://192.168.1.4:8084/MyTubeWebService/MyTubeService?wsdl";
private static final String SOAP_ACTION = "MyTubeService";
private static final String METHOD_NAME = "upArquivoVideo";
//(...)
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
SoapSerializationEnvelope envelope =
new SoapSerializationEnvelope(SoapEnvelope.VER11);
request.addProperty("arquivoVideo",video);
request.addProperty("descricao", "teste");
envelope.setOutputSoapObject(request);
HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
try {
androidHttpTransport.call(SOAP_ACTION, envelope);
//androidHttpTransport.call(NAMESPACE+"/"+METHOD_NAME,envelope);
SoapObject resultsRequestSOAP = (SoapObject) envelope.bodyIn;
text.setText("Received :" + resultsRequestSOAP.toString());
} catch (Exception e) {
e.printStackTrace();
}
和Web服务代码:
@WebService(serviceName = "MyTubeService")
public class MyTubeService {
/**
* Operação de serviço web
*/
@WebMethod(operationName = "upArquivoVideo")
@Oneway
public void upArquivoVideo(@WebParam(name = "arquivoVideo") byte[] arquivoVideo, @WebParam(name = "descricao") String descricao) {
if (arquivoVideo.length > 0){
System.out.println("OK!");
}else{
System.out.println("Erro");
}
System.out.println("desricao = " + descricao);
}
日志猫一次调度异常的Socket超时......在我的最后一次测试调度RuntimeException:无法序列化
我在做什么错?它是在Android端?或者在Web服务端?