????????????????
???????????? ???????[ 2013/5/20 11:29:10 ] ????????
????????????????????????????“??????”?????????ó?????????ó????????????Extract Class???????????????????????SOAPEndPoint????
public class SOAPEndPoint {
public String post(String soapAction?? String requestBody) {
PostMethod postMethod = getPostMethod(soapAction?? requestBody);
new HttpClient().executeMethod(postMethod);
String responseBody = postMethod.getResponseBodyAsString();
if (responseBodyAsString.contains("faultstring")) {
throw new WmbException();
}
return responseBody;
}
?????????????????????μ???
??// 1. prepare request body
String requestBody = renderTemplate(velocityContext?? templateName);
// 2. execute a post method and get back response body
// soapEndPoint is dependency injected by Spring Framework
String responseBody = soapEndPoint.post(soapAction?? requestBody);
// 3. deal with response body
Document document = parseResponse(responseBody);
return document;
????????????????????????????Moco??SOAPEndPoint??????????????????SOAPEndPoint?????????????????????????POST???????URL???????????????“faultstring”?????????????????????????????????????????“SOAPEndPoint”??post???????????????????????????????????SOAPЭ?飬????????????????????????????Moco???????SOAPЭ????????????????????????????“faultstring”?????????????????ɡ?
??????????????????post???????????????????????????????SOAPЭ?飬?????????SOAPEndPoint??????????????и??????????getPostMethod?????У?????????????ЩHTTP????????Щ?????????Web Services?????????????????ЩHTTP????????????ó????????????Content-Type????????????з?????????????????????getPostMethod?????С?
???????????????д?Щ??????????????????mock?????????“???SOAPEndPoint????”?????????????????????????????????????е????????????????????????????????????????????????????????????????????????????????????????????????????????????
????С??
????????????“?????”??JavaEE Web????????У???????????ж????????????????ù????????????????????????????????????????????????????????????????????????????????????????????Moco???????????????????????????????????????????????????????????
?????????????????????е??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????е??????????????????????????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11