2015-05-04 41 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));