JAXWS - SOAP WebService - 尽管来自WebService的XML响应,但客户端上仍为Null对象

时间:2013-09-13 06:00:30

标签: java soap jax-ws jaxb2

我需要你的帮助。  使用的版本是JAX-WS RI 2.2.6b21 / SOAP 1.2

我正在开发一个WS客户端来连接供应商生产的WebService服务器。  我能够发送下一个XML请求:

<S:Envelope xmlns:S="http://www.w3.org/2003/05/soap-envelope">
    <S:Body>
        <ns2:executeAbout xmlns:ns2="http://vendor.com/">
            <About/>
        </ns2:executeAbout>
    </S:Body>
</S:Envelope>

以及XML响应表单下面的WebService服务器:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://vendor.com/">
    <soapenv:Body>
        <executeAboutResponse xmlns="">
            <AboutResponse success="true">
            </AboutResponse>
        </executeAboutResponse>
    </soapenv:Body>
</soapenv:Envelope>

AboutResponseType班级:

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "AboutResponseType", propOrder = {
    "result",
    "messages"
})
public class AboutResponseType {

    @XmlElement(name = "Result")
    protected AboutResultType result;
    @XmlElement(name = "Messages")
    protected MessagesType messages;
    @XmlAttribute(name = "success")
    protected Boolean success;

    /**
     * Gets the value of the result property.
     * 
     * @return
     *     possible object is
     *     {@link AboutResultType }
     *     
     */
    public AboutResultType getResult() {
        return result;
    }

    /**
     * Sets the value of the result property.
     * 
     * @param value
     *     allowed object is
     *     {@link AboutResultType }
     *     
     */
    public void setResult(AboutResultType value) {
        this.result = value;
    }

    /**
     * Gets the value of the messages property.
     * 
     * @return
     *     possible object is
     *     {@link MessagesType }
     *     
     */
    public MessagesType getMessages() {
        return messages;
    }

    /**
     * Sets the value of the messages property.
     * 
     * @param value
     *     allowed object is
     *     {@link MessagesType }
     *     
     */
    public void setMessages(MessagesType value) {
        this.messages = value;
    }

    /**
     * Gets the value of the success property.
     * 
     * @return
     *     possible object is
     *     {@link Boolean }
     *     
     */
    public Boolean isSuccess() {
        return success;
    }

    /**
     * Sets the value of the success property.
     * 
     * @param value
     *     allowed object is
     *     {@link Boolean }
     *     
     */
    public void setSuccess(Boolean value) {
        this.success = value;
    }

}

但不幸的是,JAVA对象响应为null并且没有引发java异常:

AboutType aboutType = new AboutType();
AboutResponseType aboutResponse = myProxy.executeAbout(aboutType);
 assertNotNull(aboutResponse);

通过在互联网上搜索我理解的是,这是响应中的名称空间问题。  但问题在哪里以及如何解决?

非常感谢你的帮助,我不在乎。

0 个答案:

没有答案