Import from 1.9a8 tarball
[mozilla-extra.git] / extensions / webservices / soap / tests / soapsuccess.cgi
blob63555a8a94331dfd63e4a742d177dcabee466007
1 #!/usr/bin/perl
3 # Get and log the input
4 open(LOGFILE, ">/tmp/dumpfile2");
5 print LOGFILE `date`;
7 read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
8 print LOGFILE $ENV{'REQUEST_METHOD'};
9 print LOGFILE $ENV{'CONTENT_LENGTH'};
10 print LOGFILE $buffer;
11 close LOGFILE;
13 # Send the response
14 print "Content-type: application/xml\n\n";
15 print "<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\" SOAP-ENV:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:SOAP-ENC=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:xsi=\"http://www.w3.org/1999/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/1999/XMLSchema\">\n";
16 print "<SOAP-ENV:Body>\n";
17 print "<m:GetLastTradePriceResponse xmlns:m=\"uri:some-namespace\">\n";
18 print "<SOAP-ENC:Array SOAP-ENC:arrayType=\"xsd:ur-type[5]\">\n";
19 print " <foo xsi:type=\"xsd:int\">23</foo>\n";
20 print " <SOAP-ENC:boolean>false</SOAP-ENC:boolean>\n";
21 print " <bar xsi:type=\"xsd:float\">0.234</bar>\n";
22 print " <baz xsi:type=\"SOAP-ENC:Array\" SOAP-ENC:arrayType=\"xsd:short[]\">\n";
23 print " <element1>2</element1>\n";
24 print " <element2>3</element2>\n";
25 print " <foobar>4</foobar>\n";
26 print " <ignoredType xsi:type=\"xsd:float\">5</ignoredType>\n";
27 print " <SOAP-ENC:int>45</SOAP-ENC:int>\n";
28 print " </baz>\n";
29 print " <bob>\n";
30 print " <inst1>untyped string</inst1>\n";
31 print " <inst2 xsi:type=\"xsd:byte\">c</inst2>\n";
32 print " <SOAP-ENC:int>456</SOAP-ENC:int>\n";
33 print " </bob>\n";
34 print "</SOAP-ENC:Array>\n";
35 print "</m:GetLastTradePriceResponse>\n";
36 print "</SOAP-ENV:Body>\n";
37 print "</SOAP-ENV:Envelope>\n";