0

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

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

PS:我找到了关键字transient,但我认为使用(生成 a 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>
4

0 回答 0