File tree Expand file tree Collapse file tree 2 files changed +23
-3
lines changed
Expand file tree Collapse file tree 2 files changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -5,13 +5,31 @@ use Pod::WSDL;
55use WebworkSOAP;
66
77use constant MP2 => ( exists $ENV {MOD_PERL_API_VERSION } and $ENV {MOD_PERL_API_VERSION } >= 2 );
8- use constant RPC_URL => ' http://localhost/webwork2_rpc' ;
8+
9+ BEGIN {
10+ # ##############################################################################
11+ # Configuration -- set to top webwork directory (webwork2) (set in webwork.apache2-config)
12+ # Configuration -- set server url automatically for this file
13+ # ##############################################################################
14+
15+ our $webwork_directory = $WeBWorK::Constants::WEBWORK_DIRECTORY ; # '/opt/webwork/webwork2';
16+ print " WebworkSOAP::WSDL: webwork_directory set to " , $WeBWorK::Constants::WEBWORK_DIRECTORY ,
17+ " via \$ WeBWorK::Constants::WEBWORK_DIRECTORY set in webwork.apache2-config\n " ;
18+ my $seed_ce = new WeBWorK::CourseEnvironment({ webwork_dir => $webwork_directory });
19+ die " Can't create seed course environment for webwork in $webwork_directory " unless ref ($seed_ce );
20+ my $server_root_url = $seed_ce -> {server_root_url }; # "http://localhost";
21+ our $RPC_URL = " $server_root_url /webwork2_rpc" ;
22+ print " WebworkSOAP::WSDL: rpc_url set to $RPC_URL \n " ;
23+
24+ }
25+
26+
927
1028sub handler ($) {
1129 my ($r ) = @_ ;
1230 my $pod = new Pod::WSDL(
1331 source => ' WebworkSOAP' ,
14- location => RPC_URL,
32+ location => $ RPC_URL ,
1533 pretty => 1,
1634 withDocumentation => 0
1735 );
Original file line number Diff line number Diff line change 11# !/user/bin/perl -w
22
3-
3+ # initialize SOAP interface as well
4+ use WebworkSOAP;
5+ use WebworkSOAP::WSDL;
46
57BEGIN {
68 $main::VERSION = " 2.4.9" ;
You can’t perform that action at this time.
0 commit comments