Мне нужна помощь с использованием инструмента SoapUI.
Я тестирую API веб-сервисов с помощью этого инструмента.
Существует 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>
запрос 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>
когда я нажимаю на RUN, указывая дату в запросе, это ответ
<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>
Как мне указать параметр <datasources> в этом XML-запросе для получения желаемого ответа?
Пожалуйста, помогите мне с этим
-Kiran
<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>
Вы должны указать дату
<startDate xsi:type="xsd:string">?</startDate>
требуется в запросе, формат даты, я не знаю, как он определен, потому что это строковый тип, а не тип даты.
Попробуйте с yyyy/MM/dd, это тип формата даты.
yyyy/MM/dd
Вы никогда не хотите отправить запрос с? заполнители. Отредактируйте запрос, чтобы были актуальные данные.