From: pkiddie <pk...@us...> - 2005-08-30 10:28:13
|
Update of /cvsroot/stack/stack-1-0/scripts/rqp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2590/scripts/rqp Modified Files: RQPv1p0Server.php nb_soapfuncs.php Log Message: Resolving conflicts between rqp branch and head branch Index: RQPv1p0Server.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/rqp/RQPv1p0Server.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** RQPv1p0Server.php 25 Aug 2005 16:06:18 -0000 1.2 --- RQPv1p0Server.php 30 Aug 2005 10:28:01 -0000 1.3 *************** *** 2,8 **** include("nb_easyxml_lite.php"); include("nb_soapfuncs.php"); ! ! //include("rqp_util.php"); //Stack/RQP utility functions ! include("../../stackstd.php"); //Reqd for version info for STACK /********* Data structures used by this web service ********* --- 2,7 ---- include("nb_easyxml_lite.php"); include("nb_soapfuncs.php"); ! include("../../stackstd.php"); ! //include("rqp_util.php"); //Stack/RQP utility function. /********* Data structures used by this web service ********* *************** *** 16,23 **** * ['teacherDocs']=>anyURI * ['adminDocs']=>anyURI ! * ['serverProperties']=>array({ ! * ['key']=>string ! * ['val']=>string ! * }, ...) * ['mimetypes']=>array(string, ...) * ['resources']=>array(anyURI, ...) --- 15,19 ---- * ['teacherDocs']=>anyURI * ['adminDocs']=>anyURI ! * ['serverProperties']=>array(key=>val, ...) * ['mimetypes']=>array(string, ...) * ['resources']=>array(anyURI, ...) *************** *** 26,33 **** * type ItemInformationDType{ * ['name']=>string ! * ['itemProperties']=>array({ ! * ['key']=>string ! * ['val']=>string ! * }, ...) * ['error']=>string * ['warning']=>string --- 22,26 ---- * type ItemInformationDType{ * ['name']=>string ! * ['itemProperties']=>array(key=>val, ...) * ['error']=>string * ['warning']=>string *************** *** 36,57 **** * type RenderDType{ * ['persistentData']=>string ! * ['outcomeVars']=>array({ ! * ['key']=>string ! * ['val']=>string ! * }, ...) * ['onSubmit']=>string * ['head']=>array(string, ...) ! * ['output']=>array({ ! * ['key']=>string ! * ['val']=>string ! * }, ...) * ['mimetype']=>string * ['files']=>array(anyURI, ...) * } * - * type kvPair{ - * ['key']=>string - * ['val']=>string - * } * * type input{ --- 29,40 ---- * type RenderDType{ * ['persistentData']=>string ! * ['outcomeVars']=>array(key=>val, ...) * ['onSubmit']=>string * ['head']=>array(string, ...) ! * ['output']=>array(key=>val, ...) * ['mimetype']=>string * ['files']=>array(anyURI, ...) * } * * * type input{ *************** *** 66,69 **** --- 49,202 ---- */ + //Temporary placeholder for global variables used in RQP + /* You need to tell STACK where it is, to create accurate URL's */ + $stack_host = 'localhost'; + $stack_basepath = 'stack-1-0'; + /* The URL of the site, with trailing slash */ + /* (You should not need to edit below) */ + $stack_web_url = 'http://'.$stack_host.'/'.$stack_basepath.'/'; + + $stack_ver['release'] = '1.0'; + $stack_ver['cvsmodule'] = 'stack-1-0'; + + $stack_web_services_provide = TRUE; + + // "Insert *s where needed"; + $stackOptions['InsertStars']['type'] = 'list'; + $stackOptions['InsertStars']['values'] = array('TRUE','FALSE'); + $stackOptions['InsertStars']['default'] = 'FALSE'; + + // 'Allow informal syntax'; + $stackOptions['InformalSyntax']['type'] = 'list'; + $stackOptions['InformalSyntax']['values'] = array('TRUE','FALSE'); + $stackOptions['InformalSyntax']['default'] = 'TRUE'; + + // 'Input tools'; + $stackOptions['AllowInputTool']['type'] = 'list'; + $stackOptions['AllowInputTool']['values'] = array('Form box','Form box + JOME'); + $stackOptions['AllowInputTool']['default'] = 'Form box + JOME'; + + // 'Syntax Hint'; + $stackOptions['SyntaxHint']['type'] = 'string'; + $stackOptions['SyntaxHint']['values'] = ''; + $stackOptions['SyntaxHint']['default'] = ''; + + // 'Display'; + $stackOptions['Display']['type'] = 'list'; + $stackOptions['Display']['values'] = array('String','LaTeX','MathML','LaTeX Source'); + $stackOptions['Display']['default'] = 'LaTeX'; + + // 'Language'; + $stackOptions['Language']['type'] = 'list'; + $stackOptions['Language']['values'] = array('en','es','nl'); + $stackOptions['Language']['default'] = 'en'; + + // 'Question value'; + $stackOptions['QuVal']['type'] = 'number'; + $stackOptions['QuVal']['values'] = ''; + $stackOptions['QuVal']['default'] = '1'; + + // 'Mark modification method'; + $stackOptions['MarkModMethod']['type'] = 'list'; + $stackOptions['MarkModMethod']['values'] = array('Penalty','Last Answer'); + $stackOptions['MarkModMethod']['default'] = 'Penalty'; + + // 'Question penalty'; + $stackOptions['Penalty']['type'] = 'number'; + $stackOptions['Penalty']['values'] = ''; + $stackOptions['Penalty']['default'] = '0.1'; + + // 'Forbidden words'; + $stackOptions['Forbid']['type'] = 'string'; + $stackOptions['Forbid']['values'] = ''; + $stackOptions['Forbid']['default'] = ''; + + // 'Allowed words'; + $stackOptions['Allow']['type'] = 'string'; + $stackOptions['Allow']['values'] = ''; + $stackOptions['Allow']['default'] = ''; + + // 'Answer test'; + $stackOptions['AnsTest']['type'] = 'list'; + $stackOptions['AnsTest']['values'] = ''; // This is automatically defined below, after the answer tests. + $stackOptions['AnsTest']['default'] = 'AlgEquiv'; + + // 'Answer test options'; + $stackOptions['AnsTestOpt']['type'] = 'string'; + $stackOptions['AnsTestOpt']['values'] = ''; + $stackOptions['AnsTestOpt']['default'] = ''; + + // "Teacher's email"; + $stackOptions['TeacherEmail']['type'] = 'string'; + $stackOptions['TeacherEmail']['values'] = ''; + $stackOptions['TeacherEmail']['default'] = ''; + + // 'Feedback: correct'; + $stackOptions['FeedBackGenericCorrect']['type'] = 'html'; + $stackOptions['FeedBackGenericCorrect']['values'] = ''; + $stackOptions['FeedBackGenericCorrect']['default'] = get_string('stackOptions_FeedBackGenericCorrect_def','stack',''); + + // 'Feedback: incorrect'; + $stackOptions['FeedBackGenericIncorrect']['type'] = 'html'; + $stackOptions['FeedBackGenericIncorrect']['values'] = ''; + $stackOptions['FeedBackGenericIncorrect']['default'] = get_string('stackOptions_FeedBackGenericIncorrect_def','stack',''); + + // 'Feedback: partially correct'; + $stackOptions['FeedBackGenericPCorrect']['type'] = 'html'; + $stackOptions['FeedBackGenericPCorrect']['values'] = ''; + $stackOptions['FeedBackGenericPCorrect']['default'] = get_string('stackOptions_FeedBackGenericPCorrect_def','stack',''); + + + // 'Show solution'; + $stackOptions['QuizMode']['type'] = 'list'; + $stackOptions['QuizMode']['values'] = array('Practice','Assessment','Strict'); + $stackOptions['QuizMode']['default'] = 'Practice'; + + $stackAnswerTest['AlgEquiv']['imp'] = 'cas'; + $stackAnswerTest['AlgEquiv']['function'] = 'ATAlgEquiv'; + + $stackAnswerTest['CASEqual']['imp'] = 'cas'; + $stackAnswerTest['CASEqual']['function'] = 'ATCASEqual'; + + $stackAnswerTest['FacForm']['imp'] = 'cas-var'; + $stackAnswerTest['FacForm']['function'] = 'ATFacForm'; + + $stackAnswerTest['SA_factored']['imp'] = 'cas-var'; + $stackAnswerTest['SA_factored']['function'] = 'ATFacForm'; + + $stackAnswerTest['SA_expanded']['imp'] = 'cas-var'; + $stackAnswerTest['SA_expanded']['function'] = 'ATExpanded'; + + $stackAnswerTest['PartFrac']['imp'] = 'cas-var'; + $stackAnswerTest['PartFrac']['function'] = 'AtPartFrac'; + + $stackAnswerTest['Diff']['imp'] = 'cas-var'; + $stackAnswerTest['Diff']['function'] = 'ATDiff'; + + $stackAnswerTest['Int']['imp'] = 'cas-var'; + $stackAnswerTest['Int']['function'] = 'ATInt'; + + $stackAnswerTest['SA_True']['imp'] = 'cas-loc'; + $stackAnswerTest['SA_True']['function'] = 'cas'; + + $stackAnswerTest['Num_tol_relative']['imp'] = 'cas-loc'; + $stackAnswerTest['Num_tol_relative']['function'] = 'cas'; + + $stackAnswerTest['Num_tol_relative']['imp'] = 'cas-loc'; + $stackAnswerTest['Num_tol_absolute']['function'] = 'cas'; + + $stackAnswerTest['String']['imp'] = 'php'; + $stackAnswerTest['StringSloppy']['imp'] = 'php'; + $stackAnswerTest['RegExp']['imp'] = 'php'; + $stackAnswerTest['True']['imp'] = 'php'; + + // Build a list of AnswerTests. + // and add these to the options. + $ats = ''; + foreach( $stackAnswerTest as $field => $q_field) + { $ats[] = $field; } + + $stackOptions['AnsTest']['values'] = $ats; + class RQPv1p0 extends RQPv1p0_nbSOAP { *************** *** 72,101 **** /** * web service provider method RQP_ServerInformation ! * ! * @return ServerInformationDType */ function RQP_ServerInformation() { ! // return new nbSOAPFault("unimplemented", "The RQP_ServerInformationservice has not been implemented yet", ""); ! global $stack_ver, $stack_web_url; ! $si['type'] = "STACK"; ! $si['version'] = $stack_ver['release']; ! $si['rqpVersion'] = "1.0"; $si['details'] = "{$stack_web_url}scripts/rqp/stackDetails.php"; //url of the server $si['studentDocs'] = "{$stack_web_url}scripts/rqp/stackDocs.php?action=student"; //stack/lang/en/doc - studentinput $si['teacherDocs'] = "{$stack_web_url}scripts/rqp/stackDocs.php?action=teacher"; //about $si['adminDocs'] = "{$stack_web_url}scripts/rqp/stackDocs.php?action=admin"; //author ! $si['serverProperties'] = array(array ('key' => 'rendering', 'val' => TRUE), ! array ('key' => 'implicitCloning', 'val' => FALSE), ! array ('key' => 'explicitCloning', 'val' => FALSE), ! array ('key' => 'authoring', 'val' => TRUE), ! array ('key' => 'adminOptions', 'val' => TRUE), ! array ('key' => 'teacherOptions', 'val'=> FALSE), ! array ('key' => 'userOptions', 'val' => TRUE) ); ! ! $si['mimetypes'] = array("text/html"); ! $si['resources'] = array("Location of JOME and any other prerequisites for server operation"); ! return $si; } --- 205,238 ---- /** * web service provider method RQP_ServerInformation ! * ! * @return ServerInformationDType */ function RQP_ServerInformation() { ! include("../../stackstd.php"); //Reqd for version info for STACK ! global $stack_ver, $stack_web_url, $stack_web_services_provide; ! if (!$stack_web_services_provide) { ! return new nbSOAPFault("notImplemented", "The RQP_ServerInformation service is not available on this server"); ! } ! ! // return new nbSOAPFault("unimplemented", "The RQP_ServerInformationservice has not been implemented yet", ""); ! $si['type'] = "STACK"; ! $si['version'] = $stack_ver['release']; ! $si['rqpVersion'] = "1.0"; $si['details'] = "{$stack_web_url}scripts/rqp/stackDetails.php"; //url of the server $si['studentDocs'] = "{$stack_web_url}scripts/rqp/stackDocs.php?action=student"; //stack/lang/en/doc - studentinput $si['teacherDocs'] = "{$stack_web_url}scripts/rqp/stackDocs.php?action=teacher"; //about $si['adminDocs'] = "{$stack_web_url}scripts/rqp/stackDocs.php?action=admin"; //author ! $si['serverProperties']=array('rendering' => TRUE, ! 'implicitCloning' => FALSE, ! 'explicitCloning' => FALSE, ! 'authoring' => TRUE, ! 'adminOptions' => TRUE, ! 'teacherOptions'=> FALSE, ! 'userOptions' => TRUE); ! $si['mimetypes']=array("text/html"); ! $si['resources']=array("Location of JOME and any other prerequisites for server operation"); ! return $si; } *************** *** 103,117 **** /** * web service provider method RQP_ItemInformation ! * * @param source : string ! * @return ItemInformationDType */ function RQP_ItemInformation($source) { ! //return new nbSOAPFault("unimplemented", "The RQP_ItemInformationservice has not been implemented yet", ""); ! // Fill in web method fuctionality here. ! // return a ItemInformationDType ! ! //First we check to see if the source intantiates a valid question, if so set isValid to true $item = sourceHandler($source); --- 240,255 ---- /** * web service provider method RQP_ItemInformation ! * * @param source : string ! * @return ItemInformationDType */ function RQP_ItemInformation($source) { ! global $stack_web_services_provide; ! ! if (!$stack_web_services_provide) { ! return new nbSOAPFault("notImplemented", "The RQP_ItemInformation service is not available on this server"); ! } ! //First we check to see if the source intantiates a valid question, if so set isValid to true $item = sourceHandler($source); *************** *** 168,176 **** //$itemInfo['warning'] =>; // Retrieved from source parser } /** * web service provider method RQP_Render ! * * @param source : string * @param options : kvPair[] --- 306,317 ---- //$itemInfo['warning'] =>; // Retrieved from source parser + return new nbSOAPFault("unimplemented", "The RQP_ItemInformationservice has not been implemented yet", ""); + // Fill in web method fuctionality here. + // return a ItemInformationDType } /** * web service provider method RQP_Render ! * * @param source : string * @param options : kvPair[] *************** *** 183,232 **** * @param resourceBase : anyURI * @param tempfileBase : anyURI ! * @return RenderDType */ ! function RQP_Render($source, $options, $persistentData, $inputData, $directives, $mimetypes, $namePrefix, $itemBase, $resourceBase, $tempfileBase) ! { ! if (empty($source) && $directives[4]['val']==TRUE) ! { ! require_once('../stackAuthor.php'); ! ! $question = ''; ! $errors = ''; ! $render['persistentData'] = ''; ! $render['outcomeVars'] = array( array('key' => 'completion', 'val' => 'unknown'), ! array('key' => 'score', 'val' => '0'), ! array('key' => 'rawScore', 'val' => '0'), ! array('key' => 'penalty', 'val' => '0'), ! array('key' => 'valid', 'val' => TRUE), ! array('key' => 'source', 'val' => 'edited sourcce'), ! array('key' => 'options', 'val' => 'options string') ) ; ! $render['onSubmit'] = "</script> ! function EditQ(action) { ! f = document.stackeditqform; ! f.action.value = action; ! f.target = '_self'; ! f.submit(); ! }; ! <script type=".'"'.'text/javascript">'; ! $render['head'] = array(); ! $render['output'] = array( array('key' => 'title', 'val' => ''), //initially question will have no title ! array('key' => 'body', 'val' => stack_question_edit_form_rqp($question,&$errors)), ! array('key' => 'stem', 'val' => ''), ! array('key' => 'feedback', 'val' => ''), ! array('key' => 'response', 'val' => ''), ! array('key' => 'answer', 'val' => ''), ! array('key' => 'solution', 'val' => '') ); ! $render['mimetype'] = 'text/html'; ! $render['files'] = array(); ! //New question - return this form in render op ! //May need to set $questionId initially; ! ! return $render; } /*$outcomeVars = array(); --- 324,420 ---- * @param resourceBase : anyURI * @param tempfileBase : anyURI ! * @return RenderDType */ ! function RQP_Render($source, $options, &$persistentData, $inputData, $directives, $mimetypes, $namePrefix, $itemBase, $resourceBase, $tempfileBase) ! { ! global $stack_web_services_provide; ! ! if (!$stack_web_services_provide) { ! return new nbSOAPFault("notImplemented", "The RQP_ServerInformation service is not available on this server"); ! } ! ! require("../../stackstd.php"); //Reqd for version info for STACK ! //require("../moodlelib.php"); ! require_once('../stackAuthor.php'); ! //require_once('../stackQuestion.php'); ! //Response parameters ! $persistentData=''; ! $outcomeVars=''; ! $onSubmit=''; ! $head=''; ! $output=''; ! $mimetype=''; ! $files=''; ! ! //1. User wants to author a question ! if (in_array('edit',$directives)) //if this is set, disregard other directives ! { ! $errors=''; //Used in authoring form ! //1.1 Is a new question to be authored, or an existing one ! if (empty($source)) ! { ! $question = stack_question_new('Paul Kiddie'); //Create question with mim fields. Todo, how do we get admin name from Moodle ! ! show_array($question); ! $persistentData = ''; ! $outcomeVars = array('completion' => 'unknown', ! 'score' => '0', ! 'rawScore' => '0', ! 'penalty' => '0', ! 'valid' => TRUE, ! 'source' => 'edited sourcce', ! 'options' => 'options string'); ! ! $onSubmit = "</script> ! function EditQ(action) { ! f = document.stackeditqform; ! f.action.value = action; ! f.target = '_self'; ! f.submit(); ! }; ! <script type=".'"'.'text/javascript">'; ! $head = '<script type="text/javascript"> ! window.focus(); ! function EditQ(action) { ! f = document.stackeditqform; ! f.action.value = action; ! f.target = "_self"; ! f.submit(); ! }; ! </script>'; ! $output = array('title' => '', //initially question will have no title ! //remoteCaller = true ! 'body' => stack_question_edit_form_substance($question,&$errors, $namePrefix, TRUE), ! 'stem' => '', ! 'feedback' => '', ! 'response' => '', ! 'answer' => '', ! 'solution' => ''); + $mimetype = 'text/html'; + $files = array(); + } ! else if (!empty($source)) ! { ! //Use existing source to fill in fields within authoring form ! //Import source XML and display question editing form ! ! } } + + //Construct RenderType + $render = array('persistentData' => $persistentData, + 'outcomeVars' => $outcomeVars, + 'onSubmit' => $onSubmit, + 'head' => $head, + 'output' => $output, + 'mimetype' => $mimetype, + 'files' => $files); + return $render; + /*$outcomeVars = array(); *************** *** 1088,1099 **** $output = soap_encode_array($output, 'output', 'output', RQP_URI_NAMESPACE);*/ ! ! ! ! //return array('templateVars' => $templateVars, 'persistentData' => $persistentData, 'outcomeVars'=> $outcomeVars, 'output' => $output); ! return new nbSOAPFault("unimplemented", "The RQP_Renderservice has not been implemented yet", ""); ! // Fill in web method fuctionality here. - // return a RenderDType } --- 1276,1282 ---- $output = soap_encode_array($output, 'output', 'output', RQP_URI_NAMESPACE);*/ ! ! //return new nbSOAPFault("unimplemented", "The RQP_Renderservice has not been implemented yet", ""); // Fill in web method fuctionality here. // return a RenderDType } *************** *** 1101,1108 **** /** * web service provider method RQP_Clone ! * * @param source : string * @param number : int ! * @return CloneDType */ function RQP_Clone($source, $number) --- 1284,1291 ---- /** * web service provider method RQP_Clone ! * * @param source : string * @param number : int ! * @return CloneDType */ function RQP_Clone($source, $number) *************** *** 1640,1644 **** while(list($k, $v)=each($input)) { ! $ret .= $this->soapify_kvPair($v, "kvPair") . "\n"; } } --- 1823,1829 ---- while(list($k, $v)=each($input)) { ! // manual changes to simplify PHP kvPair arrays start here ! $ret .= $this->soapify_kvPair(array("key"=>$k, "val"=>$v) , "kvPair") . "\n"; ! // manual changes to simplify PHP kvPair arrays end here } } *************** *** 1651,1659 **** function desoap_kvPairArray($xml, $idx, $name) { ! $ret = array(); $cidx = $xml->FindChildElement($idx); while($cidx != false) { ! $ret[] = $this->desoap_kvPair($xml, $cidx, "kvPair"); $cidx = $xml->FindNextPeer($cidx); } --- 1836,1847 ---- function desoap_kvPairArray($xml, $idx, $name) { ! $ret = array(); $cidx = $xml->FindChildElement($idx); while($cidx != false) { ! // manual changes to simplify PHP kvPair arrays start here ! $pair = $this->desoap_kvPair($xml, $cidx, "kvPair"); ! $ret[$pair['key']] = $pair['val']; ! // manual changes to simplify PHP kvPair arrays end here $cidx = $xml->FindNextPeer($cidx); } Index: nb_soapfuncs.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/rqp/nb_soapfuncs.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** nb_soapfuncs.php 25 Aug 2005 16:06:18 -0000 1.2 --- nb_soapfuncs.php 30 Aug 2005 10:28:01 -0000 1.3 *************** *** 65,71 **** $startTime = time(); $sock = fsockopen($urldata['host'],$urldata['port'], $errno, $errmsg, $timeLimit); stream_set_timeout($sock, 2); stream_set_blocking($sock, false); ! echo "<pre>".htmlentities($request)."</pre>"; // Uncomment this for debugging if($sock == false) --- 65,77 ---- $startTime = time(); $sock = fsockopen($urldata['host'],$urldata['port'], $errno, $errmsg, $timeLimit); + if($sock==FALSE) + { + $fault = new nbSOAPFault("Server", "Timed out trying to contact server.", "No response from server."); + $fault = "<soap:Body>\n" . $fault->soapify() . "</soap:Body>\n"; + return nbSOAP_Envelope($fault); + } stream_set_timeout($sock, 2); stream_set_blocking($sock, false); ! //echo "<pre>".htmlentities($request)."</pre>"; // Uncomment this for debugging if($sock == false) *************** *** 85,98 **** $cl = strlen($contents); $contents .= fread($sock, 8192); ! /* if(!$headersComplete) { ! $headerEnd = strpos($contents,"\r\n\r\n"); ! if($headerEnd != false) { ! $headersComplete = true; ! $clp = strpos($contents,"Content-Length:"); ! $cle = strpos($contents,"\r\n",$clp); ! $contentLength = intval(trim(substr($contents, $clp+15, $cle-$clp-15))); ! $headerLength = $cle+4; } } --- 91,123 ---- $cl = strlen($contents); $contents .= fread($sock, 8192); ! if(!$headersComplete) { ! //# remove any leading continues ! $headerEnd = strpos($contents,"\r\n\r\n"); ! while(($headerEnd != false)&&(!$headersComplete)) { ! $fle = strpos($contents,"\r\n"); // first line end ! $line = substr($contents, 0, $fle); ! list($protocol, $rcode) = split(" ", $line, 3); ! $rcode = intval($rcode); // ensure its an integer; ! if(($rcode >= 100)&&($rcode <= 199)) // informational, I'm not interested ! { ! $contents = substr($contents, $headerEnd+4); ! $headerEnd = strpos($contents,"\r\n\r\n"); ! } ! elseif($rcode == 200) ! { ! $headersComplete = true; ! $clp = strpos($contents,"Content-Length:"); ! $cle = strpos($contents,"\r\n",$clp); ! $contentLength = intval(trim(substr($contents, $clp+15, $cle-$clp-15))); ! $headerLength = $cle+4; ! } ! else ! { ! $fault = new nbSOAPFault("Server", "An http error was returned, http code $rcode", "An http error was returned, http code $rcode"); ! $fault = "<soap:Body>\n" . $fault->soapify() . "</soap:Body>\n"; ! return nbSOAP_Envelope($fault); ! } } } *************** *** 101,113 **** if(strlen($contents)>=$contentLength+$headerLength) $pageComplete = true; ! } */ $callTime = time()-$startTime; if($callTime >= $timeLimit) $pageComplete = true; ! echo "<p><i><pre>[" . htmlentities($contents) . "]</pre></i></p>"; } fclose($sock); } ! echo "<pre>" . htmlentities($contents) . "</pre>"; // Uncomment this for debugging return $contents; } --- 126,143 ---- if(strlen($contents)>=$contentLength+$headerLength) $pageComplete = true; ! } $callTime = time()-$startTime; if($callTime >= $timeLimit) + { $pageComplete = true; ! $fault = new nbSOAPFault("Server", "Timed out calling server.", "No response, or an incomplete response before the request timed out."); ! $fault = "<soap:Body>\n" . $fault->soapify() . "</soap:Body>\n"; ! return nbSOAP_Envelope($fault); ! } ! //echo "<p><i><pre>[" . htmlentities($contents) . "]</pre></i></p>"; } fclose($sock); } ! //echo "<pre>" . htmlentities($contents) . "</pre>"; // Uncomment this for debugging return $contents; } *************** *** 129,133 **** $sock = fsockopen($urldata['host'],$urldata['port'], $errno, $errmsg, 30); stream_set_blocking($sock, false); ! echo "<pre>".htmlentities($request)."</pre>"; // Uncomment this for debugging if($sock == false) --- 159,163 ---- $sock = fsockopen($urldata['host'],$urldata['port'], $errno, $errmsg, 30); stream_set_blocking($sock, false); ! //echo "<pre>".htmlentities($request)."</pre>"; // Uncomment this for debugging if($sock == false) *************** *** 144,148 **** fclose($sock); } ! echo "<pre>" . htmlentities($contents) . "</pre>"; // Uncomment this for debugging return $contents; --- 174,178 ---- fclose($sock); } ! //echo "<pre>" . htmlentities($contents) . "</pre>"; // Uncomment this for debugging return $contents; |