Domino 9 und frühere Versionen > ND8: Entwicklung

Fließkommazahlenformat beim Webservice

(1/1)

Mitch:
Hallo zusammen,

mein Webservice trennt Fließkommazahlen (Double) mit einem Komma anstatt einem Punkt.

Ich möchte aber immer einen Punkt haben. Mein Notes-Client zieht sich den Trenner aus dem Betriebssystem, das habe ich gerade mal ausprobiert. Da das z.B. auch bei bestehenden Dokumenten mit Zahlen-Items je nach Einstellung sauber hin und her wechselt, scheint Notes das ja intern ordentlich zu speichern. Mein (lokaler) Server ignoriert meine Systemeinstellungen aber.

Fragen:


* Kann ich entwicklerseitig eine einheitliche Ausgabe (Punkt) erzwingen? Schließlich können ja unterschiedliche Kunden unterschiedliche Systeme einsetzen...
* Woher zieht der Server sein Trennzeichen? Der Testserver läuft bei mir lokal, interessiert sich aber nicht an meinen Betriebssystemeinstellungen...
Mein Service sieht so aus:

--- Code: ---Class DoubleService

Function giveDouble As Double
giveDouble = 9.99
End Function

End Class
--- Ende Code ---

Als Antwort erhalte ich folgendes:

--- Code: ---<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
   <soapenv:Body>
      <ns1:GIVEDOUBLEResponse xmlns:ns1="urn:DefaultNamespace">
         <GIVEDOUBLEReturn>9,99</GIVEDOUBLEReturn>
      </ns1:GIVEDOUBLEResponse>
   </soapenv:Body>
</soapenv:Envelope>
--- Ende Code ---

Mein WSDL:

--- Code: ---<?xml version="1.0" encoding="UTF-8"?>
<definitions targetNamespace="urn:DefaultNamespace"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:impl="urn:DefaultNamespace"
xmlns:intf="urn:DefaultNamespace"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
 <wsdl:types>
  <schema targetNamespace="urn:DefaultNamespace" xmlns="http://www.w3.org/2001/XMLSchema">
   <element name="GIVEDOUBLE">
    <complexType/>
   </element>
   <element name="GIVEDOUBLEResponse">
    <complexType>
     <sequence>
      <element name="GIVEDOUBLEReturn" type="xsd:double"/>
     </sequence>
    </complexType>
   </element>
  </schema>
 </wsdl:types>
 <message name="GIVEDOUBLEResponse">
  <part element="impl:GIVEDOUBLEResponse" name="parameters"/>
 </message>
 <message name="GIVEDOUBLERequest">
  <part element="impl:GIVEDOUBLE" name="parameters"/>
 </message>
 <portType name="DoubleService">
  <operation name="GIVEDOUBLE">
   <input message="impl:GIVEDOUBLERequest" name="GIVEDOUBLERequest"/>
   <output message="impl:GIVEDOUBLEResponse" name="GIVEDOUBLEResponse"/>
  </operation>
 </portType>
 <binding name="DominoSoapBinding" type="impl:DoubleService">
  <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
  <operation name="GIVEDOUBLE">
   <wsdlsoap:operation soapAction="GIVEDOUBLE"/>
   <input name="GIVEDOUBLERequest">
    <wsdlsoap:body use="literal"/>
   </input>
   <output name="GIVEDOUBLEResponse">
    <wsdlsoap:body use="literal"/>
   </output>
  </operation>
 </binding>
 <service name="DoubleServiceService">
  <port binding="impl:DominoSoapBinding" name="Domino">
   <wsdlsoap:address location="http://localhost"/>
  </port>
 </service>
</definitions>
--- Ende Code ---

Beste Grüße,

Mitch

m3:
http://atnotes.de/index.php/topic,56418.0.html

Mein Rant dazu aus 2007: http://martin.leyrer.priv.at/y2007/m08/Web_Services_with_Domino-Working_around_the_GetValueAsNotesDateTime_bug.html

Mitch:
Ohje. Danke.

Schöner Workaround aus dem APAR: Use Java. >:(

Gesendet von meinem Nexus 7 mit Tapatalk 4

Navigation

[0] Themen-Index

Zur normalen Ansicht wechseln