C# SOAP消息前缀问题
我有一条SOAP消息,如下所示:C# SOAP消息前缀问题,c#,vb.net,wcf,c#-4.0,soap,C#,Vb.net,Wcf,C# 4.0,Soap,我有一条SOAP消息,如下所示: <?xml version='1.0' encoding='UTF-8'?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema"
<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/1999/XMLSchema">
<SOAP-ENV:Body>
<ns1:SaveMethod xmlns:ns1="urn:MyService" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<data xsi:type="xsd:string">
<![CDATA[
<?xml version='1.0' encoding='iso-8859-1'?>
<test>123</test>
]]>
</data>
</ns1:SaveMethod>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
也许我可以在客户端做点什么(HttpWebRequestused btw)
非常感谢尝试使用:[ServiceContract(namespace=“MyService”)]namespace=“MyService”或namespace=“urn:MyService”?在接口契约中指定名称空间?我尝试了使用urn和不使用urn,但都不起作用。你还有别的想法吗?
<SaveMethod>
<data xsi:type="xsd:string">
etc.
public void SaveMethod(String data){
// do something
}