私は Dot42 で ksaop2-android ライブラリを使用しようとしていますが、テストできると思われるポイントに到達した後、ビルドが成功した後に上記のエラーが発生します。デバッグモードで開始しています。この種のエラーはこれまで見たことがなく、どこから修正を開始すればよいかさえわかりません。最新の更新後、Dot42 の既定のアプリ テンプレートを正常に実行できました。Visual Studio 2012 を使用しています。マニフェスト ファイルで INTERNET 権限を有効にしました。これが私のコードです:
using System;
using Android.App;
using Android.Os;
using Android.Widget;
using Dot42;
using Dot42.Manifest;
using Org.Ksoap2.Serialization;
using Org.Ksoap2.Transport;
[assembly: Application("dot42Application7")]
namespace dot42Application7
{
[Activity]
public class MainActivity : Activity
{
private string NAMESPACE = "http://reps.catalystinnovations.net/";
private string URL = "http://reps.catalystpromotions.net/T-ShirtPricing.asmx";
protected override void OnCreate(Bundle savedInstance)
{
base.OnCreate(savedInstance);
SetContentView(R.Layouts.MainLayout);
TryWebService();
}
public void TryWebService()
{
string METHOD_NAME = "GetTShirtPricingString";
string SOAP_ACTION = NAMESPACE + METHOD_NAME;
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
PropertyInfo password = new PropertyInfo();
password.SetName("password");
password.SetValue("password");
password.SetType(typeof(string));
PropertyInfo numColors = new PropertyInfo();
numColors.SetName("color");
numColors.SetValue("White");
// numColors.setValue("White");
numColors.SetType(typeof(string));
PropertyInfo numShirts = new PropertyInfo();
numShirts.SetName("weight");
double w = 5.4d;
numShirts.SetValue(w.ToString());
// numShirts.setValue("5.4");
numShirts.SetType(typeof(string));
request.AddProperty(password);
request.AddProperty(numColors);
request.AddProperty(numShirts);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(Org.Ksoap2.SoapEnvelope.VER11);
envelope.DotNet = true;
envelope.SetOutputSoapObject(request);
envelope.ImplicitTypes = true;
HttpTransportSE transport = new HttpTransportSE(URL);
try
{
transport.Call(SOAP_ACTION, envelope);
SoapPrimitive response = (SoapPrimitive)envelope.GetResponse();
string result = response.ToString();
int i = 0;
}
catch(Exception e)
{
e.PrintStackTrace();
}
}
}
}