积极答复者
WCF MTOM 编码问题

问题
-
请教一个问题如何使用WCF中的Message构建一下类似于下面的消息(使用MTOM编码):
POST /axis2/services/repository HTTP/1.1
Content-Type: multipart/related; boundary=MIMEBoundaryurn_uuid_76A2C3D9BCD3AECFF31217932910180; type="application/xop+xml"; start="<0.urn:uuid76A2C3D9BCD3AECFF31217932910181@apache.org>"; start-info="application/soap+xml"; action="urn:ihe:iti:2007:ProvideAndRegisterDocumentSet-b"
User-Agent: Axis2
Host: localhost:4040
Content-Length: 4567
--MIMEBoundaryurn_uuid_76A2C3D9BCD3AECFF31217932910180
Content-Type: application/xop+xml; charset=UTF-8; type="application/soap+xml"
Content-Transfer-Encoding: binary
Content-ID: <0.urn:uuid:76A2C3D9BCD3AECFF31217932910181@apache.org>
<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"
xmlns:wsa="http://www.w3.org/2005/08/addressing">
<soapenv:Header>
<wsa:To>http://localhost:4040/axis2/services/test11966a</wsa:To>
<wsa:MessageID>urn:uuid:76A2C3D9BCD3AECFF31217932910053</wsa:MessageID>
<wsa:Action soapenv:mustUnderstand="1">urn:ihe:iti:2007:ProvideAndRegisterDocumentSet-b</wsa:Action>
</soapenv:Header>
<soapenv:Body>
<xdsb:ProvideAndRegisterDocumentSetRequest xmlns:xdsb="urn:ihe:iti:xds-b:2007">
<lcm:SubmitObjectsRequest xmlns:lcm="urn:oasis:names:tc:ebxml-regrep:xsd:lcm:3.0">
<rim:RegistryObjectList xmlns:rim="urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0">
<!-- Registry Metadata goes here -->
</rim:RegistryObjectList>
</lcm:SubmitObjectsRequest>
<xdsb:Document id="Document01">
<xop:Include href="cid:1.urn:uuid:76A2C3D9BCD3AECFF3121793290229@apache.org"
xmlns:xop="http://www.w3.org/2004/08/xop/include"/>
</xdsb:Document>
</xdsb:ProvideAndRegisterDocumentSetRequest>
</soapenv:Body>
</soapenv:Envelope>
--MIMEBoundaryurn_uuid_76A2C3D9BCD3AECFF31217932910180
Content-Type: text/plain
Content-Transfer-Encoding: binary
Content-ID: <1.urn:uuid:76A2C3D9BCD3AECFF31217932910229@apache.org>
This is my document.
It is great!
--MIMEBoundaryurn_uuid_76A2C3D9BCD3AECFF31217932910180--
答案
-
<binding name="xxxxxxxxxxxxxxx" messageEncoding="Mtom"/>
- 已建议为答案 Amy PengMicrosoft employee, Moderator 2013年8月21日 7:11
- 已标记为答案 Amy PengMicrosoft employee, Moderator 2013年9月3日 10:13
-
这样配置只能是XML文档用MTOM发送,XML里面的附件是如何用MTOM的?
msdn 上有关于此的示例代码:
http://code.msdn.microsoft.com/Send-Soap-with-Attachments-3784e5f6#content
- 已标记为答案 Amy PengMicrosoft employee, Moderator 2013年9月3日 10:13
全部回复
-
<binding name="xxxxxxxxxxxxxxx" messageEncoding="Mtom"/>
- 已建议为答案 Amy PengMicrosoft employee, Moderator 2013年8月21日 7:11
- 已标记为答案 Amy PengMicrosoft employee, Moderator 2013年9月3日 10:13
-
这样配置只能是XML文档用MTOM发送,XML里面的附件是如何用MTOM的?
msdn 上有关于此的示例代码:
http://code.msdn.microsoft.com/Send-Soap-with-Attachments-3784e5f6#content
- 已标记为答案 Amy PengMicrosoft employee, Moderator 2013年9月3日 10:13