[system] / branches / rel-2-3-exp / webwork2 / lib / MySOAP.pm Repository:
ViewVC logotype

Annotation of /branches/rel-2-3-exp/webwork2/lib/MySOAP.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4657 - (view) (download) (as text)

1 : gage 3253 package MySOAP;
2 :    
3 :     use constant DEBUG =>0;
4 :    
5 :     use Apache::Request;
6 :     use Apache::Constants qw(:common);
7 :     use Apache::File ();
8 :     use SOAP::Transport::HTTP;
9 :    
10 :     my $server = SOAP::Transport::HTTP::Apache
11 :     -> dispatch_to('RQP');
12 :    
13 :     sub handler {
14 :     my $save = $_[0];
15 :     my $r = Apache::Request->instance($_[0]);
16 :    
17 :     my $header = $r->as_string;
18 :     my $args = $r->args;
19 :     my $content = $r->content;
20 :     my $body="";
21 :     # this will read everything, but then it won't be available for SOAP
22 :     my $r2 = Apache::Request->instance($save) if DEBUG;
23 :     $r2->read($body, $r2->header_in('Content-length')) if DEBUG;
24 :     #
25 :     local(*DEBUGLOG);
26 :     open DEBUGLOG, ">>/home/gage/debug_info.txt" || die "can't open debug file";
27 :    
28 :    
29 :    
30 :    
31 :     ################
32 :     # Handle a wsdl rquest
33 :     ################
34 :     my %args_hash = $r->args;
35 :     if (exists $args_hash{wsdl}) {
36 :     $r->print( $wsdl);
37 :     print DEBUGLOG "----------start-------------\n";
38 :     print DEBUGLOG "handle wsdl request\n";
39 :     print DEBUGLOG "\n-header =\n $header\n" ;
40 :    
41 :    
42 :     my $wsdl = `cat /home/gage/rqp.wsdl`;
43 :     $r->content_type('application/wsdl+xml');
44 :     $r->send_http_header;
45 :     $r->print( $wsdl);
46 :    
47 :    
48 :     print DEBUGLOG "---end--- \n";
49 :     close(DEBUGLOG);
50 :     return OK;
51 :     ###############
52 :     # Handle SOAP request
53 :     ###############
54 :     } else {
55 :     print DEBUGLOG "----------start-------------\n";
56 :     print DEBUGLOG "handle soap request\n";
57 :     print DEBUGLOG "\n-header =\n $header\n" ; #if DEBUG;
58 :     print DEBUGLOG "args= $args\n";
59 :     print DEBUGLOG "\nbody= $body\n" if DEBUG;
60 :    
61 :     $server->handler(@_);
62 :    
63 :     print DEBUGLOG "---end--- \n";
64 :     close(DEBUGLOG);
65 :    
66 :     }
67 :    
68 :    
69 :    
70 :    
71 :     };
72 :    
73 :     1;

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9