• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

.NET - Denormalize XML through Webservice.

WannaFly

Platinum Member
Due to project requirements, I need to send XML that represents a dataset to a webservice and have the web service denormalize it and put the data into a SQL server. I need to only have one web method, i cannot have more then one.

The hard part: the XML always varies, but it will ALWAYS exactly match the database structure. For example, one XML could use A and B table but the next could use C and D, or even A,C, and D. It always varies.

I've got a few ways in my head to do this, but none of them i'm happy with as i think there must be a better way, any ideas?
 
Why are you only allowed to use one web method? I guess you could slip the table name in your webservice query and then do a conditional check on your parser.
But seriously, it doesn't make any sense if you are only using one method... or maybe you need to redesign your tables.
 
Hmm, sounds like either a massive kludge or you're working on something that requires high performance throughput. But in that case why would you be sending XML over the wire? And why denormalize into a flattened database structure?

"One of these things does not belong here! One of these things is not the same!" 🙂
 
Tfinch: I'm just seeing if anyone had ideas/thoughts on how to handle this.

I only want to use one web method because the way the program is designed, with modules, which the shell actually sends the XML to the webservice and i dont want there to be a different webmethod for each module as modules will vary in each install.

Markbnj: Its not either really. I'm sending XML to the web service because its from a typed dataset, of which the webservice cannot reference the type(see above). Im not really "denormalizing" in the traditional sense, its going into all the normalized tables, but i need a way to get the XML into the database in each field thats defined in the file.
 
If its always a dataset then set the Webmethod to accept a generic dataset.

Then loop through the tables and build a SQL statement from each row of each table.

Of course I think this is a strange way to build an application as you can't guarantee your types, but everyone has their reasons.
 
Originally posted by: KB
If its always a dataset then set the Webmethod to accept a generic dataset.

Then loop through the tables and build a SQL statement from each row of each table.

Of course I think this is a strange way to build an application as you can't guarantee your types, but everyone has their reasons.

KB,
This would work but i dont know what tables are contained in the dataset as it will differ.

I know its strange, but this is what i need to do 🙁
 
Originally posted by: WannaFly
KB,
This would work but i dont know what tables are contained in the dataset as it will differ.
Did you read the code? The table names are stored in the dataset.
 
This would work but i dont know what tables are contained in the dataset as it will differ.

So, basically you need to take any random dataset that arrives at your interface, parse it out, and put it into the right tables in a database?

That's all? 😉
 
Back
Top