Hello there
I'm trying to capture category and category properties using SOAP services.
I'm successfully pulling a category.
However, I'm having trouble pulling category properties.
When I try to pull it using HttpWebRequest, the xml list comes up smoothly.
The pattern of the sample incoming list is as follows;
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Header/><env:Body><ns3:GetCategoryAttributesResponse xmlns:ns3="http://www.n11.com/ws/schemas"><result><status>success</status></result><category><metadata><currentPage>1</currentPage><pageSize>100</pageSize><totalCount>2695</totalCount><pageCount>27</pageCount></metadata><attributeList><attribute><id>354189900</id><mandatory>true</mandatory><multipleSelect>false</multipleSelect><name>Marka</name><priority>4.0</priority><valueList><value><id>7915478</id><name>Axcess</name></value><value><id>7565492</id><name>Micro Genius</name></value><value><id>7561463</id><name>Microsoft</name></value><value><id>7561464</id><name>Nintendo</name></value><value><id>7561461</id><name>Sony</name></value><value><id>7561465</id><name>Square Enix</name></value><value><id>7918563</id><name>Thrustmaster</name></value></valueList></attribute><attribute><id>354189900</id><mandatory>true</mandatory><multipleSelect>false</multipleSelect><name>Marka</name><priority>4.0</priority><valueList><value><id>7915478</id><name>Axcess</name></value><value><id>7565492</id><name>Micro Genius</name></value><value><id>7561463</id><name>Microsoft</name></value><value><id>7561464</id><name>Nintendo</name></value><value><id>7561461</id><name>Sony</name></value><value><id>7561465</id><name>Square Enix</name></value><value><id>7918563</id><name>Thrustmaster</name></value></valueList></attribute></attributeList><id>1002306</id><name>Video Oyun & Konsol</name></category></ns3:GetCategoryAttributesResponse></env:Body></env:Envelope>
I need to loop through the attribute data in attributeList.
For this, I use the following codes;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
N11Kategori.GetCategoryAttributesRequest request = new N11Kategori.GetCategoryAttributesRequest();
request.auth = new N11Kategori.Authentication();
request.auth.appKey = "test";
request.auth.appSecret = "test";
request.categoryId = "12345";
request.pagingData = new N11Kategori.RequestPagingData();
request.pagingData.currentPage = 1;
request.pagingData.pageSize = 100;
N11Kategori.CategoryServicePortClient client = new N11Kategori.CategoryServicePortClient();
N11Kategori.GetCategoryAttributesResponse response = client.GetCategoryAttributes(request);
foreach(var item in response.category.attributeList.attribute)
{
<div>@item.name</div>
}I get this error: Exception message: c:\inetpub\vhosts\kobikur.net\httpdocs\Yonetim\N11.cshtml(1098): error CS1061: 'System.Array' does not contain a definition for 'attribute' and no extension method 'attribute' accepting a first argument of type 'System.Array' could be found (are you missing a using directive or an assembly reference?)
I passed it to the service owner. They told me there was nothing wrong with their services.
Also; They wanted me to try adding the following code to the .wsdl file under the xs: sequence element.
<xs:sequence>
<xs:element maxOccurs="unbounded"/>
<xs:sequence>
<xs:attribute name="tmp" type="xs:string" /> <--- ADD
After doing what was said the system gave another error.
Error : Object reference not set to an instance of an object.
I can't overcome the problem.
I ask for your help