【发布时间】:2013-01-06 19:01:47
【问题描述】:
我有一个使用 AXIOM 实现的 Axis2 Web 服务,它返回一个字符串列表。
在Java中运行的客户端的代码sn-p如下。
// * send SOAP message
sender.fireAndForget( requestObject );
// * get response
OMElement reponseObject = sender.sendReceive( requestObject );
// * iterator for String
Iterator elementItr = reponseObject.getChildElements();
while(elementItr.hasNext())
{
OMElement element = (OMElement)elementItr.next();
// * print each message
System.out.println( element.getText() );
}
我需要实现一个使用上述服务的 c# 客户端。
我已经能够测试一个返回单个字符串对象的 c# 客户端,如下所示。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using HDMClient.hdssWS;
namespace HDMClient
{
class Program
{
static void Main(string[] args)
{
HDMClient.hdssWS.StockQuoteServicePortTypeClient client = new hdssWS.StockQuoteServicePortTypeClient("StockQuoteServiceHttpSoap11Endpoint");
client.update("apple", 1232.123);
Console.WriteLine(client.getPrice("apple"));
Console.ReadLine();
}
}
}
app.config中的消息类型为“MTOM”,WAS中axis2.xml中的配置设置为
<parameter name="enableMTOM">true</parameter>
我可以处理单个字符串响应。
但我不知道如何处理上面的字符串列表。
我搜索过类似的案例
但看起来我没有遇到这种情况。
你有什么想法吗?
【问题讨论】: