2011-12-07 73 views
0

我對Web服務非常陌生。我正在創建Apache CXF(apache-cxf-2.5.0)基於SOAP的Web服務。它從Java類創建WSDL(Java第一種方法)。Web服務響應返回<item xsi:nil =「true」xmlns:xsi =「http://www.w3.org/2001/XMLSchema-instance」/>

以下是我的Java類:

package com.abcd.shoppingcart; 

import java.sql.Connection; 
import java.sql.ResultSet; 
import java.sql.Statement; 

import javax.jws.WebService; 

import org.jboss.wsf.spi.annotation.WebContext; 

import com.abcd.db.DBConnection; 

@WebService(endpointInterface = "com.abcd.shoppingcart.GetMerchantsCardsListInterface", serviceName = "GetMerchantsCardsList4") 
@WebContext(contextRoot = "/" , urlPattern="/SrvGetmerchantsCardsList.jsp") 
public class GetMerchantsCardsList4 implements GetMerchantsCardsListInterface { 
    private DBConnection dbConnection; 

    private Connection con = null; 
    private Statement stmt = null; 
    private ResultSet rset = null; 

    private String sqlSelect = null; 

    String[][] cardData = null; 
    int columnNo = 1, rowNo = 1, totalRows = 0, totalColumns = 6; 

    public String[][] returnMerchantsCardsList(int pageNumber, int recordsPerPage) { 
     dbConnection = new DBConnection(); 
     sqlSelect = "SELECT " 
       + " giftcard.MerchantId, giftcard.MerchantName, giftcard.ID AS GiftCardId, giftcardtransactions.CardNumber AS GiftCardNumber, " 
       + " giftcardtransactions.CardValue, giftcardtransactions.ImageName " 
       + " FROM merchant " 
       + " INNER JOIN giftcard ON giftcard.MerchantId = merchant.ID " 
       + " INNER JOIN giftcardtransactions ON giftcardtransactions.id = merchant.ID " 
       + " WHERE merchant.isActive = '1' " 
       + " GROUP BY giftcard.MerchantId"; 

     try { 
      con = dbConnection.getConnection(); 
      stmt = con.createStatement(); 

      rset = stmt.executeQuery(sqlSelect); 

      rset.last(); 
      totalRows = rset.getRow(); 

      totalRows++; 
      totalColumns++; 

      cardData = new String[totalRows][totalColumns]; 

      rset.beforeFirst(); 

      while (rset.next()) { 
       columnNo = 1; 
       while (columnNo < totalColumns) { 
        cardData[rowNo][columnNo] = rset.getString(columnNo); 
        //System.out.print(cardData[rowNo][columnNo] + "\t\t"); 
        columnNo++; 
       } 
       rowNo++; 
       System.out.println(); 
      } 

      rset.close(); 
      stmt.close(); 
      con.close(); 
     } catch (Exception e) { 
      System.out.println(e.getMessage()); 
     } finally { 
     } 

     return cardData; 
    } 
} 

這是在指定的URL創建WSDL:

<wsdl:definitions xmlns:ns1="http://schemas.xmlsoap.org/soap/http" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://shoppingcart.abcd.com/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="GetMerchantsCardsList4" targetNamespace="http://shoppingcart.abcd.com/"> 
<wsdl:types> 
<xs:schema xmlns:ns1="http://jaxb.dev.java.net/array" xmlns:tns="http://shoppingcart.abcd.com/" xmlns:xs="http://www.w3.org/2001/XMLSchema" attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://shoppingcart.abcd.com/"> 
<xs:import namespace="http://jaxb.dev.java.net/array"/> 
<xs:element name="returnMerchantsCardsList" type="tns:returnMerchantsCardsList"/> 
<xs:element name="returnMerchantsCardsListResponse" type="tns:returnMerchantsCardsListResponse"/> 
<xs:complexType name="returnMerchantsCardsList"> 
<xs:sequence> 
<xs:element name="pageNumber" type="xs:int"/> 
<xs:element name="recordsPerPage" type="xs:int"/> 
</xs:sequence> 
</xs:complexType> 
<xs:complexType name="returnMerchantsCardsListResponse"> 
<xs:sequence> 
<xs:element maxOccurs="unbounded" minOccurs="0" name="return" type="ns1:stringArray"/> 
</xs:sequence> 
</xs:complexType> 
</xs:schema> 
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://jaxb.dev.java.net/array" version="1.0"> 
<xs:complexType final="#all" name="stringArray"> 
<xs:sequence> 
<xs:element maxOccurs="unbounded" minOccurs="0" name="item" nillable="true" type="xs:string"/> 
</xs:sequence> 
</xs:complexType> 
</xs:schema> 
</wsdl:types> 
<wsdl:message name="returnMerchantsCardsList"> 
<wsdl:part element="tns:returnMerchantsCardsList" name="parameters"></wsdl:part> 
</wsdl:message> 
<wsdl:message name="returnMerchantsCardsListResponse"> 
<wsdl:part element="tns:returnMerchantsCardsListResponse" name="parameters"></wsdl:part> 
</wsdl:message> 
<wsdl:portType name="GetMerchantsCardsListInterface"> 
<wsdl:operation name="returnMerchantsCardsList"> 
<wsdl:input message="tns:returnMerchantsCardsList" name="returnMerchantsCardsList"></wsdl:input> 
<wsdl:output message="tns:returnMerchantsCardsListResponse" name="returnMerchantsCardsListResponse"></wsdl:output> 
</wsdl:operation> 
</wsdl:portType> 
<wsdl:binding name="GetMerchantsCardsList4SoapBinding" type="tns:GetMerchantsCardsListInterface"> 
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> 
<wsdl:operation name="returnMerchantsCardsList"> 
<soap:operation soapAction="" style="document"/> 
<wsdl:input name="returnMerchantsCardsList"> 
<soap:body use="literal"/> 
</wsdl:input> 
<wsdl:output name="returnMerchantsCardsListResponse"> 
<soap:body use="literal"/> 
</wsdl:output> 
</wsdl:operation> 
</wsdl:binding> 
<wsdl:service name="GetMerchantsCardsList4"> 
<wsdl:port binding="tns:GetMerchantsCardsList4SoapBinding" name="GetMerchantsCardsList4Port"> 
<soap:address location="http://localhost:8080/webservices/test/SrvGetmerchantsCardsList.jsp"/> 
</wsdl:port> 
</wsdl:service> 
</wsdl:definitions> 

我使用的soapUI進行測試。這是生成的請求時,我使用的soapUI:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:shop="http://shoppingcart.abcd.com/"> 
    <soapenv:Header/> 
    <soapenv:Body><shop:returnMerchantsCardsList> 
     <pageNumber>1</pageNumber> 
     <recordsPerPage>4</recordsPerPage> 
     </shop:returnMerchantsCardsList> 
    </soapenv:Body> 
</soapenv:Envelope> 

這是我收到的時候我請求提交到指定端點URL首次迴應:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> 
    <soap:Body> 
     <ns2:returnMerchantsCardsListResponse xmlns:ns2="http://shoppingcart.abcd.com/"> 
     <return> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
     </return> 
     <return> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item>3</item> 
      <item>Borders</item> 
      <item>224</item> 
      <item>jhgsjhdgjshgjjshsj</item> 
      <item>25.00</item> 
      <item>ord_mall.jpg</item> 
     </return> 
     <return> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item>5</item> 
      <item>Gap</item> 
      <item>210</item> 
      <item>jhgsjhdgjshgjjshsj</item> 
      <item>25.00</item> 
      <item>land_mall.jpg</item> 
     </return> 
     <return> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item>6</item> 
      <item>Fandango</item> 
      <item>211</item> 
      <item>asd78723642h36</item> 
      <item>25.00</item> 
      <item>game_mall.jpg</item> 
     </return> 
     <return> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item>8</item> 
      <item>AMC Theaters</item> 
      <item>212</item> 
      <item>jhgsjhdgjshgjjshsj</item> 
      <item>25.00</item> 
      <item>game_mall.jpg</item> 
     </return> 
     <return> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item>9</item> 
      <item>Macy{#}s</item> 
      <item>214</item> 
      <item>jhgsjhdgjshgjjshsj</item> 
      <item>25.00</item> 
      <item>mac_mall.jpg</item> 
     </return> 
     <return> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item>10</item> 
      <item>i-Tunes</item> 
      <item>215</item> 
      <item>jhgsjhdgjshgjjshsj</item> 
      <item>25.00</item> 
      <item>mac_mall.jpg</item> 
     </return> 
     </ns2:returnMerchantsCardsListResponse> 
    </soap:Body> 
</soap:Envelope> 

然而,當我再次重新提交申請得到如下回應,每次我提出要求:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> 
    <soap:Body> 
     <ns2:returnMerchantsCardsListResponse xmlns:ns2="http://shoppingcart.abcd.com/"> 
     <return> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
     </return> 
     <return> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
     </return> 
     <return> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
     </return> 
     <return> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
     </return> 
     <return> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
     </return> 
     <return> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
     </return> 
     <return> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
      <item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 
     </return> 
     </ns2:returnMerchantsCardsListResponse> 
    </soap:Body> 
</soap:Envelope> 

其實我期待同樣的反應,當我提出第一次請求。但不知怎的,每次我提交請求時,我都會得到上面的回覆,但沒有任何數據。如何擺脫這一點?

謝謝。

+0

我的問題或多或少得到解決。問題出在我的Java類中,其中有類級變量。我改變了它,並使其成爲方法級變量,現在我得到了預期的結果。 謝謝。 – waprau

回答

1

我的問題解決了。問題是變量,對象被聲明的地方。早些時候,我在課堂上宣佈了這些變量,對象。我更改並聲明瞭方法中的變量和對象,並且它工作正常。

謝謝。

+0

如果您願意,您可以將自己的答案標記爲「已回答」並獲得一些積分。 – xpda

+0

@xpda:當然,我會這樣做的。我想我必須等到明天,直到我點擊接受答案時,我纔會收到消息 - 「明天你可以接受你自己的答案」。謝謝。 – waprau

相關問題