-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
C# - magento 2.0.2 - error deserialsing SOAP call salesInvoiceRepositoryV1GetList #3605
Comments
found the culprits the 3 properties being returned are null, baseShippingDiscountTaxCompensationAmnt the datatype is a float not nullable float data type, so either don't return the property in the soap xml if there is no value, please fix this in the next version release |
Created internal bug ( MAGETWO-50026 ) to track. Flagged architect to ensure we behave consistently with other services for this scenario. |
add a few more to the list, these return and fails deserailsation baseDiscountTaxCompensationInvoiced |
do we have some sort of idea when this will be fixed and which release will have the fix? |
I am also having similar problem "Error in deserializing body of reply message for operation 'catalogProductRepositoryV1Get' " magento version 2.0.4. How do i fix this? could someone please help with this. |
any ideas if this will be patch up in the next release? |
could we get some updates regarding this bug? this should of been resolved for all people who wanting to use soap integration with other applications/services, but we can't cause of the serialization... |
Now I gone back to 1.9 and the main reason being not able to use the soap. |
just testet this example for baseShippingDiscountTaxCompensationAmnt. To ensure that the correct type is returned it is mandatory to type cast the value when it is retrieved from the data model. I think this has to be added in many places but is quite easy to fix. type casting this to float results in 0 beeing returned instead of null which shoul solve the problem |
ok, the problem simply seems to be, that null is never type casted here: https://github.com/magento/magento2/blob/develop/lib/internal/Magento/Framework/Reflection/TypeCaster.php#L25 This is a Problem in languages with strict types since the scalar types are not allowed to be null, instead they have to be casted to "", 0 or 0.0 for example |
Hello @lindows-xx, this issue has been fixed in the 2.1.0 Release, that's why I'm closing it. If you have any questions or additional information regarding the issue feel free to reopen it or create a new one. |
Sorry for the confusion, we double checked, and unfortunately this issue didn't go to the 2.1.0 release, it will come to the next possible release. |
any ideas of when the next release will be? |
…ly type cast #3605 - add check to API tests
bump for updates? |
…ly type cast magento#3605 - add check to API tests
The fix has been provided as a part of 2.0.9 release. |
@davidverholen now that field is declared as |
@SerhiyShkolyarenko the fix you had just implemented, is it out in 2.1.1 or it will be in the next release? |
@manhao-chen I figured out that the fix is not included in 2.1.1 release. As far as it's present on develop branch, it will be a part of the following release. |
I am closing the issue on github now as far as the fix is delivered to develop branch, but feel free to leave comments if it won't work for you after update. Thank you for collaboration! |
@SerhiyShkolyarenko i will test the next release and report back |
@SerhiyShkolyarenko the problem is, that in strict typed languages, null is not allowed for float. It's not possible to define a value as float or null when you create a WSDL. Even in php with strict mode enabled a float value must not be null. Here is an example (for php7) with strict mode enabled <?php
declare(strict_types=1);
function returnFloat() : float
{
return null;
}
var_dump(returnFloat()); This throws an error since the function is not allowed to return null when strict typed to float. So when you create a SOAP Client in strict typed languages and a field typed as float is null, this throws an error. |
@davidverholen AFAIK C# supports nullable double. https://msdn.microsoft.com/en-us/library/2cf62fcy.aspx |
@SerhiyShkolyarenko the problem is when the wsdl is generated, would the property datatype be in c# double |
the point is, wsdl definition does not support null for float types and yet there are null values in fields that are of type float Only supported non numeric values are INF, -INF, and NaN http://books.xmlschemata.org/relaxng/ch19-77095.html |
Reopened issue to clarify compatibility. |
Hi, I'm getting the same issue when using Mage 2.1.1 catalogProductRepositoryV1Get to pull a product down to Visual Studio via WSDL SOAP. The pull worked fine then stopped working all of a sudden. Tracked it down to the Quantity against the product being "empty". Set the Qty to 0 and it started working. #davidverholen is correct in that the system is returning non-standard acceptable data. The nullable float in C# is technically a different type to float, it's effectively a wrapper around float. Edit: Also causing issues in catalogProductRepositoryV1Save. As the returned object doesn't have its quantity set it causes the method to throw a deserilization error. |
Internal issue for investigation(and fixing) is MAGETWO-59017. |
is there any idea as to when this will be fixed? |
In addition to the fields mentioned above, we've experienced issues with In Casting to |
I solved issue exposed by @epson121 editing the file History.php in /vendor/magento/module-sales/Model/Order/Status I have modified the following function:
|
I'm closing this report as the issue has been fixed. |
TSG-CSL3] For 2.2 (pr18)
Hi, I'm getting the same issue when using Mage 2.3.4 for SalesOrderRepositoryV1GetList |
I checked and salesInvoiceRepositoryV1GetList works fine but the same issue with SalesOrderRepositoryV1GetList on 2.3.4 |
details here
https://community.magento.com/t5/Programming-Questions/C-magento-2-0-2-error-deserialsing-SOAP-call/m-p/30859
Release: 2.0.2 Community Version.
writing a service by adding the magento soap url as a service reference,
when calling the salesInvoiceRepositoryV1GetList i get an error with the framework tries to deserialise the data
Error in deserializing body of reply message for operation 'salesInvoiceRepositoryV1GetList'.
fiddler returns the data correctly, but unable to deserialize
The text was updated successfully, but these errors were encountered: