3
#include <libxml/xmlmemory.h>
4
#include <libxml/parser.h>
8
void initXML(struct TestData *td) {
12
void releaseXML(struct TestData *td) {
16
void parseXML(struct TestData *td, unsigned long iter) {
18
xmlNodePtr pnode,node,node1;
25
doc = xmlNewDoc("1.0");
26
pnode = xmlNewChild((xmlNodePtr)doc,NULL,"Envelope",NULL);
27
xmlNewNs(pnode,"http://www.w3.org/2001/12/soap-envelope",NULL);
28
ns1=xmlNewNs(pnode,"http://www.w3.org/2001/XMLSchema-instance","xsi");
29
ns2=xmlNewNs(pnode,"http://www.w3.org/2001/12/soap-encoding","enc");
30
pnode=xmlNewChild(pnode,NULL,"Body",NULL);
31
pnode=xmlNewChild(pnode,NULL,"WriteResponse",NULL);
32
xmlNewNs(pnode,"http://opcfoundation.org/webservices/OPCDA/",NULL);
33
node=xmlNewChild(pnode,NULL,"WriteResult",NULL);
34
xmlSetProp(node,"RcvTime","2002-04-29T10:16:26.6806250+02:00");
35
xmlSetProp(node,"ReplyTime","2002-04-29T10:16:26.7806250+02:00");
36
xmlSetProp(node,"ClientRequestHandle","WriteError");
37
xmlSetProp(node,"RevisedLocaleID","en");
38
xmlSetProp(node,"ServerState","running");
39
node1=xmlNewChild(pnode,NULL,"RItemList",NULL);
40
node=xmlNewChild(pnode,NULL,"Errors",NULL);
41
xmlSetProp(node,"ID","E_UNKNOWNITEMID");
42
xmlNewChild(node,NULL,"Text","The item does not exist in the server address space.");
43
node=xmlNewChild(pnode,NULL,"Errors",NULL);
44
xmlSetProp(node,"ID","S_CLAMP");
45
xmlNewChild(node,NULL,"Text","The value written was accepted but the output was clamped.");
48
node=xmlNewChild(pnode,NULL,"Items",NULL);
49
xmlSetProp(node,"ItemPath","");
50
xmlSetProp(node,"ItemName","WrongItemID1");
51
xmlSetProp(node,"Timestamp","0001-01-01T00:00:00.0000000+01:00");
52
xmlSetProp(node,"ErrorID","E_UNKNOWNITEMID");
53
node1=xmlNewChild(node,NULL,"Value",NULL);
54
xmlSetProp(node1,"xsi:nil","true");
56
node=xmlNewChild(pnode,NULL,"Items",NULL);
57
xmlSetProp(node,"ItemPath","");
58
xmlSetProp(node,"ItemName","WrongItemID2");
59
xmlSetProp(node,"Timestamp","0001-01-01T00:00:00.0000000+01:00");
60
xmlSetProp(node,"ErrorID","E_UNKNOWNITEMID");
61
node1=xmlNewChild(node,NULL,"Value",NULL);
62
xmlSetProp(node1,"xsi:nil","true");
64
node=xmlNewChild(pnode,NULL,"Items",NULL);
65
xmlSetProp(node,"ItemPath","/Reals");
66
xmlSetProp(node,"ItemName","Float1");
67
xmlSetProp(node,"ValueType","xsd:float");
68
xmlSetProp(node,"Timestamp","2002-04-29T11:47:18.1493750+02:00");
69
node1=xmlNewChild(node,NULL,"Value","10.0141414");
70
xmlSetNsProp(node1,ns1,"type","xsd:float");
72
node=xmlNewChild(pnode,NULL,"Items",NULL);
73
xmlSetProp(node,"ItemPath","/Reals");
74
xmlSetProp(node,"ItemName","Float2");
75
xmlSetProp(node,"ValueType","xsd:float");
76
xmlSetProp(node,"Timestamp","2002-04-29T11:47:18.1493750+02:00");
77
xmlSetProp(node,"SuccessID","S_CLAMP");
78
node1=xmlNewChild(node,NULL,"Value","1.07");
79
xmlSetNsProp(node1,ns1,"type","xsd:float");
81
for (i=0;i<td->inc;i++) {
82
node=xmlNewChild(pnode,NULL,"Items",NULL);
83
xmlSetProp(node,"ItemPath","/Integer");
84
xmlSetProp(node,"ItemName","IntN");
85
xmlSetProp(node,"ValueType","xsd:int");
86
xmlSetProp(node,"Timestamp","2002-04-29T11:47:18.1493750+02:00");
87
xmlSetProp(node,"SuccessID","S_CLAMP");
88
sprintf(s,"%u",rand());
89
node1=xmlNewChild(node,NULL,"Value",(unsigned char*)s);
90
xmlSetNsProp(node1,ns1,"type","xsd:int");
93
xmlDocDumpMemory(doc,&mem,&memsize);
96
// if (iter==td->iterations) puts(mem);
100
int main(int argc, char *argv[]) {
101
return Test(argc,argv);