2015-05-04 42 views
1

我在ServiceStack中有一個REST & SOAP API實現,並且在WSDL中擺脫Swagger時遇到問題。從ServiceStack WSDL中刪除Swagger

我已經安裝了servicestack與招搖插件:

Plugins.Add(new SwaggerFeature()); 

我記錄一切其餘的一邊,我使用和招搖效果很好。我在WSDL中得到這樣的東西:

<xs:complexType name="ArrayOfKeyValueOfstringSwaggerModelEdXdwojR"> 
<xs:annotation> 
<xs:appinfo> 
<IsDictionary xmlns="http://schemas.microsoft.com/2003/10/Serialization/">true</IsDictionary> 
</xs:appinfo> 
</xs:annotation> 
<xs:sequence> 
<xs:element minOccurs="0" maxOccurs="unbounded" name="KeyValueOfstringSwaggerModelEdXdwojR"> 
<xs:complexType> 
<xs:sequence> 
<xs:element name="Key" nillable="true" type="xs:string"/> 
<xs:element xmlns:q1="http://me.com/schemas/2015/05/API/" name="Value" nillable="true" type="q1:SwaggerModel"/> 
</xs:sequence> 
</xs:complexType> 
</xs:element> 
</xs:sequence> 
</xs:complexType> 

我想刪除它,因爲我看不到它的用法。任何人都知道它的用途是什麼?還如何刪除?

回答

3

您應該能夠通過使用[Exclude(Feature.Soap)]屬性註釋Request DTO來從SOAP中排除服務。由於它們的內置服務可以使用運行時屬性動態API,例如:

typeof (ResourceRequest) 
    .AddAttributes(new ExcludeAttribute(Feature.Soap));