File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes XML and Related Technologies and the fly likes XML Validation and capturing response Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XML Validation and capturing response" Watch "XML Validation and capturing response" New topic
Author

XML Validation and capturing response

Minni Rose
Greenhorn

Joined: Jan 13, 2012
Posts: 6
Hi All,

I am having 2 types of messages 1) Request and 2) Response.
.
I need to write a dummy application inorder to accpte the XML and validate the contents of both Request and Response.I have constructed a Response.xml which is of generic type and also an input file passing the requeste message details. I need to validate the input.xml and capture the response.

Can any one suggest me a route hou to go ahead.

Thanks in Advance!!

James Boswell
Bartender

Joined: Nov 09, 2011
Posts: 1031
    
    5

By validate, do you mean well formed? Or do you mean against a defined XSD or DTD?
Minni Rose
Greenhorn

Joined: Jan 13, 2012
Posts: 6
Thanks for your quick response.

not in both formats infact.
let's say for a field ex:login field , they might send a response or they might send some code so we need to validate that.

We can get the output with the help https or anything else but we need to validate the data like we will send the expected response data and compare to the actual data.
Minni Rose
Greenhorn

Joined: Jan 13, 2012
Posts: 6
My generic response xml will be in this form:

<response>
<command type="@@entityType@@" name="@@eventName@@">
<entityresponse>
<faultcode></faultcode>
<faultstring></faultstring>
</entityresponse>
<entitydata entitytype="">
<datafield datatype="">
<name></name>
<value></value>
</datafield>
</command>
</response>


and Input.xml is:

<header>
<authinfo>
<username></username>
<password>s0n*l1Nk!</password>
</authinfo>
</header>
<body>
<request>
---some values ---
</request>
<response>
---some values ---

</response>
</request>
</body>
James Boswell
Bartender

Joined: Nov 09, 2011
Posts: 1031
    
    5

Minni

I think you need to provide a simple example to make it clear what you are trying to achieve. Remember to use the appropriate tags when you do.
Minni Rose
Greenhorn

Joined: Jan 13, 2012
Posts: 6
James,

Infact I didnt develop anything as of now need some guidance in gng ahead. I need to validate some data passed thru xml and chk whether the contents in response are proper or not for the values passed.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: XML Validation and capturing response