4
votes

When trying to add a service reference to an existing WCF service (which is providing collections of type ObservableCollection) I get the following error message :

schema type 'http://schemas.microsoft.com/2003/10/Serialization/Arrays:ArrayOfString' has not been imported yet. Import it first.

I tried to change the Framework (in the Add Web Reference screen) to '.NET 2.0 Web Services'. In that case I don't get the above mentioned error message, however, I'm unable to call the several functions the WCF service provides (they are simply not generated).

Can anybody help me?

Thanks in advance.

Ernstjan

2
are you directly returning ObservableCollection<string> from your service method? - Yeonho

2 Answers

0
votes

Microsoft defines Arrays in the 'http://schemas.microsoft.com/2003/10/Serialization/Arrays' name space which non MS will have problems finding so define your "ArrayOfString" and serialize it:

[CollectionDataContract(ItemName = "string", Namespace = "SAME NAMESPACE AS YOUR PROJECT!!!")]

public class ArrayOfString : List<string>

{

}

And you should be alright then.

0
votes

That's a bug in Mono's WSDL Importer, which did not fully support collection types.

I just implemented this, so you'll see this in Monotouch shortly. As a temporary workaround, you need to create the client proxy on Windows using either Visual Studio or Svcutil.exe.