Copying XML File Data to Database Table.

  • Hi All,

    Now in my application I am using a WebService, which will download the data as xml files from salesforce.com and store into my XMLFiles development folder.

    The design flow would be like this:

    ----------------------------------

    SalesForce.com --> Webservice

    --> Application folder (XMLFiles)/xml files

    Assume abc.xml file is placed in the following location:

    ----------------------------------------------------

    WebApplication --> XMLFiles --> abc.xml

    I have a stored procedure, which will take the path name to read the location of xml file exist and copy the xml data to respective table in the database.

    my problem is how to find the xml file location which is present in webserver application folder.??????:w00t:

    for example:

    lets in SMS web application, you have a image folder and u wants to specify the location, then u have to specify like this.

    "~/Image/abc.gif"

    so my problem is if a web Developer will send the location path like this then how can my procedure will recognize the location, I mean to say generally my procedures works or reading the file location from the local system, but I really confused, if my developer will pass a location in this format like :

    ---------------------------

    "~/XMLFile/abc.xml"

    ---------------------------

    then where my SP will search for the file????????:w00t:

    Please help me, if any other way it can possible????

    Cheer!

    Sandy.

    --

  • You've got a second problem as well, you need to make sure that you have the security settings to allow you access to that file. Once you've addressed that...

    Can they put the XML into a common space that you both have access to? If not, can you store the path to their drive in a field in your database and then go & get it? If not that, can they pass you the full path?

    Short answer, you have to have the full path to get to the file. In some fashion, put the path together & go get the file.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Hey Grant,

    I got your point,

    Let me check with development team and I will get back to you, on this.

    Grant, Do you have any idea how to convert a MySQL script to SQL-Server script ?

    (Like converter present form vb.net to c# and viceversa.)

    Cheers!

    Sandy.

    --

  • Sorry Sandy, not a clue. I've only seen MySQL once or twice. I'm just not terribly familiar with it.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • If you have a web service - why have it dump the stuff to disk - why not insert them directly into a table of all of the XML documents you get? It can do that in addition to storing it on disk if you really need to original xml documents.

    In order to bring that stuff into SQL - you're going to have to bring it in and prepare the document anyway, so you might as well do that from the entry point, no?

    That being said - if the files are stored in a relative path, they're relative to a specific root path, so you should still be able know what that path is on the host running the web service.

    ----------------------------------------------------------------------------------
    Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?

  • Hey Grant,

    I convert the MySql Script to SQL Server Script very easily,

    But right now also working on that same XML Path,

    If I will find any way, I will get back to you, I hope matt's way would help me. (not sure)

    Cheers!

    Sandy

    --

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply