Android アプリケーションに KSOAP2 を実装しようとしていますが、問題が発生しています。HTTPTransportSE オブジェクトの call メソッドを使用すると、次の例外が発生します。
10-04 09:24:05.997: W/System.err(6779): java.lang.NullPointerException
10-04 09:24:06.017: W/System.err(6779): at org.ksoap2.transport.ServiceConnectionSE.getResponseProperties(ServiceConnectionSE.java:85)
10-04 09:24:06.017: W/System.err(6779): at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:167)
10-04 09:24:06.017: W/System.err(6779): at com.brandmakerandroid.mediapool.LoginActivity.Login(LoginActivity.java:123)
10-04 09:24:06.017: W/System.err(6779): at java.lang.reflect.Method.invokeNative(Native Method)
10-04 09:24:06.017: W/System.err(6779): at java.lang.reflect.Method.invoke(Method.java:511)
10-04 09:24:06.017: W/System.err(6779): at android.view.View$1.onClick(View.java:3077)
10-04 09:24:06.017: W/System.err(6779): at android.view.View.performClick(View.java:3549)
10-04 09:24:06.017: W/System.err(6779): at android.view.View$PerformClick.run(View.java:14400)
10-04 09:24:06.017: W/System.err(6779): at android.os.Handler.handleCallback(Handler.java:605)
10-04 09:24:06.017: W/System.err(6779): at android.os.Handler.dispatchMessage(Handler.java:92)
10-04 09:24:06.017: W/System.err(6779): at android.os.Looper.loop(Looper.java:154)
10-04 09:24:06.017: W/System.err(6779): at android.app.ActivityThread.main(ActivityThread.java:4945)
10-04 09:24:06.017: W/System.err(6779): at java.lang.reflect.Method.invokeNative(Native Method)
10-04 09:24:06.017: W/System.err(6779): at java.lang.reflect.Method.invoke(Method.java:511)
10-04 09:24:06.017: W/System.err(6779): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
10-04 09:24:06.017: W/System.err(6779): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
10-04 09:24:06.017: W/System.err(6779): at dalvik.system.NativeStart.main(Native Method)
そして、ここに私のコードがあります:
SoapObject request= new SoapObject(Constants.NAMESPACE, Constants.METHOD_NAME);
SoapObject mda = new SoapObject("","arg0");
PropertyInfo pi = new PropertyInfo();
pi.setName("mediaGuid");
pi.setValue("27499");
pi.setType(String.class);
mda.addProperty(pi);
PropertyInfo pi_hash = new PropertyInfo();
pi_hash.setName("mediaHash");
pi_hash.setValue("");
pi_hash.setType(String.class);
mda.addProperty(pi_hash);
request.addSoapObject(mda);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
SoapEnvelope.VER11);
envelope.setOutputSoapObject(request);
envelope.addMapping(Constants.NAMESPACE, "getMediaDetails", getMediaDetails.class);
try {
HttpTransportSE httpTransportSE = new HttpTransportSE(Constants.DEFAULT_SERVER);
httpTransportSE.debug = true;
List<HeaderProperty> headerList = new ArrayList<HeaderProperty>();
headerList.add(new HeaderProperty("Authorization", "Basic "
+ org.kobjects.base64.Base64.encode("xxxxxxxx"
.getBytes())));
httpTransportSE.call(Constants.SOAP_ACTION, envelope, headerList);
SoapObject objectResult = (SoapObject) envelope.getResponse();
私はあなたが私を助けてくれることを願っています..私はそのエラーを何日も修正しようとしています