GVKun编程网logo

asp.net – 升级到WebAPI 2.1时出错XmlDocumentationProvider不实现接口成员GetDocumentation

6

以上就是给各位分享asp.net–升级到WebAPI2.1时出错XmlDocumentationProvider不实现接口成员GetDocumentation,同时本文还将给你拓展@WSDLDocum

以上就是给各位分享asp.net – 升级到WebAPI 2.1时出错XmlDocumentationProvider不实现接口成员GetDocumentation,同时本文还将给你拓展@WSDLDocumentation WebService 客户端中文乱码、ABAP-Keyword Documentation、Android documentation decompile、android – 尝试通过ACTION_OPEN_DOCUMENT forPersistableUriPermission()无法自定义DocumentsProvider等相关知识,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在开始吧!

本文目录一览:

asp.net – 升级到WebAPI 2.1时出错XmlDocumentationProvider不实现接口成员GetDocumentation

asp.net – 升级到WebAPI 2.1时出错XmlDocumentationProvider不实现接口成员GetDocumentation

我在这里跟随教程:

http://www.asp.net/web-api/overview/releases/whats-new-in-aspnet-web-api-21#download

我在Visual Studio 2012(.NET Framework 4.5)中创建了一个MVC Web Api项目,并在我的NuGet软件包管理器控制台Install-Package中运行此命令Microsoft.AspNet.WebApi

当我试图构建我的项目,我得到这个错误:

'CommonServices.Areas.HelpPage.XmlDocumentationProvider' does not implement interface member 
    'System.Web.Http.Description.IDocumentationProvider.GetDocumentation(System.Web.Http.Controllers.HttpControllerDescriptor)' c:\users\administrator\documents\visual studio 2012\Projects\CommonServices\CommonServices\Areas\HelpPage\XmlDocumentationProvider.cs

'CommonServices.Areas.HelpPage.XmlDocumentationProvider' does not implement interface member 
    'System.Web.Http.Description.IDocumentationProvider.GetResponseDocumentation(System.Web.Http.Controllers.HttpActionDescriptor)' c:\users\administrator\documents\visual studio 2012\Projects\CommonServices\CommonServices\Areas\HelpPage\XmlDocumentationProvider.cs

有没有我错过的东西?

解决方法

当得到Microsoft.AspNet.WebApi时,我遇到了同样的问题.

在Nuget软件包管理器控制台写下:

Update-Package -ProjectName 'YourProjectNameGoesHere' -Reinstall

这将更新您的所有包,它将解决您的问题.我希望它有帮助

@WSDLDocumentation WebService 客户端中文乱码

@WSDLDocumentation WebService 客户端中文乱码

先描述一下我之前的 wsdl 客户端代码生成步骤:

1、

2、


3、生成的代码如:



生成客户端注释上乱码的解决方案如下:

采用 apache-cxf 工具包中的 wsdl2java 

E:\jar-tools\apache-cxf\apache-cxf-2.6.16\bin>wsdl2java -encoding utf-8 -d e:/webservice/20170216/workflow -p com.eastrobot.support.core.system http://localhost:9527/kbase-core/ws/base/iWorkflowService?wsdl

ABAP-Keyword Documentation

ABAP-Keyword Documentation

转载:https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenabap.htm

ABAP - 关键字文档

本文档描述了ABAP语言及其面向对象的 ABAP对象的关键字的语法和含义 除此之外,还描述了语言框架和相关的系统类。

  • ABAP - 概述 

    ABAP简介和最重要的总括主题。
  • ABAP字典ABAP字典中ABAP 

    最重要对象的完整描述。
  • ABAP - 参考 

    相关上下文中所有ABAP关键字的完整描述。
  • ABAP - 快速参考 

    所有语句的简短概述,按字母顺序排列。
  • ABAP - 特定于发行版的更改 

    自3.0版以来对ABAP所做的所有更改和增强的列表
  • ABAP - 编程指南 

    使用ABAP的规则和提示。
  • ABAP - 安全说明 

    ABAP计划中所有潜在安全风险的概述。
  • ABAP - 

    ABAP环境中的术语表及其解释。
  • ABAP - 索引 

    所有语言元素的字母索引。
  • ABAP - 关键字目录 

    按字母顺序搜索的按字母顺序排列的关键字目录。
  • ABAP - 示例 

    可执行示例程序的编译。

此外部版本的ABAP关键字文档仅支持文档本身内的文本链接以及外部Web地址,例如 SAP Help Portal其他链接(例如SAP系统中程序的链接)在此版本中不活动。

注意

ABAP关键字文档中概述的程序和程序提取是语法示例,不适用于生产系统环境。源代码示例的目的是为了更好地解释和可视化ABAP语句的语法和语义。SAP不保证代码的正确性或完整性。此外,SAP对通过使用示例程序可能发生的错误或其后果不承担任何法律责任或义务。

可以使用程序SAPBC_DATA_GENERATOR填充示例程序中使用的飞行数据模型的数据库表

 

 

Android documentation decompile

Android documentation decompile

Made by Li Wendong rayleeya@gmail.com 

2010-12-13 Monday in Beijing 

A, decompile flowchart 

Android documentation decompile 

Second, tools to use (command)


Preparations 

Suppose I am working directory for the $ AndroidDecompile, first of all to system.img in (or compiled from source code) of several important odex files are copied to the working directory, they are: core.odex, ext.odex, framework . odex, android.policy.odex, services.odex (also can be placed in another directory, by setting BOOTCLASSPATH specified, the default is the current directory, please refer to baksmali on BOOTCLASSPATH help information.) 

Download the following tools to $ AndroidDecompile in: 

Baksmali: 

http://code.google.com/p/smali/downloads/list 

Smali: 

http://code.google.com/p/smali/downloads/list 

Dex2jar: 

http://code.google.com/p/dex2jar/downloads/list 

JD-GUI (Java Decompile GUI): 

http://java.decompiler.free.fr/?q=jdgui <!--[ if! supportNestedAnchors ]--><!--[ endif] -> 

AutoSign: 

http://d.download.csdn.net/down/2768910/fjfdszj 

Apktool 

http://code.google.com/p/android-apktool/downloads/list 

Suppose we have an application, compile the class file after it took out alone, that there are two files app.apk and app.odex, place them on the next $ AndroidDecompile. 

1. Odex file using baksmali.jar the document is divided into smali 

$ Java-jar baksmali-1.2.5.jar-x app.odex 

If successful, will generate a $ AndroidDecompile out directory, which are to ". Smali" for the file name suffix, in this role does not go into these files. 

2. Use smali.jar the out / directory smali files into classes.dex 

$ Java-Xmx512M-jar smali-1.2.5.jar out-o classes.dex 

classes.dex Dalvik VM is used in the compiled class file format, in the normal apk file will have. 

3. Use dex2jar classes.dex decompiled the jar file 

After the download dex2jar compressed codecs, which will have dex2jar.sh (and dex2jar.bat) files, documents and dex2jar.sh if classes.dex in the same directory, use the following ways classes.dex decompiled jar File: 

$ Dex2jar.sh classes.dex 

If successful, it will generate in the current directory, compiled files anti-classes.dex.dex2jar.jar. 

dex2jar dex files that can be manipulated, you can directly manipulate apk file, it uses rules: 

dex2jar file1.dexORapk file2.dexORapk ... 

4. Using the JD-GUI view the anti-compiled jar file 

JD-GUI is a visual Java decompiler code viewer, it can be real-time anti-compiled java class file to view the file. Jd-gui extract the downloaded file, perform directory jd-gui executable file to start and then load the previous step in the anti-compiled classes.dex.dex2jar.jar files. 

5. From odex classes.dex anti-compiled files and other resources re-packaged into a complete apk 

We assume that the above situation is the application compiled class files from apk file is stripped out, here is how to do the steps above to get the classes.dex and apk file in other re-packaged into a usable apk. 

First, the anti-compiled classes.dex and original app.apk (excluding classes.dex) re-compressed into a complete app.apk (apk file compression tools available to open), into the app that will classes.dex . apk in. 

Unzip the downloaded file AutoSign, you can see signapk.jar (there are a Sign.bat) file, execute the following command to app.apk file signature, to generate a working apk file. 

$ Java-jar signapk.jar testkey.x509.pem testkey.pk8 app.apk app_signed.apk 

6. Apktool use 

There is a tool the Internet is apktool, apk can be resolved, de-compile the resource file, and parse the class file into smali documents; while the files can be parsed into a re-packaged apk. Several features and tools described above is similar to its use as follows: 

apktool d app.apk and decompile app.apk to the folder and 

apktool b app from the app folder, re-APK, output to ABC \ dist \ out.apk 

The specific use will not go, please refer to the official website, or: 

http://www.geeka.net/2010/05/apktool-decode-android-google-code/ 

7. My $ AndroidDecompile screenshot files directory 

 

Third, a number of tools to help information 

1. Baksmali help information 

usage: java-jar baksmali.jar [options] <dex-file> 

disassembles and / or dumps a dex file 

-?,-- Help Prints the help message then exits. 

-B, - no-debug-info Specify twice for debug options 

don''t write out debug info (. local, 

. Param,. Line, etc.) 

-C, - bootclasspath <BOOTCLASSPATH> The bootclasspath jars to use, for 

analysis. Defaults to 

core.jar: ext.jar: framework.jar: andro 

id.policy.jar: services.jar. If the 

value begins with a:, it will be 

appended to the default 

bootclasspath instead of replacing it 

-D, - bootclasspath-dir <DIR> The base folder to look for the 

bootclasspath files in. Defaults to 

the current directory 

-F, - code-offsets Add comments to the disassembly 

containing the code offset for each address 

-L, - use-locals Output the. Locals directive with 

the number of non-parameter 

registers, rather than the. register 

-O, - output <DIR> Directive with the total number of register 

the directory where the disassembled 

files will be placed. The default is out 

-P, - no-parameter-registers Use the v <n> syntax instead of the 

p <n> syntax for registers mapped to 

method parameters 

-R, - register-info <REGISTER_INFO_TYPES> Print the specificed type (s) of 

register information for each 

instruction. "ARGS, DEST" is the 

default if no types are specified. 

Valid values are: 

ALL: all pre-and post-instruction registers. 

ALLPRE: all pre-instruction registers 

ALLPOST: all post-instruction registers 

ARGS: any pre-instruction registers 

used as arguments to the instruction 

DEST: the post-instruction 

destination register, if any 

MERGE: Any pre-instruction register 

has been merged from more than 1 

different post-instruction register 

from its predecessors 

FULLMERGE: For each register that 

would be printed by MERGE, also show 

the incoming register types that 

were merged 

-S, - sequential-labels Create label names using a 

sequential numbering scheme per 

label type, rather than using the 

bytecode address 

-V, - version Prints the version then exits 

-X, - deodex Deodex the given odex file. This 

option is ignored if the input file 

is not an odex file 

2. Smali help information 

usage: java-jar smali.jar [options] [-] [<smali-file> | folder] * 

assembles a set of smali files into a dex file 

-?,-- Help prints the help message then exits. Specify twice for 

debug options 

-O, - output <FILE> the name of the dex file that will be written. The default 

is out.dex 

-V, - version prints the version then exits 

3. Auto-sign with the help of information 

SignApk.jar is a tool included with the Android platform source bundle. 

testkey.pk8 is the private key that is compatible with the recovery image included in this zip file 

testkey.x509.pem is the corresponding certificate / public key 

Usage: 

java-jar signapk.jar testkey.x509.pem testkey.pk8 update.zip update_signed.zip 

4. Apktool help information 

Apktool v1.3.2 - a tool for reengineering Android apk files 

Copyright 2010 Ryszard Wi? Niewski <brut.alll@gmail.com> 

Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0) 

Usage: apktool [-v | - verbose] COMMAND [...] 

COMMANDs are: 

d [ecode] [OPTS] <file.apk> [<dir>] 

Decode <file.apk> to <dir>. 

OPTS: 

-S, - no-src 

Do not decode sources. 

-R, - no-res 

Do not decode resources. 

-D, - debug 

Decode in debug mode. Check project page for more info. 

-F, - force 

Force delete destination directory. 

-T <tag>, - frame-tag <tag> 

Try to use framework files tagged by <tag>. 

- Keep-broken-res 

Use if there was an error and some resources were dropped, eg: 

"Invalid config flags detected. Dropping resources", but you 

want to decode them anyway, even with errors. You will have to 

fix them manually before building. 

b [uild] [OPTS] [<app_path>] [<out_file>] 

Build an apk from already decoded application located in <app_path>. 

It will automatically detect, whether files was changed and perform 

needed steps only. 

If you omit <app_path> then current directory will be used. 

If you omit <out_file> then <app_path> / dist / <name_of_original.apk> 

will be used. 

OPTS: 

-F, - force-all 

Skip changes detection and build all files. 

-D, - debug 

Build in debug mode. Check project page for more info. 

if | install-framework <framework.apk> [<tag>] 

Install framework file to your system. 

Additional info for, See: http://code.google.com/p/android-apktool/ 

IV References 

1. Smali 

http://code.google.com/p/smali/ 

http://www.geeka.net/2010/05/android-apk-odex-classes-dex/ 

2. ApkTool 

http://code.google.com/p/android-apktool/ 

http://www.geeka.net/2010/05/apktool-decode-android-google-code/


android – 尝试通过ACTION_OPEN_DOCUMENT forPersistableUriPermission()无法自定义DocumentsProvider

android – 尝试通过ACTION_OPEN_DOCUMENT forPersistableUriPermission()无法自定义DocumentsProvider

我正在尝试编写一个自定义DocumentsProvider,允许其他应用程序对其提供的Uris采取持久权限

我有一个DocumentsProvider,我在AndroidManufest.xml中声明如下

<provider
   android:name="com.cgogolin.myapp.MyContentProvider"
   android:authorities="com.cgogolin.myapp.MyContentProvider"
   android:grantUriPermissions="true"
   android:exported="true"
   android:permission="android.permission.MANAGE_DOCUMENTS"
   android:enabled="@bool/atLeastKitKat">
  <intent-filter>
    <action android:name="android.content.action.DOCUMENTS_PROVIDER" />
  </intent-filter>
</provider>

我的应用程序具有MANAGE_DOCUMENTS权限集

<uses-permission android:name="android.permission.MANAGE_DOCUMENTS" />

(显然这不是必要的,但添加/删除它也无关紧要).
当我打开ACTION_OPEN_DOCUMENT选择器UI时,我可以看到我的提供者

Intent opendocumentIntent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
opendocumentIntent.addCategory(Intent.CATEGORY_OPENABLE);
opendocumentIntent.setType("application/pdf");
opendocumentIntent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION|Intent.FLAG_GRANT_WRITE_URI_PERMISSION|Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION);
startActivityForResult(opendocumentIntent,EDIT_REQUEST);

然后,在我的提供者那里选择一个文件之后,在我的应用程序的onActivityResult()方法中,我可以通过我从intent.getData()获得的Uri成功打开我的DocumentsProvider提供的文件.

但是,尝试保持读取或写入权限

getContentResolver().takePersistableuriPermission(uri,Intent.FLAG_GRANT_READ_URI_PERMISSION);

要么

getContentResolver().takePersistableuriPermission(uri,Intent.FLAG_GRANT_WRITE_URI_PERMISSION);

总是失败,例如

No permission grant found for UID 10210 and Uri content://com.cgogolin.myapp.MyContentProvider/document/tshjhczf.pdf

如果我从选择器UI中的google驱动器或下载提供程序中选择一个文件,以这种方式获取权限.所以我认为问题出在我的提供者身上.

尽管我指定了android:grantUriPermissions =“true”,为什么没有创建权限授予?

我怎样才能说服Android为我创建这样的权限授予?

毕竟我不认为我可以自己做,因为我不知道打开选择器UI的过程的UID,或者至少不知道我知道如何.

解决方法

编辑:

我之前的回答并不好.出于安全原因,您可以使用“android.permission.MANAGE_DOCUMENTS”.
只有系统UI选择器才能列出您的文档.

但是,在打开文档的应用程序的清单中,您不需要此权限.
实际上,您不应该获得此权限,因为这是系统权限.

我刚刚测试了它并调用了takePersistableuriPermission表单onActivityResult成功了.

我使用了DocumentProvider和模拟数据(一个根,3个txt文档).
如果它仍然不适合您,您的文档提供程序可能会有一些问题.

EDIT2:

示例代码

package com.example.test;

import android.database.Cursor;
import android.database.MatrixCursor;
import android.os.CancellationSignal;
import android.os.ParcelFileDescriptor;
import android.provider.DocumentsProvider;

import java.io.FileNotFoundException;

public class MyContentProvider extends DocumentsProvider {

    private final static String[] rootColumns = new String[]{
            "_id","root_id","title","icon"
    };
    private final static String[] docColumns = new String[]{
            "_id","document_id","_display_name","mime_type","icon"
    };

    MatrixCursor matrixCursor;
    MatrixCursor matrixRootCursor;

    @Override
    public boolean onCreate() {

        matrixRootCursor = new MatrixCursor(rootColumns);
        matrixRootCursor.addRow(new Object[]{1,1,"TEST",R.mipmap.ic_launcher});

        matrixCursor = new MatrixCursor(docColumns);
        matrixCursor.addRow(new Object[]{1,"a.txt","text/plain",R.mipmap.ic_launcher});
        matrixCursor.addRow(new Object[]{2,2,"b.txt",R.mipmap.ic_launcher});
        matrixCursor.addRow(new Object[]{3,3,"c.txt",R.mipmap.ic_launcher});

        return true;
    }

    @Override
    public Cursor queryRoots(String[] projection) throws FileNotFoundException {
        return matrixRootCursor;
    }

    @Override
    public Cursor queryDocument(String documentId,String[] projection)
            throws FileNotFoundException {

        return matrixCursor;
    }

    @Override
    public Cursor queryChildDocuments(String parentDocumentId,String[] projection,String sortOrder)
            throws FileNotFoundException {

        return matrixCursor;
    }

    @Override
    public ParcelFileDescriptor opendocument(String documentId,String mode,CancellationSignal signal)
            throws FileNotFoundException {

        int id;
        try {
            id = Integer.valueOf(documentId);
        } catch (NumberFormatException e) {
            throw new FileNotFoundException("Incorrect document ID " + documentId);
        }

        String filename = "/sdcard/";

        switch (id) {
            case 1:
                filename += "a.txt";
                break;
            case 2:
                filename += "b.txt";
                break;
            case 3:
                filename += "c.txt";
                break;
            default:
                throw new FileNotFoundException("UnkNown document ID " + documentId);
        }

        return ParcelFileDescriptor.open(new File(filename),ParcelFileDescriptor.MODE_READ_WRITE);
    }
}

注意:
您可以使用DocumentsContract.Document和DocumentsContract.Root中的常量.
我不确定是否需要“_id”.

EDIT3:

更新了示例代码以从/ sdcard打开文档.
添加了读/写外部存储权限.

AndroidManifest.xml中

<?xml version="1.0" encoding="utf-8"?>
<manifest
    package="com.example.test"
    xmlns:android="http://schemas.android.com/apk/res/android">

    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

    <application
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name">

        <provider
            android:name="com.example.test.MyContentProvider"
            android:authorities="com.example.test.document"
            android:enabled="true"
            android:exported="@bool/atLeastKitKat"
            android:grantUriPermissions="true"
            android:permission="android.permission.MANAGE_DOCUMENTS">
            <intent-filter>
                <action android:name="android.content.action.DOCUMENTS_PROVIDER"/>
            </intent-filter>
        </provider>
    </application>

</manifest>

客户端应用

具有空活动的新项目,未添加任何权限.

打开文件

Intent opendocumentIntent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
opendocumentIntent.addCategory(Intent.CATEGORY_OPENABLE);
opendocumentIntent.setType("text/plain");
opendocumentIntent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION
                    | Intent.FLAG_GRANT_WRITE_URI_PERMISSION
                    | Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION);
startActivityForResult(opendocumentIntent,1);

onActivityResult

@Override
protected void onActivityResult(int requestCode,int resultCode,Intent data) {
    switch (requestCode) {
        case 1: // Todo: Use constant
            if (resultCode == RESULT_OK) {
                if (data == null) return; // Todo: Show error
                Uri uri = data.getData();
                if (uri == null) return; // Todo: Show error
                getContentResolver().takePersistableuriPermission(uri,Intent.FLAG_GRANT_READ_URI_PERMISSION);

                InputStream is = null;
                try {
                    is = getContentResolver().openInputStream(uri);

                    // Just for quick sample (I kNow what I will read)
                    byte[] buffer = new byte[1024];
                    int read = is.read(buffer);
                    String text = new String(buffer,read);

                    ((TextView) findViewById(R.id.text)).setText(text);
                } catch (IOException e) {
                    e.printstacktrace();
                } finally {
                    if (is != null) try {
                        is.close();
                    } catch (IOException e) {
                        e.printstacktrace();
                    }
                }
            }
            break;
    }
}

我们今天的关于asp.net – 升级到WebAPI 2.1时出错XmlDocumentationProvider不实现接口成员GetDocumentation的分享就到这里,谢谢您的阅读,如果想了解更多关于@WSDLDocumentation WebService 客户端中文乱码、ABAP-Keyword Documentation、Android documentation decompile、android – 尝试通过ACTION_OPEN_DOCUMENT forPersistableUriPermission()无法自定义DocumentsProvider的相关信息,可以在本站进行搜索。

本文标签: