Please support our RSS, Web Services and SOAP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Reply

Join Date: Jul 2009
Posts: 1
Reputation: keizersoz is an unknown quantity at this point 
Solved Threads: 0
keizersoz keizersoz is offline Offline
Newbie Poster

Float truncated

 
0
  #1
Jul 7th, 2009
Hello all, In my WSDL I defined a float
RSS, Web Services and SOAP Syntax (Toggle Plain Text)
  1. <xsd:complexType name="M01_rowType">
  2. <xsd:sequence>
  3. <xsd:element name="helpdTTSAvg" type="xsd:float"/>
  4. </xsd:sequence>
  5. </xsd:complexType>
  6. <xsd:complexType name="M01_tableType">
  7. <xsd:sequence>
  8. <xsd:element name="helpdTTSVal" minOccurs="0" maxOccurs="unbounded" type="tns:M01_rowType"/>
  9. </xsd:sequence>
I can also see from PHP that I received float values, however SOAP truncates the float to integer, whereas for instance 3.06 is trucated to 3. Does someone has any idea how this can happen?

my php is defined as follows

RSS, Web Services and SOAP Syntax (Toggle Plain Text)
  1. $strQuery="SELECT \n".
  2. "ROUND(AVG(CalculateDateDiffHD(C.CALL_DATE, C.DATE_CLOSED)/60),2) AS TTS_TT \n".
  3. "FROM \n".
  4. "CALLS C \n".
  5. "WHERE \n".
  6. "TO_CHAR(C.CALL_DATE,'YYYY-MM')= TO_CHAR(CURRENT_DATE,'YYYY-MM') \n";
  7.  
  8.  
  9. $stmt = OCIParse($db, $strQuery);
  10. OCIExecute($stmt);
  11.  
  12. $helpdTTS=new stdClass;
  13. $helpdTTS->helpdTTSList=array();
  14. $index=0;
  15.  
  16. while (ocifetchinto($stmt, $arrResult, OCI_ASSOC)) { // meaning returns associative array, removed null values, function depprecated
  17. $helpdTTSVal=new stdClass;
  18. $helpdTTSVal->helpdTTSAvg=$arrResult["TTS_TT"]*1;
  19. $helpdTTS->helpdTTSList["helpdTTSVal"][$index]=$helpdTTSVal;
  20. }
  21.  
  22. return $helpdTTS;

many thanks in advance,
regards
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC