Is there a way to check whether a product already exists in Magento using the SOAP API that doesn't require using exception handling for the control flow?
I have the following code that works, but I wouldn't say it follows best practices.
Dim productExists As Boolean
Try
Dim webService As MagentoService = New MagentoWS.MagentoService
Dim productInfo As catalogProductReturnEntity = webService.catalogProductInfo(sSessionId, sku, String.Empty, Nothing, "sku")
productExists = True
Catch ex As SoapHeaderException
productExists = False
End Try
I have to catch the SoapHeaderException and then use the fact that the exception was thrown to know that the product doesn't exist.