Как Вы передаете удостоверения пользователя от WebClient до сервиса REST WCF?

Замените ваш код следующим:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/back"
    tools:context="com.cash.nikito.Contact">

    <android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="@color/colorPrimary"
        android:minHeight="?attr/actionBarSize"
        app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" />

    <!-- add src attribute here -->
    <ImageView
        android:id="@+id/imageView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/toolbar"
        android:layout_centerHorizontal="true" />

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/imageView"
        android:orientation="horizontal"
        android:padding="20dp">

        <Button
            android:id="@+id/button1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="Button 1" />

        <Button
            android:id="@+id/buttonUpload"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="Upload" />
    </LinearLayout>

</RelativeLayout>
8
задан 28 April 2009 в 01:42
поделиться

1 ответ

Сначала вы можете захотеть добавить трассировку WCF к своему сервису, чтобы получить более подробную информацию. Во-вторых, я полагаю, что проблема может заключаться в том, что вы отправляете учетные данные пользователя в виде открытого текста, а WCF не позволяет передавать учетные данные пользователя в виде открытого текста по незащищенному транспортному каналу. Поэтому попробуйте использовать https или укажите алгоритм шифрования для защиты учетных данных пользователя через http.

0
ответ дан 6 December 2019 в 01:40
поделиться
Другие вопросы по тегам:

Похожие вопросы: