-1

How to keep the object returned by the web service as ArrayOfString ?

Contextualizing:

I'm giving maintenance in an application that consumes a Web Service, and a certain object would be a List<string> was being returned as ArrayOfString . Where did the Update in reference the WebService , the return moved to string[] what you can do to keep as ArrayOfString ?

It is returning as well :

private string[] motivoInterrupcaoField;

When should return this:

[System.Runtime.Serialization.OptionalFieldAttribute()] private Atendimento.wsAtendimento.ArrayOfString MotivoInterrupcaoField;

Thank you,

Erik Philips
  • 53,428
  • 11
  • 128
  • 150
Ivan Clay
  • 116
  • 3

1 Answers1

1

If your service method returns List<string> you will see this return value translated to an object of type ArrayOfString in the proxy. When your service method is designed to return string[] you will find string[] in the proxy.

If the return values for service methods have changed, client side, that implies the service contract has changed. If you don't control the contract there's not much you can do, except implement your own ArrayOfString class for use on the client (which, imo, shouldn't be all that hard to do).

Not a bad solution I think because it does imply that you simply adapt the client to the changes made to the service contract.

Captain Sensible
  • 4,946
  • 4
  • 36
  • 46