SOAP UI问题(Unmarshalling)

时间:2016-06-01 06:22:49

标签: java web-services soap

我遇到了肥皂用户界面的问题。

我的网络服务如下:

@WebMethod
public FGSFResponse redeemFGSFCard(FGSFRequest request) {
    LOGGER.info("redeemFGSFCard : soap request :");
}

请求如下所示:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://webservice.fgsf.nfdl.com/">
   <soapenv:Header/>
   <soapenv:Body>
      <web:redeemFGSFCard>
         <arg0>
            <cashMemoDate>12-12-2016</cashMemoDate>
            <cashMemoNumber></cashMemoNumber>
            <cashierId>1</cashierId>
            <invoiceAmount></invoiceAmount>
            <sessionId>1</sessionId>
            <storeCode>4327</storeCode>
            <terminalId>1</terminalId>
            <timeStamp></timeStamp>
            <fgsfRequestDtls>
               <cardNo>8220102655101593004537</cardNo>
               <cardType>FP</cardType>
               <txnAmount></txnAmount>
            </fgsfRequestDtls>
         </arg0>
      </web:redeemFGSFCard>
   </soapenv:Body>
</soapenv:Envelope>

回应:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
      <soap:Fault>
         <faultcode>soap:Client</faultcode>
         <faultstring>Unmarshalling Error:</faultstring>
      </soap:Fault>
   </soap:Body>
</soap:Envelope>

我收到Unmarshalling错误的情况: 如果我没有在txnAmount元素中传递任何值,那么我将得到此异常。如果我在txnAmount元素中传递了值,那么它的工作正常。

我已查看此答案,但未解决我的问题Jax-Ws Unmarshalling Error

我收到了一个解组错误,我不知道为什么会收到此异常。

FGSFRequestClass:

public class FGSFRequest extends CommonRequestVO {
    private FGSFRequestDtls fgsfRequestDtls;

    public FGSFRequestDtls getFgsfRequestDtls() {
        return fgsfRequestDtls;
    }

    public void setFgsfRequestDtls(FGSFRequestDtls fgsfRequestDtls) {
        this.fgsfRequestDtls = fgsfRequestDtls;
    }       
}

public class FGSFRequestDtls {

    private String cardType;
    private String cardNo;
    private Double txnAmount;

    public FGSFRequestDtls(){

    }

    public String getCardType() {
        return cardType;
    }
    public void setCardType(String cardType) {
        this.cardType = cardType;
    }
    public String getCardNo() {
        return cardNo;
    }
    public void setCardNo(String cardNo) {
        this.cardNo = cardNo;
    }
    public Double getTxnAmount() {
        return txnAmount;
    }
    public void setTxnAmount(Double txnAmount) {
        this.txnAmount = txnAmount;
    }

}

0 个答案:

没有答案