Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 3 of 3
Api & .Net
 
brendanb
Mentor
 
Total Posts:  1093
Joined:  2008-07-16
London, United Kingdom
 

ok, fixed the above error by modifying my my.cnf settings. Specically the max_allowed_packet and the wait_timeout values

but..

when i try the following

Product[] myProducts MagentoApi.Product.List(apiUrlsessionId, new object[] { });

i now get the following error
Response from server does not contain valid XML.

 
Magento Community Magento Community
Magento Community
Magento Community
 
miliscent
Member
 
Avatar
Total Posts:  45
Joined:  2009-03-11
Pittsburgh, Pennsylvania USA
 

Try using a filter that selects all products where product id is greater than 0 like this:

filterParams.Add("gt""0");
filterOn.Add("entity_id"filterParams);
 
Magento Community Magento Community
Magento Community
Magento Community
 
brendanb
Mentor
 
Total Posts:  1093
Joined:  2008-07-16
London, United Kingdom
 

thanks,
i have tried what you suggested but kept getting errors. Then i took another approach

filterParams.Add("from""1")
        
filterParams.Add("to""450")
        
filterOn.Add("entity_id"filterParams)

now intertestingly when i up the size of the set to 500 i get the error.
So i then modfied my my.cnf and this fixed the issue temporarily as i can now query upto 500 records but no more.
I think i need to work on finding the right balance of memory to be used.

only running a server with 512mb ram atm

 
Magento Community Magento Community
Magento Community
Magento Community
 
WhIteSidE
Jr. Member
 
Total Posts:  5
Joined:  2009-03-10
 

1) miliscent: You guys should be sainted. I don’t know where you are, but I’ll be at the San Francisco meetup next week, and I’d love to discuss .NET and magento.

2) brendan: If all else fails write a loop that gets (say) 400 objects at a time. This isn’t ideal, but it’s a start.

 
Magento Community Magento Community
Magento Community
Magento Community
 
brendanb
Mentor
 
Total Posts:  1093
Joined:  2008-07-16
London, United Kingdom
 

hey whiteside,

yeah, thats what ive sort of done. its not ideal but its ok.
i think the root cause is the lack of ram on the server. Something that can be resolved

cheers
brendan

 
Magento Community Magento Community
Magento Community
Magento Community
 
miliscent
Member
 
Avatar
Total Posts:  45
Joined:  2009-03-11
Pittsburgh, Pennsylvania USA
 

Thank you for the kind words whitside smile We are in Pittsburgh, PA.  I’m not sure if we’ll be at the event, but with everything going on, probably not.  But if you’re ever in Pittsburgh, stop by our offices and chat.

hey brendan, approximately how many products are in your store?

 
Magento Community Magento Community
Magento Community
Magento Community
 
brendanb
Mentor
 
Total Posts:  1093
Joined:  2008-07-16
London, United Kingdom
 

Hi,

about 4000~

Id like to return all records and then just use a grid to filter.

ATM, im just applying a filter then issuing the query to get a subset of products.

I can now insert/delete and update records except that im hittin an issue.

For example.
Just say i issue and update, but the arguments i send are to only update the product “name” field. As shown below

Dim updateProduct As New clsMagentoProduct()
        
updateProduct.name "Here is my New Name"
        
updateProduct.sku "1234567890"
        
Dim wasProductUpdated As Boolean
        wasProductUpdated 
clsMagentoProduct.Update(apiURLstrAPISessionID, New Object() {updateProduct.skuupdateProduct})

I get the following error.
Attempt to serialize data containing null reference

Looking into this i can see that the reason i get this error is because a property (description) has been initialized, but has nothing returned.
so for example description as shown below in code.
I didnt want to update this field, but the property was accessed when i stepped through the code.

Public Property description() As String
        Get
            
Return _description
        End Get
        Set
(ByVal value As String)
            
_description value
        End Set
    End Property

Ive tried to seting string.empty on the property, but that just sends/overwrites the field value with a empty value/null. This does stop my error, but it also isnt the desire result.

how can i stop/get around properties being initialized and not used? Maybee im not using the correct terminolgy for VB..

cheers
Brendan

 
Magento Community Magento Community
Magento Community
Magento Community
 
miliscent
Member
 
Avatar
Total Posts:  45
Joined:  2009-03-11
Pittsburgh, Pennsylvania USA
 

Do you have this attribute above your class? 

[XmlRpcMissingMapping(MappingAction.Ignore)]
public class Product
{
 
Magento Community Magento Community
Magento Community
Magento Community
 
brendanb
Mentor
 
Total Posts:  1093
Joined:  2008-07-16
London, United Kingdom
 

genius!

thank you!

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 3 of 3