2011-11-17 34 views
0

我需要一些使用SoapUI工具的幫助。如何在SoapUI工具的SOAP請求中指定複雜的數據類型輸入

我使用這個工具測試webServices APIs。

有稱爲API 「getUsageReport()」這需要2輸入參數

  • <datasources>類型的<akaaurdt:ArrayOfString>
  • <start date>類型的<xsd:string>

<akaaurdt:ArrayOfString>定義如下。

<complexType name="ArrayOfString"> 
    <complexContent> 
    <restriction base="soapenc:Array"> 
    <attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string[]" /> 
    </restriction> 
    </complexContent> 
</complexType> 

肥皂UI請求XML是如下

<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:bil="https://control.akamai.com/BillingReports.xsd" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"> 
    <soapenv:Header/> 
    <soapenv:Body> 
     <bil:getUsageReport soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> 
     <datasources xsi:type="bil:ArrayOfString" soapenc:arrayType="xsd:string[]"/> 
     <startDate xsi:type="xsd:string">?</startDate> 
     </bil:getUsageReport> 
    </soapenv:Body> 
</soapenv:Envelope> 

當我點擊通過在請求給予一個日期來看,這是響應

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 
    <soapenv:Body> 
     <soapenv:Fault> 
     <faultcode>soapenv:Server.generalException</faultcode> 
     <faultstring>akaaurdt:ApplicationError:ApplicationError:(?? No Data for Given Start Date. Please resubmit with a more recent date)</faultstring> 
     <detail> 
      <ns1:exceptionName xmlns:ns1="http://xml.apache.org/axis/">com.akamai.aws.util.AWSFault</ns1:exceptionName> 
      <ns2:hostname xmlns:ns2="http://xml.apache.org/axis/">qa-portal-ws01.qaextranet.akamai.com</ns2:hostname> 
     </detail> 
     </soapenv:Fault> 
    </soapenv:Body> 
</soapenv:Envelope> 

我如何在此請求xml中指定<datasources>參數以獲得所需的響應?

請幫我這個

-Kiran

回答

1

應指定日期

<startDate xsi:type="xsd:string">?</startDate> 

它需要在請求中,日期格式,我不知道它是怎麼定義的,因爲它是字符串類型,而不是日期類型。

試用yyyy/MM/dd,是日期格式類型。

+0

感謝的快速反應。我已經指定了實際的日期。但是文檔中提到該API有兩個輸入參數,命令爲''。但我無法給出其他輸入,即''。我需要 –

+0

這樣的幫助:'item xsi:type =「bil:ArrayOfString」> jdbc/resourceName jdbc/resourceName' –

+0

@Cristian ..以下哪項是正確的..請幫助我 \t \t 1-FO0A7 20110110

0

你永遠不想提交請求?佔位符。編輯請求,以便有實際的數據。

+0

@Chrish:嗨Chris .. nope ..我指定日期但面臨其他數據類型 –

+0

在我的肥皂問題請求我需要用實際的字符串數組替換這行''datasources xsi:type =「bil:ArrayOfString」soapenc:arrayType =「xsd:string []」>。你能幫我解決這個問題嗎? –

2
  1. 運行BillingReports的getReports(或getReportingGroups)。可以說,它返回一個名爲55555
  2. 運行方法getUsageReport contractCode,它應該如下所示:

<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:bil="https://control.akamai.com/BillingReports.xsd" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"> 
    <soapenv:Header/> 
    <soapenv:Body> 
     <bil:getUsageReport soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> 
     <datasources xsi:type="bil:ArrayOfString" soapenc:arrayType="xsd:string[]"> 
     <datasource xsi:type="xsd:string">55555</datasource> 
    </datasources> 
     <startDate xsi:type="xsd:string">20120620</startDate> 
     </bil:getUsageReport> 
    </soapenv:Body> 
</soapenv:Envelope>