• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 259
  • Last Modified:

valid .net datatypes in webservice to be consumed by php

I am writing a .NET web service which is going to be consumed by php.

It's something like this:

[WebMethod]
public RegisterUserResponse RegisterUser(string DevToken, UserDetail User)
{
....
}

public class UserDetail {
public int?[] Beverages
    {
        get;
        set;
    }

public int? FindOutID
    {
        get;
        set;
    }
}

If I have properties defined as int? and int?[] - in php, will developers be able to pass int arrays and also null values ?
0
bLUE
Asked:
bLUE
1 Solution
 
Gagan_JauraCommented:
I believe you cannot pass null to int arrays in PHP. This facility is available in string or array only, and that to for PHP4 or greater. But yes you can pass null to int? but from the function e.g RegisterUser(<int array>, NULL).
I have a solution, make int?[] to string[] in the webservice. You can also pass null into string array from PHP.
0
 
bLUEAuthor Commented:
Thanks for your comment. helped a lot.. !
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now