473,416 Members | 1,557 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,416 software developers and data experts.

How to send file with WebService?

ad
I want to send a DataSet to WebService, but the DataSet if too huge(there
about 50000 records, and 50 fields every record).
My solution is
1.save the DataSet as XML file,
2.zip the XML file.
3. send the zip file to WebService.
4. Unzip the zip file to XML.
5. Load XML file into DataSet.
6.Bulk copy the XML file to DataBase.

I can do the Steps 1,2, but I do'nt know how to set the zip file to
WebService in Step 3.

How can I do that?


Nov 17 '05 #1
4 18523
Hi ad,
fiftythousand records with fifty fields each, is is a lot. But too much?
Before you try to do the xml zipping and uploading, have a look at the
webservice.timeout property. Maybee this one will help to overcome your
problems.

Here is som emor information:
http://www.kleinurl.de/?ks9sdi89

greetings from germany
Chris

Nov 17 '05 #2
Ste
Presuming you are sending the file over the wire via soap/http

Are you sending the file as a soap attachment?

If not i presume you are tyring to embed the file in the soap body - to do
this you will have to convert the file bytes into Base64 and embed the
base64 encoded zip file in the soap body.. have you done this... PS this
will make your zip file bigger.

eg..
1.save the DataSet as XML file,
2.zip the XML file.
2a base64 zip file to get a human readable file encoded
2b embedd the base64 bytes in the soap doc
3. send the zip file to WebService.
4. Unzip the zip file to XML.
5. Load XML file into DataSet.
6.Bulk copy the XML file to DataBase.


To save file size - do you really need to save the dataset as xml... have
you thought about comma delimited fields, run length encoding.. before
zip'ing etc.. The data file size can be massively reduced.. and as this data
transfer of such a big file will be your bottleneck.. the amount of time you
spend processing the file back to xml on arrival can often be offset.

Alternatively design your solution to send the data in chunks...

Nov 17 '05 #3
ad
Thanks a lot!
Could you tell me more detail?
1. What about " send the data in chunks" How to implement ?
2. ....about comma delimited fields, run length encoding.. HOw to run
lenght encoding?
3. How to embed base64 encoded into the soap body?


"Ste" <no*****@nospam.com> ¼¶¼g©ó¶l¥ó·s»D:gv********************@pipex.net...
Presuming you are sending the file over the wire via soap/http

Are you sending the file as a soap attachment?

If not i presume you are tyring to embed the file in the soap body - to do
this you will have to convert the file bytes into Base64 and embed the
base64 encoded zip file in the soap body.. have you done this... PS this
will make your zip file bigger.

eg..
1.save the DataSet as XML file,
2.zip the XML file.


2a base64 zip file to get a human readable file encoded
2b embedd the base64 bytes in the soap doc
3. send the zip file to WebService.
4. Unzip the zip file to XML.
5. Load XML file into DataSet.
6.Bulk copy the XML file to DataBase.


To save file size - do you really need to save the dataset as xml... have
you thought about comma delimited fields, run length encoding.. before
zip'ing etc.. The data file size can be massively reduced.. and as this
data transfer of such a big file will be your bottleneck.. the amount of
time you spend processing the file back to xml on arrival can often be
offset.

Alternatively design your solution to send the data in chunks...


Nov 17 '05 #4
Ste
1) Sending in chunks.. [not talking about raw http encoding here] .. You
could make your web service send subsets of the records eg the client makes
multiple calls to your webservice sending a soap payload along the lines
of..

The server receives the data in pieces, and processes each record in
turn...More network transfer, but if things go wrong - you only need to
resend the last chunk you sent.. not the whole dataset

<recordblocktype>start</recordblocktype>
<totalrecords>10</totalrecords>
<recordstart>1</recordstart>
<recordend>5</recordend>
<datarows> record_01 data
record_02 data
record_03 data
record_04 data
record_05 data
</datarows>

<recordblocktype>chunk</recordblocktype>
...
...

<recordblocktype>end</recordblocktype>
<totalrecords>20</totalrecords>
<recordstart>6</recordstart>
<recordend>10</recordend>
<datarows>
record_06 data
record_07 data
record_08 data
record_09 data
record_10 data
</datarows>

2) You are taking xml and compressing it into zip format..dont compress the
xml version - convert to the data into another format before you compress
it.. for example..

(this trivial list of individual data rows can easily be represented in a
form other that xml)
xml version..
<data_1>somedata1</data_1><data_2>somedata2</data_2><data_3>somedata3</data_3><data_4>somedata4</data_4>
comma del.. somedata1,somedata2,somedata3,somedata4

As you can see before compression the comma del version of the data is
already smaller.. this should give you a bettter compression ration.

You will have to find a suitable compromise here between ease of use and
compression.

3) Look up the [!CDATA] tag for soap .. read this synpsis

http://webservices.xml.com/pub/a/ws/...endpoints.html

HTH

Steve

"ad" <fl****@wfes.tcc.edu.tw> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Thanks a lot!
Could you tell me more detail?
1. What about " send the data in chunks" How to implement ?
2. ....about comma delimited fields, run length encoding.. HOw to run
lenght encoding?
3. How to embed base64 encoded into the soap body?


"Ste" <no*****@nospam.com>
¼¶¼g©ó¶l¥ó·s»D:gv********************@pipex.net...
Presuming you are sending the file over the wire via soap/http

Are you sending the file as a soap attachment?

If not i presume you are tyring to embed the file in the soap body - to
do this you will have to convert the file bytes into Base64 and embed the
base64 encoded zip file in the soap body.. have you done this... PS this
will make your zip file bigger.

eg..
1.save the DataSet as XML file,
2.zip the XML file.


2a base64 zip file to get a human readable file encoded
2b embedd the base64 bytes in the soap doc
3. send the zip file to WebService.
4. Unzip the zip file to XML.
5. Load XML file into DataSet.
6.Bulk copy the XML file to DataBase.


To save file size - do you really need to save the dataset as xml... have
you thought about comma delimited fields, run length encoding.. before
zip'ing etc.. The data file size can be massively reduced.. and as this
data transfer of such a big file will be your bottleneck.. the amount of
time you spend processing the file back to xml on arrival can often be
offset.

Alternatively design your solution to send the data in chunks...



Nov 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Robb Gilmore | last post by:
Hello, We have a C#.NET app which is calling a Java webservice. We use the wsdl file exportted from the java webservice to create our web-reference in Visual Studio. We are able to create the...
10
by: John Davies | last post by:
I want to send a bug report automatically from my VB.NET program. I won't know the end user's smtp server or what email client they are using. The Process.Start with mailto is almost what I need,...
4
by: Matthew.DelVecchio | last post by:
hello, i am developing an ASP.NET web app that consumes a 3rd party vendor webservice. it is my first one so while ive done my homework, im not an expert on the matter. our partner's...
18
by: A.M | last post by:
Hi, Is there any way to call a WSS web service method by using browser and see the XML result in browser as well? I have been told that there is query string syntax for calling...
3
by: Code Monkey | last post by:
I've created a web service in .Net v2 that takes a couple of parameters (ie; to address, subject and body) that sends an email. I now want to extend this so that it can send attachments (ie; a...
2
by: Pablo | last post by:
Hi at all! How can i send a DATA (not a DataTime) Type to a Java WebService? In .NET we have only a DataTime that is incompatible with the Data (calendar) Type of Java! How can i resolve this...
5
by: tommaso.gastaldi | last post by:
Hi. I have been implementing a simple email notification system using the handy class SmtpClient: With SmtpClient .Host =MailServer .Send(MailMessage) '... now my client is asking also for...
0
by: ultradiv | last post by:
I have a VB.NET application partly built that produces an xml output (just a file at present) I have a .NET webserver and SQLserver 2000 I need to be able to send the xml to the webserver/database...
0
by: vagueante | last post by:
Hi, I have to connect to a webservice, and the data i have is: WSDL XML sample file (which is what i have to send to the webservice and with credentials, user and password tags). XSD file My...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.