-
Notifications
You must be signed in to change notification settings - Fork 393
Expand file tree
/
Copy pathSoapCoreOptions.cs
More file actions
173 lines (147 loc) · 6.04 KB
/
SoapCoreOptions.cs
File metadata and controls
173 lines (147 loc) · 6.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
using System;
using System.Collections.Generic;
using System.ServiceModel.Channels;
using System.Xml;
using SoapCore.Extensibility;
using SoapCore.Serializer;
namespace SoapCore
{
public class SoapCoreOptions
{
private bool? _indentWsdl = null;
#if NET8_0_OR_GREATER
/// <summary>
/// Gets or sets the Path of the Service
/// </summary>
required public string Path { get; set; }
#else
/// <summary>
/// Gets or sets the Path of the Service
/// </summary>
public string Path { get; set; }
#endif
/// <summary>
/// Gets or sets encoders
/// </summary>
public SoapEncoderOptions[] EncoderOptions { get; set; }
/// <summary>
/// Gets or sets a value indicating the kind of serializer
/// <para>Defaults to <see cref="SoapSerializer.DataContractSerializer"/></para>
/// </summary>
public SoapSerializer SoapSerializer { get; set; } = SoapSerializer.DataContractSerializer;
/// <summary>
/// Gets or sets a value indicating whether Path is case-sensitive
/// <para>Defaults to false</para>
/// </summary>
public bool CaseInsensitivePath { get; set; } = false;
/// <summary>
/// Gets or sets a value indicating the ModelBounder
/// <para>Defaults to null</para>
/// </summary>
public ISoapModelBounder SoapModelBounder { get; set; } = null;
/// <summary>
/// Gets or sets a value whether to use basic authentication
/// <para>Defaults to false</para>
/// </summary>
public bool UseBasicAuthentication { get; set; }
/// <summary>
/// Gets or sets a value indicating whether publication of service metadata on HTTP GET request is activated
/// <para>Defaults to true</para>
/// </summary>
public bool HttpGetEnabled { get; set; } = true;
/// <summary>
/// Gets or sets a value indicating whether publication of service metadata on HTTPS GET request is activated
/// <para>Defaults to true</para>
/// </summary>
public bool HttpsGetEnabled { get; set; } = true;
/// <summary>
/// Gets or sets a value indicating whether invocation by posting formdata on HTTP is activated
/// <para>Defaults to true</para>
/// </summary>
public bool HttpPostEnabled { get; set; } = true;
/// <summary>
/// Gets or sets a value indicating whether invocation by posting formdata on HTTP is activated
/// <para>Defaults to true</para>
/// </summary>
public bool HttpsPostEnabled { get; set; } = true;
/// <summary>
/// Gets or sets a value indicating whether to omit the Xml declaration (<?xml version="1.0" encoding="utf-8"?>) in responses
/// <para>Defaults to true</para>
/// </summary>
public bool OmitXmlDeclaration { get; set; } = true;
/// <summary>
/// Gets or sets a value indicating wheter to add the stand alone attribute in the XML declaration
/// <para>Defaults to false</para>
/// </summary>
public bool? StandAloneAttribute { get; set; } = null;
/// <summary>
/// Gets or sets a value indicating whether to indent the Xml in responses
/// <para>Defaults to true</para>
/// </summary>
public bool IndentXml { get; set; } = true;
/// <summary>
/// Gets or sets a value indicating whether to indent the generated WSDL.
/// <para>Defaults to the value of <see cref="IndentXml"/></para>
/// </summary>
public bool IndentWsdl { get => _indentWsdl ?? IndentXml; set => _indentWsdl = value; }
/// <summary>
/// Gets or sets a value indicating whether to check to make sure that the XmlOutput doesn't contain invalid characters
/// <para>Defaults to true</para>
/// </summary>
public bool CheckXmlCharacters { get; set; } = true;
/// <summary>
/// Add Microsoft Guid schema to wsdl
/// </summary>
public bool UseMicrosoftGuid { get; set; } = false;
/// <summary>
/// Gets or sets an collection of Xml Namespaces to override the default prefix for.
/// </summary>
public XmlNamespaceManager XmlNamespacePrefixOverrides { get; set; }
public WsdlFileOptions WsdlFileOptions { get; set; }
/// <summary>
/// Get or sets a value indicating the use of custom serializer, use for if multiple custom serializer used to services
/// </summary>
internal Type SerializerIdentifier { get; set; }
/// <summary>
/// Sets additional namespace declaration attributes in envelope
/// </summary>
public Dictionary<string, string> AdditionalEnvelopeXmlnsAttributes { get; set; }
/// <summary>
/// By default, the soapAction that is generated if not explicitely specified is
/// {namespace}/{contractName}/{methodName}. If set to true, the service name will
/// be omitted, so that the soapAction will be {namespace}/{methodName}.
/// </summary>
public bool GenerateSoapActionWithoutContractName { get; set; } = false;
/// <summary>
/// Gets or sets a value indicating whether newlines in the SOAP XML responses
/// should be normalized to the system's default newline character (CRLF on Windows).
/// Default is true.
/// </summary>
public bool NormalizeNewLines { get; set; } = true;
/// <summary>
/// Can be used to override the HTTP Scheme in the generated service description. This can be useful
/// if you are behind a firewall and the firewall sets the X-Forwarded-Host header, but the
/// internal HTTP scheme is not the same as the external.
/// </summary>
public string SchemeOverride { get; set; }
/// <summary>
/// When true, only [XmlIgnore] is used to exclude properties from WSDL generation,
/// ignoring [IgnoreDataMember]. This matches legacy WCF/ASMX XmlSerializer behavior
/// where [IgnoreDataMember] had no effect on XmlSerializer.
/// <para>Defaults to false</para>
/// </summary>
public bool XmlIgnoreOnlyForWsdl { get; set; } = false;
/// <summary>
/// When true, uses legacy WCF/ASMX WSDL naming conventions:
/// portType name becomes {ContractName}Soap, and message names
/// use {OperationName}SoapIn/{OperationName}SoapOut pattern.
/// <para>Defaults to false</para>
/// </summary>
public bool UseLegacyWsdlNaming { get; set; } = false;
public void UseCustomSerializer<TCustomSerializer>()
where TCustomSerializer : class, IXmlSerializationHandler
{
SerializerIdentifier = typeof(TCustomSerializer);
}
}
}