Üst Kategori Bilgileri (GetTopLevelCategories)

Üst Kategori Bilgileri (GetTopLevelCategories)

Kategori servisleri için WSDL adresi:

n11 üzerinde tanımlanmış tüm üst seviye kategorileri görmek için bu metot kullanılır. Cevap olarak n11 kategori kodu ve kategori adı döner.

GetTopLevelCategoriesRequest

auth Bkz: Yetkilendirme

*Bold alanlar zorunlu alanlardır.

GetTopLevelCategoriesResponse

categories.category.id Kategorinin n11 tarafındaki kodu
categories.category.name Kategori adı
result Bkz: Result

GetTopLevelCategories Örnek Çağrı

Request
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
    <env:Header/>
    <soapenv:Body>
        <sch:GetTopLevelCategoriesRequest>
            <auth>
                <appKey>***</appKey>
                <appSecret>***</appSecret>
            </auth>
        </sch:GetTopLevelCategoriesRequest>
    </soapenv:Body>
</soapenv:Envelope>
Response
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
    <env:Header/>
    <env:Body>
        <ns3:GetTopLevelCategoriesResponse xmlns:ns3="http://www.n11.com/ws/schemas">
            <result>
                <status>success</status>
            </result>
            <categories>
                <category>
                    <id>1</id>
                    <name>Kategori 1</name>
                </category>
                <category>
                    <id>2</id>
                    <name>Kategori 2</name>
                </category>
                <category>
                    <id>3</id>
                    <name>Kategori 3</name>
                </category>
                <category>
                    <id>4</id>
                    <name>Kategori 4</name>
                </category>
            </categories>
        </ns3:GetTopLevelCategoriesResponse>
    </env:Body>
</env:Envelope>
GetTopLevelCategories Örnek Çağrı (Java)
public static void main (String [] args )  {

    String strAppKey = "***";
    String strAppSecret = "***";

    Authentication authentication = new Authentication();
    authentication.setAppKey(strAppKey);
    authentication.setAppSecret(strAppSecret);

    GetTopLevelCategoriesRequest request = new GetTopLevelCategoriesRequest();
    request.setAuth(authentication);

    CategoryServicePort port = new CategoryServicePortService().getCategoryServicePortSoap11();
    GetTopLevelCategoriesResponse topTopLevelCategoriesResponse = port.getTopLevelCategories(request);
    List<SubCategory> categoryList = topTopLevelCategoriesResponse.getCategoryList().getCategory();

  }

Yetkilendirme (Authentication)

auth.appKey Servislere erişim için kullanılacak uygulama anahtarı
auth.appSecret Servislere erişim için kullanılacak uygulama şifresi

Sonuç Durum Bilgisi (Result)

result.status İşlem sonucu durum bilgisini gösterir. “success” ve “failure” durum bilgilerini döner.