KSOAP2
基本認証で使用しようとしています。私はダウンロードしていますksoap2-android-assembly-3.0.0-jar-with-dependencies.jar
、、。以下のコードを使用しようとしました:ksoap2-extras-3.0.0.jar
ksoap2-extra-ntlm-3.0.0.jar
ArrayList<HeaderProperty> headerProperty = new ArrayList<HeaderProperty>();
headerProperty.add(new HeaderProperty("Authorization", "Basic " +
org.kobjects.base64.Base64.encode("user:password".getBytes())));
それはエラーを生成します:
java.io.IOException: HTTP request failed, HTTP status: 401
ERROR:java.io.IOException:HTTP request failed, HTTP status: 401
私も以下のコードを使用しようとしました:
HttpTransportBasicAuth androidHttpTpAut = new HttpTransportBasicAuth(URL, "user", "password");
androidHttpTpAut.getServiceConnection().connect();
再び機能しない場合、エラーが発生します。
Exception in thread "main" java.lang.NoClassDefFoundError: org/ksoap2/transport/HttpTransport
at java.lang.ClassLoader.defineClass1(Native Method)
誰でもこの作業はうまくいきますか?