question

xinwei-1926 avatar image
0 Likes"
xinwei-1926 asked ·

How can I setDetailLevel of the API GetCategories,How to setDetailLevel of the interface GetCategories

 GetCategoriesRequestType categoriesRequestType = new GetCategoriesRequestType();
 categoriesRequestType.setViewAllNodes(true);
 DetailLevelCodeType[] detailLevels = new DetailLevelCodeType[] { DetailLevelCodeType.RETURN_ALL};
 categoriesRequestType.setDetailLevel(detailLevels);

the log print ‘

<S:Body>

<GetCategoriesRequest xmlns="urn:ebay:apis:eBLBaseComponents">

<Version>423</Version>

<ViewAllNodes>true</ViewAllNodes>

</GetCategoriesRequest>

</S:Body>

why???

,
  GetCategoriesRequestType getCategoriesRequestType = new GetCategoriesRequestType();
  getCategoriesRequestType.setViewAllNodes(true);
  DetailLevelCodeType[] detailLevels = new DetailLevelCodeType[] { DetailLevelCodeType.RETURN_ALL};
  getCategoriesRequestType.setDetailLevel(detailLevels);

but , the log print '

<S:Body>

<GetCategoriesRequest xmlns="urn:ebay:apis:eBLBaseComponents">

<Version>423</Version>

<ViewAllNodes>true</ViewAllNodes>

</GetCategoriesRequest>

</S:Body>

' after I executed ,why????who can tell me?

getcategoriessetdetaillevel
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
celle2006 avatar image
0 Likes"
celle2006 answered ·

Hi, I had the same Problem. Fixed it a few seconds ago:

GetCategoriesCall call = new GetCategoriesCall(APIContainer.getInstance().getApiContext());

call.addDetailLevel(DetailLevelCodeType.RETURN_ALL);

GetCategoriesResponseType resp = (GetCategoriesResponseType) call.execute(getCategoriesRequestType);


You need to add the Detailed Level to the API Call Object. Don't know why :-)

·
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.