This is our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

How can I convert an .xml file to a .pcap file,so that I can analyze the protocols I get.

asked 03 May '13, 02:42

kiyomi's gravatar image

kiyomi
1112
accept rate: 0%


That depends on the structure and the content of the XML file. If the XML file contains the raw packet bytes, you could extract those bytes from the XML file and write those bytes in a format that text2pacp understands. If the XML file contains just application data, there is a lot more to do and then it's probably better not to analyze that data with Wireshark.

Can you please add some information about the nature and structure of your XML file and who/what generated that file?

Regards
Kurt

permanent link

answered 03 May '13, 03:11

Kurt%20Knochner's gravatar image

Kurt Knochner ♦
24.7k1037236
accept rate: 15%

Thanks for your prompt reply! My project contains a part for tracing the protocols that we use to send some message, I get the stream and then I parse it to List<packet(already defined)="">. Then I use jSON to post the packets to front page. But now, another requirement appears, I want to get the jSONArray or something else back, and turn it to .xml file, eventually, I wang to convert the xml file to pcap(or some else file formats that the Wireshark can read). Thank you again for your help.Thanks for your prompt reply!The jSONArrays is generated as follows: I use "tshark -T pdml" in linux terminal, and then I parse the inputstream to get the packet I want, then I use dom4j to generate List<packet>, then turn that to jSON. Thank you again for your help.

(03 May '13, 19:50) kiyomi

I have also the same problem can you help me?

(17 Aug, 02:14) Wegang

@Wegang, please open your own question with your xml file rather than trying to piggy-back on to a long dormant older question.

(17 Aug, 02:45) grahamb ♦
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×238
×36

question asked: 03 May '13, 02:42

question was seen: 4,936 times

last updated: 17 Aug, 02:45

p​o​w​e​r​e​d by O​S​Q​A