Closed Ramzzzz closed 7 years ago
@Ramzzzz Wouldn't it be easier to use the Rest Api instead?
No, actually, it is much easier to use SOAP, as it exposes required classes through proxy :) Anyway, I updated to Magento ver 2.1.6. Currently, I don't see any more error related to xml deserialization.
@Ramzzzz You're the first php dev I've come across that actually likes SOAP lol. I've always hated it, annoying to work with in code.
The topic implies he's not a php dev, actually =D
SOAP API calls from C#.Net
Higher-level languages like C# and java actually allow you to generate a bunch of proxy classes based purely on WSDL, including the all the methods, parameters expected etc. which saves a lot of time. REST doesn't have any kind of uniform schema and thus it's not enough to provide a single endpoint: you'll need to manually each of the exact endpoints for every API method you use.
@korostii I thought he's a php dev lolz Personally I prefer C# over Java. While we're totally off topic, you think the open source dot Net will take over php someday? https://github.com/dotnet/core
Well, as a language, PHP has its disadvantages, but most of the time it's just enough to fulfill the task at hand. And there are multiple forces at hand and most of the time business constraints and available libraries\frameworks etc. play a bigger role than the perks language has.
For example, it's been years and there are still some COBOL and Delphi apps used here and there, sometimes it's just much cheaper to support and old but well tested application rather than throw it away and re-implement it from scratch.
PHP has well grown into its niche, and it's a large one. Sure, parts of the web will get overtaken by different players, but, to be honest, I don't think PHP will get completely replaced anytime soon.
Hi @Ramzzzz could you please let us know if the issue still exists on latest 2.2.0 release?
Nope.. issue doesn't exist anymore in 2.2.0 release. Thanks.
Trying to consume Magento 2.0 SOAP in C# using visual studio 2013. Soap Url: http://localhost:85/Magento-Siemens/soap/default?services=catalogProductRepositoryV1 Error: Error in deserializing body of reply message for operation 'catalogProductRepositoryV1Get'
Code: var proxy= new catalogProductRepositoryV1PortTypeClient(); var response = new CatalogProductRepositoryV1GetResponse(); var request = new CatalogProductRepositoryV1GetRequest { sku = "ABC", editMode = false, editModeSpecified = true, forceReload = true, forceReloadSpecified = true, storeId = 0, storeIdSpecified = true }; using (var scope = new OperationContextScope(proxy.InnerChannel)) { try { var httpRequestProperty = new HttpRequestMessageProperty(); httpRequestProperty.Headers[System.Net.HttpRequestHeader.Authorization] = "Bearer " + AccessToken; OperationContext.Current.OutgoingMessageProperties[HttpRequestMessageProperty.Name] = httpRequestProperty; response = proxy.catalogProductRepositoryV1Get(request); } catch (Exception ex) { var sd = ex.Message; } }
Error:
Client Config:
Help will be greatly appreciated. Thank You.