Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/326.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 使用C以编程方式创建SOAP信封#_C#_Soap - Fatal编程技术网

C# 使用C以编程方式创建SOAP信封#

C# 使用C以编程方式创建SOAP信封#,c#,soap,C#,Soap,我有以下Java代码: MessageFactory factory = MessageFactory.newInstance(); SOAPMessage message = factory.createMessage(); SOAPBody body = message.getSOAPBody(); QName qualifiedName = new QName("http://mysite.com.br/", "getQuantidade", "ns2"); SOAPBodyEleme

我有以下Java代码:

MessageFactory factory = MessageFactory.newInstance();

SOAPMessage message = factory.createMessage();
SOAPBody body = message.getSOAPBody();

QName qualifiedName = new QName("http://mysite.com.br/",
"getQuantidade", "ns2");
SOAPBodyElement element = body.addBodyElement(qualifiedName);
SOAPElement codigoProduto = element.addChildElement(new QName("codigo"));
codigoProduto.setValue("ARQ");
SOAPElement quantidade = element.addChildElement(new QName("quantidade"));
quantidade.setValue("2");

message.writeTo(System.out);
我想在C#中做同样的事情:使用类逐步装入SOAP信封steb。我做了一些研究,没有发现类似的东西

最好的方法是什么? 我不想要确切的代码作为答案,只要给我指路(:


非常感谢。

不完全确定,但我将从返回的
MessageEncoderFactory
开始,我的下一步是检查返回的
Encoder
对象以获取您正在寻找的功能。