Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 745367
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T09:05:12+00:00 2026-05-14T09:05:12+00:00

I have a SOAP service that returns an array of a complex type. The

  • 0

I have a SOAP service that returns an array of a complex type. The definition in NuSOAP in PHP looks like this:

// The type itself
$server->wsdl->addComplexType(
    "Clip",
    "complexType",
    "struct",
    "all",
    "",
    array(
      "Id" => array(
        "name" => "id",
        "type" => "xsd:int"
      )
      // ---snip---
    )
  );

// The type of the array
$server->wsdl->addComplexType(
    "ClipList",
    "complexType",
    "array",
    "sequence",
    "",
    array(
      "clip" => array(
        "name"      => "clip",
        "type"      => "tns:Clip",
        "minOccurs" => "0",
        "maxOccurs" => "unbounded"
      )
    ),
    array(),
    "tns:Clip"
  );

  // The service
  $server->register(
    "GetClipList",
    array(),
    array(
      "clips" => "tns:ClipList"
    ),
    "urn:MyNamespace",
    "urn:MyNamespace#GetClipList",
    "rpc",
    "encoded",
    "Retrieves a list of all clips."
  );

Now in my VisualStudio2010 C# project I added a new service based on the generated WSDL. VS created a proxy class for me to use which contains a class ClipList which has a single data member of type Clip[].

So far so good. Now when I call GetClipList() on my proxy I get a CommunicationException telling me that it cannot assign an object of type Clip[] to an object of type ClipList.

So I am assuming it deserialized the returned data into a Clip[] and now wants to satisfy the return type of the GetClipList method (which would be ClipList).

When changing the return value of GetClipList() in the proxy to Clip[] manually, the application runs fine. But I want to avoid changing the auto-generated class for obvious reasons.

So, why does it not instantiate a ClipList and fill the data member? Or alternatively, why doesn’t VS generate the proxy class so that GetClipList directly returns a Clip[].

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T09:05:12+00:00Added an answer on May 14, 2026 at 9:05 am

    After reading through parts of the W3C SOAP standard once more I came up with this definition for the Clip array:

    $server->wsdl->addComplexType(
      "ArrayOfClip",
      "complexType",
      "array",
      "sequence",
      "SOAP-ENC:Array",
      array(),
      array(
        array(
          "ref"            => "SOAP-ENC:arrayType",
          "wsdl:arrayType" => "tns:Clip[]",
          "minOccurs"      => "0",
          "maxOccurs"      => "unbounded"
        )
      ),
      "tns:Clip"
    );
    

    I actually had a definition like that already commented out in my source as earlier tests with wsdl.exe and vscutil.exe didn’t seem to agree with it. The integrated service import in VisualStudio however seems to require this definition.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.