PHP array to C# List -
after submitting form in php application store values in array this
if(isset($_post['submitarticle'])) { $artikel = $_post['article']; $aantal = $_post['quantity']; $a=0; $art = array(); $quan = array(); foreach($artikel $key => $value) { $art[] = $artikel[$a]; $quan[] = $aantal[$a]; $a++; } $artikelarguments = array_combine($art, $quan); now call method in c# application new array argument:
$client->getarticle($artikelarguments); my method in c# looks this:
public list<string> getarticle(list<keyvaluepair<int, int>> articles) { //get articles based on id foreach (keyvaluepair<int, int> art in articles) { now articles null, values won't passed, or c# can't handle php array. have suggestions?
fatal error: uncaught soapfault exception: [a:internalservicefault]
i saw didnt proper answer. issue used objects instead of integers , worked fine.
Comments
Post a Comment