获取序列化java.util.HashMap的值

时间:2012-04-12 09:31:53

标签: java serialization

我正在使用Code First方法来创建我的SOAP操作。创建WSDL&amp; XSD,我正在使用Glassfish的METRO。 我的一个方法(服务器端)返回java.util.HashMap<String, String>。我注意到在生成客户端Web服务之后,AXIS创建了一个名为的类: public class HashMap extends mypack.ws.AbstractMap implements java.io.Serializable

所以问题是如何操纵这个类来获取它的对象值。

PS:我找到了关键字transient,但我认为使用(生成nullpointerexception)不是一个好主意。

由于

编辑:我在这里分享我的WSDL文件:

    <?xml version='1.0' encoding='UTF-8'?><!-- Published by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.2-hudson-740-. --><!-- Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.2-hudson-740-. -->
<definitions xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://ws.rnm.company.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://ws.rnm.company.com/" name="WebService">
    <types>
        <xsd:schema>
            <xsd:import namespace="http://ws.rnm.company.com/" schemaLocation="http://localhost:8080/RNM/WebService?xsd=1" />
        </xsd:schema>
    </types>
    <message name="getSettingsAndData">
        <part name="parameters" element="tns:getSettingsAndData" />
    </message>
    <message name="getSettingsAndDataResponse">
        <part name="parameters" element="tns:getSettingsAndDataResponse" />
    </message>
    <portType name="WebService">
        <operation name="getSettingsAndData">
            <input wsam:Action="http://ws.rnm.company.com/WebService/getSettingsAndDataRequest" message="tns:getSettingsAndData" />
            <output wsam:Action="http://ws.rnm.company.com/WebService/getSettingsAndDataResponse" message="tns:getSettingsAndDataResponse" />
        </operation>
    </portType>
    <binding name="WebServicePortBinding" type="tns:WebService">
        <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
        <operation name="getSettingsAndData">
            <soap:operation soapAction="" />
            <input>
                <soap:body use="literal" />
            </input>
            <output>
                <soap:body use="literal" />
            </output>
        </operation>
    </binding>
    <service name="WebService">
        <port name="WebServicePort" binding="tns:WebServicePortBinding">
            <soap:address location="http://localhost:8080/RNM/WebService" />
        </port>
    </service>
</definitions>

0 个答案:

没有答案