Complex Type Missing Members In VS2005-Generated WSDL

I was working on a web service method today in Visual Studio 2005 (.net 2.0). The return type contained an array of another type, let say X. I was using the lazy let-.net-create-the-wsld-for-me method. When I looked at the generated WSDL, the type X had no members and the sample XML that the auto-generated web page showed just had <X />. There were actually 10 or so memebers. I had flagged the class serializable. Turns out, if you don’t implement a property set, the property gets silently ignored for serialization. I guess that makes sense??

Advertisements

4 Responses to “Complex Type Missing Members In VS2005-Generated WSDL”

  1. Terence Says:

    I was puzzled by this too! Thans for sharing your findings.
    And it definately does no make sense!

  2. Jason Penniman Says:

    Makes perfect sense. The serializer uses reflection to iterate over and SET/get the properties. If there is no setter, the serializer cannot set them.

  3. Anz Says:

    I had tried the code which you had provided, as

    $client = new SoapClient(
    “http://www.thomas-bayer.com/names-service/soap?wsdl”
    ,array(“trace” => 1, “exceptions” => 0)
    );

    $functions = $client->__getFunctions();
    print_r($functions);
    $types = $client->__getTypes();
    print_r($types);

    $response = $client->getNameInfo(“John”);
    print “”;
    print_r($response);

    The out put displays exeption

    Array ( [0] => getCountriesResponse getCountries(getCountries $parameters) [1] => getNamesInCountryResponse getNamesInCountry(getNamesInCountry $parameters) [2] => getNameInfoResponse getNameInfo(getNameInfo $parameters) ) Array ( [0] => struct getNameInfo { string name; } [1] => struct getNameInfoResponse { nameInfo nameinfo; } [2] => struct nameInfo { string name; string gender; boolean male; boolean female; countries countries; } [3] => struct countries { string country; } [4] => struct getNamesInCountry { string country; } [5] => struct getNamesInCountryResponse { string name; } [6] => struct getCountries { } [7] => struct getCountriesResponse { string country; } )

    SoapFault Object ( [message:protected] => java.lang.NullPointerException [string:private] => [code:protected] => 0 [file:protected] => C:\wamp\www\travel\newtest.php [line:protected] => 14 [trace:private] => Array ( [0] => Array ( [function] => __call [class] => SoapClient [type] => -> [args] => Array ( [0] => getNameInfo [1] => Array ( [0] => John ) ) ) [1] => Array ( [file] => C:\wamp\www\travel\newtest.php [line] => 14 [function] => getNameInfo [class] => SoapClient [type] => -> [args] => Array ( [0] => John ) ) ) [faultstring] => java.lang.NullPointerException [faultcode] => S:Server [detail] => stdClass Object ( [exception] => stdClass Object ( [stackTrace] => stdClass Object ( [frame] => Array ( [0] => [1] => [2] => [3] => [4] => [5] => [6] => [7] => [8] => [9] => [10] => [11] => [12] => [13] => [14] => [15] => [16] => [17] => [18] => [19] => [20] => [21] => [22] => [23] => [24] => [25] => [26] => [27] => [28] => [29] => [30] => [31] => [32] => [33] => ) ) ) ) )

    Whats wrong here, pls reply

  4. jopincar Says:

    Anz, you posted this comment on the wrong article it seems. And the answer to your question is in the article I wrote on PHP web services client: https://jopinblog.wordpress.com/2007/10/31/php-5-web-service-client/


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: