将String []从Java Web Service返回到Swing客户端的问题

时间:2014-12-30 22:25:04

标签: java xml web-services soap web

我只是想从@webMethod返回一个String []到ws swing客户端。问题是它没有返回任何东西。当我测试它显示的Web服务时

Method returned

net.java.dev.jaxb.array.StringArray : "net.java.dev.jaxb.array.StringArray@2f741802"
SOAP Request

<?xml version="1.0" encoding="UTF-8"?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
    <SOAP-ENV:Header/>
    <S:Body>
        <ns2:getEmployeeNames xmlns:ns2="http://employee.bank.com/"/>
    </S:Body>
</S:Envelope>
SOAP Response

<?xml version="1.0" encoding="UTF-8"?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
    <SOAP-ENV:Header/>
    <S:Body>
        <ns2:getEmployeeNamesResponse xmlns:ns2="http://employee.bank.com/">
            <return>
                <item>73869</item>
            </return>
        </ns2:getEmployeeNamesResponse>
    </S:Body>
</S:Envelope>

网络服务方法

    public String[] getEmployeeNames()
   {
     String[] nameList = ........;
     return nameList;
   }

0 个答案:

没有答案