public class MainActivity extends AppCompatActivity {
ImageView iv;
TextView tv;
byte[] img; //이미지 파일
int unit=1; //유닛번호
int[] conncept=new int[]{10,20,30,40}; //단위 지식 번호
int answer=5; //정답
String explain="a"; //설명
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// iv=(ImageView)findViewById(R.id.imageView);
tv=(TextView)findViewById(R.id.textView);
iv=(ImageView)findViewById(R.id.imageView);
}
public void reg_img(View v) {
iv.setImageResource(R.drawable.cap01);
Bitmap bitmap= BitmapFactory.decodeResource(getResources(), R.drawable.cap01);
img=bitmapToByteArray(bitmap);
}
public void click_add(View v)
{
mktest aa=new mktest();
aa.execute();
}
public byte[] bitmapToByteArray( Bitmap bitmap ) {
ByteArrayOutputStream stream = new ByteArrayOutputStream() ;
bitmap.compress( Bitmap.CompressFormat.PNG, 100, stream) ;
byte[] byteArray = stream.toByteArray() ;
return byteArray ;
}
public void fake(View v)
{
Intent care= new Intent(getApplicationContext(),Regist.class);
startActivity(care);
}
public class mktest extends AsyncTask<String,String,String> {
@Override
protected String doInBackground(String... params) {
SoapObject request = new SoapObject("http://tempuri.org/", "UploadImg"); // 네임스페이스 메소드 이름
request.addProperty("unit", unit); //문제를 받아오기 위한 번호
request.addProperty("concept",conncept); //단위지식
request.addProperty("img",img);
request.addProperty("answer",answer); //정답
request.addProperty("explain",explain); //설명
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.setOutputSoapObject(request);
envelope.dotNet = true;
HttpTransportSE androidHttpTransport = new HttpTransportSE("http://192.168.33.49:11000/Service"); //url
try {
androidHttpTransport.call("http://tempuri.org/IService/UploadImg", envelope); //soap의 액션
Object result = envelope.getResponse();
String wq = result.toString();
Boolean tur = (wq != "true");
return wq;
} catch (Exception e) {
e.printStackTrace();
return e.getLocalizedMessage();
}
}
protected void onPostExecute(String result)
{
super.onPostExecute(result);
tv.setText(result);
}
}
}
ksoap2를 이용해 전송하는데
int형 배열을 serialize 할수 없다고 뜨네요...

위와같은데
배열을 어떻게 수정해야하나요