Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
sunxiaotianmg
Mozi.HttpEmbedded
提交
315223df
M
Mozi.HttpEmbedded
项目概览
sunxiaotianmg
/
Mozi.HttpEmbedded
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
Mozi.HttpEmbedded
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
315223df
编写于
6月 25, 2021
作者:
JasonWcx
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
增加ResponseContentType和WebServiceAttribute
上级
fdafabf3
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
129 addition
and
10 deletion
+129
-10
Mozi.HttpEmbedded/Attributes/ResponseContentTypeAttribute.cs
Mozi.HttpEmbedded/Attributes/ResponseContentTypeAttribute.cs
+26
-0
Mozi.HttpEmbedded/Attributes/WebServiceAttribute.cs
Mozi.HttpEmbedded/Attributes/WebServiceAttribute.cs
+11
-0
Mozi.HttpEmbedded/Mozi.HttpEmbedded.csproj
Mozi.HttpEmbedded/Mozi.HttpEmbedded.csproj
+2
-0
Mozi.HttpEmbedded/Page/RuntimeApi.cs
Mozi.HttpEmbedded/Page/RuntimeApi.cs
+1
-0
Mozi.HttpEmbedded/WebService/SOAP.cs
Mozi.HttpEmbedded/WebService/SOAP.cs
+18
-9
Mozi.HttpEmbedded/WebService/WSDL.cs
Mozi.HttpEmbedded/WebService/WSDL.cs
+71
-1
未找到文件。
Mozi.HttpEmbedded/Attributes/ResponseContentTypeAttribute.cs
0 → 100644
浏览文件 @
315223df
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
namespace
Mozi.HttpEmbedded.Attributes
{
/// <summary>
/// 响应内容 文档类型
/// </summary>
[
AttributeUsage
(
AttributeTargets
.
ReturnValue
)]
internal
class
ResponseContentTypeAttribute
:
Attribute
{
public
string
ContentType
{
get
;
set
;
}
public
string
Encoding
{
get
;
set
;
}
public
ResponseContentTypeAttribute
(
string
contentType
,
string
encoding
)
{
ContentType
=
contentType
;
Encoding
=
encoding
;
}
public
ResponseContentTypeAttribute
(
string
contentType
):
this
(
contentType
,
""
)
{
}
}
}
Mozi.HttpEmbedded/Attributes/WebServiceAttribute.cs
0 → 100644
浏览文件 @
315223df
using
System
;
namespace
Mozi.HttpEmbedded.Attributes
{
[
AttributeUsage
(
AttributeTargets
.
Class
)]
internal
class
WebServiceAttribute
:
Attribute
{
public
string
Namespace
=
""
;
public
string
DocumentName
=
""
;
}
}
Mozi.HttpEmbedded/Mozi.HttpEmbedded.csproj
浏览文件 @
315223df
...
...
@@ -65,6 +65,8 @@
<Compile
Include=
"ASCIICode.cs"
/>
<Compile
Include=
"Attributes\BasicApiAttribute.cs"
/>
<Compile
Include=
"Attributes\HttpMethodAttribute.cs"
/>
<Compile
Include=
"Attributes\ResponseContentTypeAttribute.cs"
/>
<Compile
Include=
"Attributes\WebServiceAttribute.cs"
/>
<Compile
Include=
"Auth\User.cs"
/>
<Compile
Include=
"Cache\MemoryCache.cs"
/>
<Compile
Include=
"Cert\CertManager.cs"
/>
...
...
Mozi.HttpEmbedded/Page/RuntimeApi.cs
浏览文件 @
315223df
...
...
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using
System.ComponentModel
;
using
System.IO
;
using
System.Reflection
;
using
Mozi.HttpEmbedded.Attributes
;
namespace
Mozi.HttpEmbedded.Page
{
...
...
Mozi.HttpEmbedded/WebService/SOAP.cs
浏览文件 @
315223df
...
...
@@ -5,11 +5,14 @@ using Mozi.HttpEmbedded.Generic;
namespace
Mozi.HttpEmbedded.WebService
{
/// <summary>
/// SOAP envelope封装
/// </summary>
public
class
SOAPEnvelope
{
public
string
xsi
=
"http://www.w3.org/2001/XMLSchema-instance"
;
public
string
xsd
=
"http://www.w3.org/2001/XMLSchema"
;
public
string
e
ncodingStyle
=
"http://www.w3.org/2001/12/soap-encoding"
;
public
string
NS_XSI
=
"http://www.w3.org/2001/XMLSchema-instance"
;
public
string
NS_XSD
=
"http://www.w3.org/2001/XMLSchema"
;
public
string
E
ncodingStyle
=
"http://www.w3.org/2001/12/soap-encoding"
;
/// <summary>
/// SOAP版本
...
...
@@ -34,9 +37,9 @@ namespace Mozi.HttpEmbedded.WebService
XmlTextWriter
writer
=
new
XmlTextWriter
(
ms
,
System
.
Text
.
Encoding
.
UTF8
);
writer
.
WriteStartDocument
(
true
);
writer
.
WriteStartElement
(
envelope
.
Version
.
Prefix
,
"Envelope"
,
envelope
.
Version
.
Namespace
);
writer
.
WriteAttributeString
(
envelope
.
Version
.
Prefix
,
"encodingStyle"
,
null
,
envelope
.
e
ncodingStyle
);
writer
.
WriteAttributeString
(
"xmlns"
,
"xsi"
,
null
,
envelope
.
xsi
);
writer
.
WriteAttributeString
(
"xmlns"
,
"xsd"
,
null
,
envelope
.
xsd
);
writer
.
WriteAttributeString
(
envelope
.
Version
.
Prefix
,
"encodingStyle"
,
null
,
envelope
.
E
ncodingStyle
);
writer
.
WriteAttributeString
(
"xmlns"
,
"xsi"
,
null
,
envelope
.
NS_XSI
);
writer
.
WriteAttributeString
(
"xmlns"
,
"xsd"
,
null
,
envelope
.
NS_XSD
);
//header
if
(
envelope
.
Header
!=
null
)
{
...
...
@@ -56,6 +59,7 @@ namespace Mozi.HttpEmbedded.WebService
{
writer
.
WriteElementString
(
envelope
.
Body
.
Prefix
,
r
.
Key
,
null
,
r
.
Value
);
}
//fault
writer
.
WriteEndElement
();
writer
.
WriteEndElement
();
writer
.
WriteEndElement
();
...
...
@@ -81,9 +85,9 @@ namespace Mozi.HttpEmbedded.WebService
//envelope
var
nodeEnvelope
=
doc
.
CreateNode
(
XmlNodeType
.
Element
,
envelope
.
Version
.
Prefix
,
"Envelope"
,
envelope
.
Version
.
Namespace
);
var
encodingStyle
=
doc
.
CreateAttribute
(
"soap"
,
"encodingStyle"
,
envelope
.
e
ncodingStyle
);
var
encodingStyle
=
doc
.
CreateAttribute
(
"soap"
,
"encodingStyle"
,
envelope
.
E
ncodingStyle
);
var
xsi
=
doc
.
CreateAttribute
(
"xmlns"
,
"xsi"
,
null
);
xsi
.
Value
=
envelope
.
xsi
;
xsi
.
Value
=
envelope
.
NS_XSI
;
var
xsd
=
doc
.
CreateAttribute
(
"xsd"
,
"xsd"
,
null
);
nodeEnvelope
.
Attributes
.
Append
((
XmlAttribute
)
xsi
);
...
...
@@ -134,6 +138,7 @@ namespace Mozi.HttpEmbedded.WebService
}
public
class
SOAPHeaderChild
{
public
string
Name
{
get
;
set
;
}
public
string
actor
{
get
;
set
;}
public
string
mustUnderstand
{
get
;
set
;
}
//"0"|"1"
public
string
encodingStyle
{
get
;
set
;
}
...
...
@@ -150,7 +155,11 @@ namespace Mozi.HttpEmbedded.WebService
public
class
SOAPFault
{
public
string
faultcode
{
get
;
set
;
}
//VersionMismatch SOAP Envelope 元素的无效命名空间被发现
//MustUnderstand Header 元素的一个直接子元素(带有设置为 "1" 的 mustUnderstand 属性)无法被理解。
//Client 消息被不正确地构成,或包含了不正确的信息。
//Server 服务器有问题,因此无法处理进行下去。
public
string
faultcode
{
get
;
set
;
}
public
string
faultstring
{
get
;
set
;
}
public
string
faultactor
{
get
;
set
;
}
public
string
detail
{
get
;
set
;
}
...
...
Mozi.HttpEmbedded/WebService/WSDL.cs
浏览文件 @
315223df
namespace
Mozi.HttpEmbedded.WebService
{
class
WSDL
/// <summary>
/// WSDL描述文档
/// </summary>
public
class
WSDL
{
public
string
NS_tm
=
"http://microsoft.com/wsdl/mime/textMatching/"
;
public
string
NS_soapenc
=
"http://schemas.xmlsoap.org/soap/encoding/"
;
public
string
NS_mime
=
"http://schemas.xmlsoap.org/wsdl/mime/"
;
public
string
NS_tns
=
"Service/ServiceCommon/User"
;
public
string
NS_soap
=
"http://schemas.xmlsoap.org/wsdl/soap/"
;
public
string
NS_s
=
"http://www.w3.org/2001/XMLSchema"
;
public
string
NS_soap12
=
"http://schemas.xmlsoap.org/wsdl/soap12/"
;
public
string
NS_http
=
"http://schemas.xmlsoap.org/wsdl/http/"
;
public
string
Prefix
=
"wsdl"
;
public
string
WSDLNamespace
=
"http://schemas.xmlsoap.org/wsdl/"
;
public
string
Namespace
=
"http://tempurl.org"
;
public
string
Documentation
{
get
;
set
;
}
public
static
string
CreateDocument
(
WSDL
document
)
{
var
text
=
""
;
return
text
;
}
public
class
Document
{
public
string
Name
{
get
;
set
;
}
public
string
Namespace
=
"http://schemas.xmlsoap.org/wsdl/"
;
}
private
class
Types
{
public
string
Schema
{
get
;
set
;
}
public
string
Prefix
=
"xs"
;
private
class
Element
{
public
string
minOccurs
=
""
;
public
string
maxOccurs
=
""
;
public
string
name
=
""
;
public
string
type
=
""
;
}
}
private
class
Message
{
public
class
Part
{
public
string
Name
{
get
;
set
;
}
public
string
Element
{
get
;
set
;
}
}
}
private
class
PortType
{
}
private
class
ServiceType
{
}
private
class
Binding
{
}
private
class
Service
{
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录