SOAP 기반 웹 서비스를 실행하기 위해 가라테 API을 배우고 있습니다. 이를 위해 필자는 두 가지 XML 파일을 만들었습니다. 하나는 요청 정보이고 다른 하나는 응답 데이터입니다.공수를 사용하여 주어진 XML로 SOAP 서비스 XML 파일의 유효성을 검사하는 방법
그리고 나서 하나 더 파일을 만들었습니다 webservice.feature 파일이라고합니다.
이 기능 파일을 실행할 때 콘솔에서 다음 정보가 표시되지만 이해가되지 않으며 그 유효성을 검사하는 방법을 알지 못합니다. 제안을 해주십시오.
webservice.feature 파일 :
Feature: Get Membership Details
Background:
* url 'http://111.111.221.145:2201/Customer/ProxyServices/CustomerSummary_PS?wsdl'
Scenario: FunctionalTest
Given request read('getMbrWksMembershipSummaryRequest.xml')
And header Content-Type = 'application/soap+xml; charset=utf-8'
When method post
Then status 200
And match response customerSummary/address/city == read('getMbrWksMembershipSummaryResponse.xml')
And print 'response: ', response
요청 파일.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cus="http://www.abcdedf.com/services/customersummary" xmlns:con="http://www.abcdedf.com/services/customersummary/contract">
<soapenv:Header/>
<soapenv:Body>
<cus:getMbrWksMembershipDetails>
<!--Optional:-->
<cus:WksMembershipSummaryRequest>
<!--Optional:-->
<channel>CC</channel>
<!--Optional:-->
<consumerName>GUIDE_PORTAL</consumerName>
<level>0</level>
<!--Optional:-->
<locale>en_US</locale>
<!--Optional:-->
<productType>ExtraVacation</productType>
<!--Optional:-->
<requestId/>
<!--Optional:-->
<sessionId/>
<!--Optional:-->
<con:memberID>C05506493</con:memberID>
</cus:WksMembershipSummaryRequest>
</cus:getMbrWksMembershipDetails>
</soapenv:Body>
</soapenv:Envelope>
응답 파일 :
<ns2:customerSummary>
<ns2:address>
<ns2:city>SOUTH CHESTERFIELD</ns2:city>
<ns2:country>USA</ns2:country>
<ns2:isoCountryCode>US</ns2:isoCountryCode>
<ns2:line1>9998, N. MICHIGAN ROAD.</ns2:line1>
<ns2:postalCode>23834</ns2:postalCode>
<ns2:state>VA</ns2:state>
</ns2:address>
</ns2:customerSummary>
콘솔 출력 :
You can implement missing steps with the snippets below:
@Given("^url 'http://(\\d+)\\.(\\d+)\\.(\\d+)\\.(\\d+):(\\d+)/Customer/ProxyServices/CustomerSummary_PS\\?wsdl'$")
public void url_http_Customer_ProxyServices_CustomerSummary_PS_wsdl(int arg1, int arg2, int arg3, int arg4, int arg5) throws Throwable {
// Write code here that turns the phrase above into concrete actions
throw new PendingException();
}
@Given("^request read\\('getMbrWksMembershipSummaryRequest\\.xml'\\)$")...
덕분에
다음과 같은 스 니펫으로 누락 된 단계를 구현할 수 있습니다. @Given ("^ url 'http : // (\\ d +) \\. (\\ d +) \\. (\\ d +) \\.public void url_http_Customer_ProxyServices_CustomerSummary_PS_wsdl (int arg1, int arg2, int arg3, int arg4, int arg5) throws Throwable { // 쓰기 (예 : \ d +)/고객/프록시 서비스/고객/프록시 서비스/고객 서머리 _PS \\? wsdl '$ " 위의 구문을 구체적인 동작으로 바꾸는 코드는 new PendingException(); .......... – Karunagara
프로젝트 구조 자체가 잘못되어 보이는 것처럼 보이며 아무도 웹 서비스의 내용을 제공하지 않으면 도움을 줄 수 없습니다. . 특징. 당신은 여기에서 더 열심히 노력할 필요가 있습니다 : https://stackoverflow.com/help/mcve –
그래서 그것을 고쳐야합니까? – Karunagara