We're a community of 1076K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,075,993 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

How to capture XML data using PHP?

I am currently testing a desktop application which is sending some data to a web URL in XML format, for some reason this data seems to be not sent in the correct format.

I need to know if there are any website or script that I can use to troubleshoot this issue, for example I can point and send my test data to a website or script that can the data coming from my application, so that I can trouble shoot it.

<SMS> 
    <authentification> 
      <username>john</username> 
      <password>johnpass</password> 
    </authentification> 
    <message> 
      <sender>14756541254</sender> 
            <text>Thank you for booking with <Company>.Your confirmation no is <ConfNr>.For further information please call <Phone></text> 
    </message> 
     <recipients> 
    <gsm><MOBILE></gsm> 
     </recipients> 
  </SMS>"
3
Contributors
4
Replies
46 Minutes
Discussion Span
1 Year Ago
Last Updated
5
Views
smartcard
Newbie Poster
5 posts since Sep 2006
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

xmllint does a great job if you're using linux

Otherwise save the text as something.xml and open it with the browser.

In the example you have some tags that are never closed: Company ConfNr Phone

aquilax
Junior Poster in Training
73 posts since Jul 2010
Reputation Points: 18
Solved Threads: 11
Skill Endorsements: 0

Checkout Fiddler and/or SoapUI.

pritaeas
Posting Prodigy
Moderator
9,287 posts since Jul 2006
Reputation Points: 1,173
Solved Threads: 1,458
Skill Endorsements: 86

Thanks for suggesting xmllint, yes I use Linux web server, but how can I capture the data to xmllint?

Yes, the tags is something I don't know how to solve, because these two tags are for extracting the data from the Desktop application

smartcard
Newbie Poster
5 posts since Sep 2006
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

Check the first comment here http://www.php.net/manual/en/function.domxml-open-mem.php

It shows how to capture the error in PHP.

The tags should be encoded if you want them in the text with &lt; &gt;

aquilax
Junior Poster in Training
73 posts since Jul 2010
Reputation Points: 18
Solved Threads: 11
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.0993 seconds using 2.68MB