Echo >> "Malformed content (from client)"

Nov 28, 2012 at 9:43 PM

 

Pozdrav svima,

Koristeći specificiranu echo metodu (tehnička specfikacija v.1.1):

<tns:EchoRequest xmlns:tns="http://www.apis-it.hr/fin/2012/types/f73" xmlns:xsi=http://www.w3.org/2001/XMLSchema-instancexsi:schemaLocation="http://www.apis-it.hr/fin/2012/types/f73 FiskalizacijaSchema.xsd ">proizvoljan tekst</tns:EchoRequest> 

 

prilikom pozivanja CIS-a, dobijam poruku o greški:

<?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Body><env:Fault><faultcode>env:Client</faultcode><faultstring>Malformed content (from client)</faultstring></env:Fault></env:Body></env:Envelope>

 

U primjerima u istoj specifikaciji, zahtjev sa SAOP envelopom izgleda značajno drugačije (EchoRequest tag):

<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"xmlns:f73="http://www.apis-it.hr/fin/2012/types/f73"><soapenv:Body><f73:EchoRequest>proizvoljan tekst</f73:EchoRequest>    </soapenv:Body></soapenv:Envelope>

Molim vas za savjet zbog čega dolazi do ove pogreške, te kako je riješiti i dobiti očekivanu povratnu informaciju od CIS-a

Dec 9, 2012 at 11:05 PM

Ja sam probao php skriptu i isto dobivam gornju poruku, neovisno koristim li prvi ili drugi primjer echo metode?:

<?php
require_once('nusoaplib/nusoap.php');

$xmlporuka='<tns:EchoRequest xmlns:tns="http://www.apis-it.hr/fin/2012/types/f73"

xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance

xsi:schemaLocation="http://www.apis-it.hr/fin/2012/types/f73 FiskalizacijaSchema.xsd ">proizvoljan

tekst</tns:EchoRequest>';

$url="https://cistest.apis-it.hr:8449/FiskalizacijaServiceTest";

$client = new nusoap_client($url,false);

$odgovor= $client->send($xmlporuka, $url);

foreach($odgovor as $poruke)
echo $poruke." ";

?>

Molim pomoć

Dec 10, 2012 at 10:33 AM
Edited Dec 14, 2012 at 4:11 PM

Odlazna poruka je kod nas ispravljena sa ispravkom ovih potencijalnih uzroka:

* request was not well-formed >> possible existence of ascii format when request is copied directly from PDF

* missing angle cracked or closing tag

* Encoding, language

Samim tim su ispravljeni i eho message i odlazne poruke (za poslovnu jedinicu ili račun), čiji se message UUID uspješno registriraju u bazi prilikom slanja.

---

No, sada prilikom prijema odgovora od CIS-a (i za posl. jedinicu i za račun), koji ne prolazi ni kroz kakvu obradu u kodu, umjeto očekivane poruke sa ili bez poruke o greški, ponovo dobijamo istu - Malformed content (from client) poruku:

<?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Body><env:Fault><faultcode>env:Client</faultcode><faultstring>Malformed content (from client)</faultstring></env:Fault></env:Body></env:Envelope>

/edit/

Ispravljeno, manjim ispravkama u XML poruci...

Dec 10, 2012 at 1:59 PM
Edited Dec 10, 2012 at 2:04 PM

Dobiješ li dobar odgovor za echo kad pošalješ poruku u nastavku?

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:f73="http://www.apis-it.hr/fin/2012/types/f73">
   <soapenv:Header/>
   <soapenv:Body>
      <f73:EchoRequest>super poruka</f73:EchoRequest>
   </soapenv:Body>
</soapenv:Envelope>

Očekivani odgovor:

<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
      <tns:EchoResponse xsi:schemaLocation="http://www.apis-it.hr/fin/2012/types/f73 FiskalizacijaSchema.xsd " xmlns:tns="http://www.apis-it.hr/fin/2012/types/f73">super poruka</tns:EchoResponse>
   </soap:Body>
</soap:Envelope>

Dec 10, 2012 at 2:02 PM

Dobiješ li dobar odgovor za račun kad pošalješ poruku u nastavku? Ovo je copy/paste primjera iz tehničke specifikacije upravo poslan i odgovor koji se dobije. Isto je i s echo primjerom navedenim prije.

 

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<tns:RacunZahtjev xmlns:tns="http://www.apis-it.hr/fin/2012/types/f73"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Id="racunId"
xsi:schemaLocation="http://www.apis-it.hr/fin/2012/types/f73 ../schema/FiskalizacijaSchema.xsd">
<tns:Zaglavlje>
<tns:IdPoruke>f81d4fae-7dec-11d0-a765-00a0c91e6bf6</tns:IdPoruke>
<tns:DatumVrijeme>01.09.2012T21:10:34</tns:DatumVrijeme>
</tns:Zaglavlje>
<tns:Racun>
<tns:Oib>98765432198</tns:Oib>
<tns:USustPdv>true</tns:USustPdv>
<tns:DatVrijeme>01.09.2012T21:10:34</tns:DatVrijeme>
<tns:OznSlijed>P</tns:OznSlijed>
<tns:BrRac>
<tns:BrOznRac>123456789</tns:BrOznRac>
<tns:OznPosPr>POSL1</tns:OznPosPr>
<tns:OznNapUr>12</tns:OznNapUr>
</tns:BrRac>
<tns:Pdv>
<tns:Porez>
<tns:Stopa>25.00</tns:Stopa>
<tns:Osnovica>10.00</tns:Osnovica>
<tns:Iznos>2.50</tns:Iznos>
</tns:Porez>
<tns:Porez>
<tns:Stopa>10.00</tns:Stopa>
<tns:Osnovica>10.00</tns:Osnovica>
<tns:Iznos>1.00</tns:Iznos>
</tns:Porez>
<tns:Porez>
<tns:Stopa>0.00</tns:Stopa>
<tns:Osnovica>10.00</tns:Osnovica>
<tns:Iznos>0.00</tns:Iznos>
</tns:Porez>
</tns:Pdv>
<tns:Pnp>
<tns:Porez>
<tns:Stopa>3.00</tns:Stopa>
<tns:Osnovica>10.00</tns:Osnovica>
<tns:Iznos>0.30</tns:Iznos>
</tns:Porez>
</tns:Pnp>
<tns:OstaliPor>
<tns:Porez>
<tns:Naziv>Porez na luksuz</tns:Naziv>
<tns:Stopa>15.00</tns:Stopa>
<tns:Osnovica>10.00</tns:Osnovica>
<tns:Iznos>1.50</tns:Iznos>
</tns:Porez>
</tns:OstaliPor>
<tns:IznosOslobPdv>12.00</tns:IznosOslobPdv>
<tns:IznosMarza>13.00</tns:IznosMarza>
<tns:IznosNePodlOpor>100.00</tns:IznosNePodlOpor>
<tns:Naknade>
<tns:Naknada>
<tns:NazivN>Povratna naknada</tns:NazivN>
<tns:IznosN>1.00</tns:IznosN>
</tns:Naknada>
</tns:Naknade>
<tns:IznosUkupno>145.68</tns:IznosUkupno>
<tns:NacinPlac>K</tns:NacinPlac>
<tns:OibOper>01234567890</tns:OibOper>
<tns:ZastKod>e4d909c290d0fb1ca068ffaddf22cbd0</tns:ZastKod>
<tns:NakDost>false</tns:NakDost>
<tns:ParagonBrRac>123/458/5</tns:ParagonBrRac>
<tns:SpecNamj>Navedeno kao primjer</tns:SpecNamj>
</tns:Racun>
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
<SignedInfo>
<CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
<SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
<Reference URI="#racunId">
<Transforms>
<Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
<Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
</Transforms>
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
<DigestValue>VItfxY/A1BITZ/BuWpsGd9gKix4=</DigestValue>
</Reference>
</SignedInfo>
<SignatureValue>0+5UDLzJuGy56HojH510+dX6VurJmL52Ob7FDNNH8U3Nltxlo7fUvU1ra6HPSyCd4H3O
QEvZIb3xv1yqvLGYr0M5yzVGbu9o4IXG3qlTTVtEWu1MCC7OYeyltnKwr9/QRAbFrA3QWZu/F8qnc4dKg6o
hl8X8hZLLh2wIzNxtOrzbtJO6lZciCyfptR6u1vvwmUxIlo7ISCTLXw/UC9LqC86C5HBbQU+QT1i9rTsUdYZZ0
kTel4Z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U1P
MQ0wCwYDVQQDEwRDUkw3MH2ge6B5hk9sZGFwOi8vZGVtby1sZGFwLmZpbmEuaHIvb3U9REVNTyxv
PUZJTkEsYz1IUj9jZXJ0aWZpY2F0ZVJldm9jYXRpb25MaXN0JTNCYmluYXJ5hiZodHRwOi8vZGVtby1wa2
kuZmluYS5oci9jcmwvZGVtb2NhLmNybDArBgNVHRAEJDAigA8yMDEyMDkyNzEwNDkxOFqBDzIwMTQw
OTI3MTExOTE4WjAfBgNVHSMEGDAWgBR6YCOOSJ0ya6TlLd24WbSU/EJinjAdBgNVHQ4EFgQUK/IWm
nKEKdD/PLV06CddkYi7WrAwCQYDVR0TBAIwADANBgkqhkiG9w0BAQUFAAOCAQEAABb3RnPlwEBNK
EWy3YsFRwJSZoMTBGwv7Q0sWf9nTHMS3vgFqNUSx8iqP99tnoppav7TdWoQ5zBtW935Nkev7rhqGADT
4R/7pYeYc2R+Yjsbn6rxo6zDv/oIrd8LtFHccx3iUYgt/n1J5QiGIQ601fXwYftuaVcaMnwsVBCuFy8vut4PiSPVs
fML/R/oLQ3IqKJmNMXy4Rm8qjeOdgLyYwTuz7oKZ+N4+kq4tpuuJn86EUk3qsQo+FOVfwFi7cew7qtDYHap
qAC4zTb6isqB8/Wcagucb4zNU3Vgeixz5Nsd
8g28hcC/OzhHHGZpQvB0WVF5YlF1Od7AYBL+DDI9Lg==</X509Certificate>
<X509IssuerSerial>
<X509IssuerName>OU=DEMO,O=FINA,C=HR</X509IssuerName>
<X509SerialNumber>1053495513</X509SerialNumber>
</X509IssuerSerial>
</X509Data>
</KeyInfo>
</Signature>
</tns:RacunZahtjev>
</soapenv:Body>
</soapenv:Envelope>

 

Očekivani odgovor:

 

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soap:Body>
      <tns:RacunOdgovor Id="G0xc579f080-4D" xsi:schemaLocation="http://www.apis-it.hr/fin/2012/types/f73 ../schema/FiskalizacijaSchema.xsd " xmlns:tns="http://www.apis-it.hr/fin/2012/types/f73">
         <tns:Zaglavlje>
            <tns:IdPoruke>f81d4fae-7dec-11d0-a765-00a0c91e6bf6</tns:IdPoruke>
            <tns:DatumVrijeme>10.12.2012T14:59:18</tns:DatumVrijeme>
         </tns:Zaglavlje>
         <tns:Greske>
            <tns:Greska>
               <tns:SifraGreske>s004</tns:SifraGreske>
               <tns:PorukaGreske>Neispravan digitalni potpis.</tns:PorukaGreske>
            </tns:Greska>
         </tns:Greske>
         <Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
            <SignedInfo>
               <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/>
               <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
               <Reference URI="#G0xc579f080-4D">
                  <Transforms>
                     <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
                     <Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/>
                  </Transforms>
                  <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
                  <DigestValue>xLb15u4pLL8RkHMKYoIzVcKfydA=</DigestValue>
               </Reference>
            </SignedInfo>
            <SignatureValue>OxwhxWJWOGM1FXyJdwYHOFWjBMEsUpSohxHxA4CBBb3tHN0F7NU4+GIJ9KmODCcPh0Igmpl1795WdGhCTwUOpbno/ZEwTvdUoKL2LLiCXteh449N1t94ccAgE431P2rmD3q+p2l7hVpjLLITvRYSL+Mlv/Ud/jcYeK5l9oXj8WAtvGtP96ObDkuM8PHoBd+W+q4iwEg5/PxuLZRJ+NXtb03HmfCAAJ1kwUIlZzdBvpBbMqd1twXiP1DqgAVq/abNXVwwuC5QtXV4LNw4MpS/84rVGOyUn48YULUb+1BqGbkmgC9lQoLa5adJt+7CsHGLT8igkRhPEr/JFwuM1mBgnw==</SignatureValue>
            <KeyInfo>
               <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HA6Ly9kZW1vLXBraS5maW5hLmhyL2NybC9kZW1vY2EuY3JsMCsGA1UdEAQkMCKADzIwMTIwOTI2MDgxMTQ5WoEPMjAxNDA5MjYwODQxNDlaMB8GA1UdIwQYMBaAFHpgI45InTJrpOUt3bhZtJT8QmKeMB0GA1UdDgQWBBRgIJsZevSn6kDuSzChmaa9Sqr6sjAJBgNVHRMEAjAAMA0GCSqGSIb3DQEBBQUAA4IBAQCo5kJWaNjgS+UG7XQHsHersDFk4K5W/Y2Pbubary0j3IwJrveHbUR3HOb0KiVenF6+1FL3sCI/2tfH3wSszWL8Gkit8jUudTo5vDyLqEUXYDHlFUBwseudsPkUxPiQ6HuuFd3PiUAWf00chXD38eTjfapNu6VeQt4EORSO+rEXdhWihVb5HxFIVPTkqHmq1KINwtV9+thwE3hNMwacRa4gwTB1O+jadVlJQMq+kgwnLGLBcwr0W+x1ye6MPSYEUxSNFGHPG/evP9DRLwJtR3ngvlCDusnO+A75Nn40VYcoIjw6EN1V+plK+HkLye0zzLsnHIWTSGfZ2sQVG5xCURiI</X509Certificate>
                  <X509IssuerSerial>
                     <X509IssuerName>OU=DEMO, O=FINA, C=HR</X509IssuerName>
                     <X509SerialNumber>1053495409</X509SerialNumber>
                  </X509IssuerSerial>
               </X509Data>
            </KeyInfo>
         </Signature>
      </tns:RacunOdgovor>
   </soap:Body>
</soap:Envelope>

Dec 11, 2012 at 7:11 AM

Da, koristeći php skriptu navedenu u diskusiji:http://fiskalizacija.codeplex.com/discussions/404944
dobijem odgovor na poslanu ECHO metodu.
Međutim primjer u APIS-ovom manualu je skroz drukčiji ...
Idesh, zahvaljujem na pomoći! Ja sam uzeo APIS-ov primjer zdravo za gotovo, ali to izgleda za php ne funkcionira.
Ako znaš napiši koja je razlika između APIS-ovog upita i ovog tvog.
Pomoći će ljduima koji nisu doma s ovim naprednim stvarima.

 

 

Dec 14, 2012 at 3:45 PM

Pozdrav svima...

Evo lurkam malo po vasim razgovorima, i pokusao sam dobiti bilo kakav odgovor od njihovih servera, ali na ovaj primjer koji je stavio purger, ne dobijem apsolutno nikakav odgovor...

<?php 
require_once('nusoaplib/nusoap.php');

$xmlporuka='<tns:EchoRequest xmlns:tns="http://www.apis-it.hr/fin/2012/types/f73"

xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance

xsi:schemaLocation="http://www.apis-it.hr/fin/2012/types/f73 FiskalizacijaSchema.xsd ">proizvoljan

tekst</tns:EchoRequest>';

$url="https://cistest.apis-it.hr:8449/FiskalizacijaServiceTest";

$client = new nusoap_client($url,false);

$odgovor= $client->send($xmlporuka, $url);

foreach($odgovor as $poruke)
echo $poruke." ";

?>

 

Hvala svima...

Dec 14, 2012 at 3:50 PM

Tj da li si koristio ovaj nusoap plugin? http://sourceforge.net/projects/nusoap/?source=dlp

Hvala