本文整理匯總了Java中com.amazonservices.mws.client.MwsObject類的典型用法代碼示例。如果您正苦於以下問題:Java MwsObject類的具體用法?Java MwsObject怎麽用?Java MwsObject使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
MwsObject類屬於com.amazonservices.mws.client包,在下文中一共展示了MwsObject類的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: newResponse
import com.amazonservices.mws.client.MwsObject; //導入依賴的package包/類
/**
* Create a new response object.
*
* @param cls
*
* @return The object.
*/
private <T extends MwsObject> T newResponse(
Class<T> cls) {
InputStream is = null;
try {
is = this.getClass().getResourceAsStream(cls.getSimpleName()+".xml");
MwsXmlReader reader = new MwsXmlReader(is);
T obj = cls.newInstance();
obj.readFragmentFrom(reader);
ResponseHeaderMetadata rhmd = new ResponseHeaderMetadata(
"mockRequestId", Arrays.asList("A","B","C"), "mockTimestamp", 0d, 0d, new Date());
cls.getMethod("setResponseHeaderMetadata", rhmd.getClass()).invoke(obj, rhmd);
return obj;
} catch (Exception e) {
throw MwsUtl.wrap(e);
} finally {
MwsUtl.close(is);
}
}
開發者ID:trifonnt,項目名稱:ext-lib-amazon-mws-fulfillment-inbound-shipment,代碼行數:26,代碼來源:FBAInboundServiceMWSMock.java