SchemaImporterExtension does not work after upgrade to v3.1

Posts   
 
    
hotchill avatar
hotchill
User
Posts: 180
Joined: 22-Jan-2007
# Posted on: 25-Jul-2011 01:08:17   

Hi.

My problem is that entity classes are generated as System.Data.DataSet in the proxy class.

I have setup the schema importer project with debugging using external program: C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\wsdl.exe and command arguments: /language:CS /n:"NetConnect.Project.ControlPanel" httpdisappointed /localhost:1000/_vti_adm/NetConnect/SharePointBroker.asmx?wsdl

My breakpoint in the llblgen designer generated ImportSchemaType method is hit, but not for the entity classes (name parameter):

public override string ImportSchemaType(string name, string ns, XmlSchemaObject context, XmlSchemas schemas, XmlSchemaImporter importer, 
            CodeCompileUnit compileUnit, CodeNamespace mainNamespace, CodeGenerationOptions options, CodeDomProvider codeProvider)
        {
            if (ns.Equals("http://NetConnect.Project.ControlPanel.Data/xml/serialization"))
            {
                switch (name)
                {
                    #region Entity Classes              

                    case "ActionEntity":
                        compileUnit.ReferencedAssemblies.Add("NetConnect.Project.ControlPanel.Data.dll");
                        mainNamespace.Imports.Add(new CodeNamespaceImport("NetConnect.Project.ControlPanel.Data.EntityClasses"));
                        return "NetConnect.Project.ControlPanel.Data.EntityClasses.ActionEntity";

I have also upgraded to visual studio 2010, but I don't think that has anything to do with it.

I have one more SchemaImporterExtension class where I added the following:

public override string ImportSchemaType(string name, string ns, XmlSchemaObject context, XmlSchemas schemas, XmlSchemaImporter importer,
            CodeCompileUnit compileUnit, CodeNamespace mainNamespace, CodeGenerationOptions options, CodeDomProvider codeProvider) {
            if (ns.Equals("http://netconnect.com/billing") || ns.Equals("http://www.netconnect.com/project/ControlPanel")) {
                switch (name) {

                    case "ArrayOfActionEntity":
                        compileUnit.ReferencedAssemblies.Add("NetConnect.Project.ControlPanel.Data.dll");
                        mainNamespace.Imports.Add(new CodeNamespaceImport("NetConnect.Project.ControlPanel.Data.EntityClasses"));
                        return "NetConnect.Project.ControlPanel.Data.EntityClasses.ActionEntity[]";

This is currently hit and generates correct proxy code. It was necessary after upgrade to correctly generate for use of List<ActionEntity> in the web service interface.

Any ideas?

Thanks, Tore.

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 25-Jul-2011 09:33:16   

Have you followed the exact steps mentioned in the manual to generate the schemaImporter project and the WebServiceHelper class?

hotchill avatar
hotchill
User
Posts: 180
Joined: 22-Jan-2007
# Posted on: 25-Jul-2011 12:31:29   

I did not revisit the schema import after upgrade. I now see that the web service helper class was not generated. I tought I was using the same preset definition file as on 2.6, but I realize that was not the case. The converted project file may have remembered the name of the custom preset file used on v2.6 and created a new one with that name on first code generate. Of course I should've done my customizations on that.

Anyway, now it works. Thanks for the push.

Best, Tore.