Skip to main content

Response

What answers do I receive during the PDF request?

The type of response depends on the value of the <valaszVerzio> variable sent in the request.

  • if it is 1 or not set, the response will be a PDF file
  • if it is 2, the response will be an XML file

In both cases the parameters will be in the header.

PDF response

There are two kinds of answers:

  • In case everything goes well, the response is a PDF file, that is the invoice itself.
  • In case there is an error, you will receive one or more error messages.

The format of the error message will be as it can be as seen below. The part between [ERR] and ------------ is important.

[ERR] Számla mentés sikertelen. Már létező rendelésszám: XX. ---------- t.getMessage(): Már létező rendelésszám:
XX. ---------- [CEG:978] [MODUL:SZAMLAZZGUI] [INSTANCE:hu.kboss.szamlazz.gui.action.AcXmlSzamla] Már létező rendelésszám: XX.[LOCATION:hu.kboss.szamlazz.api.bean.SzFej.insert (SzFej.java) #1700]
hu.kboss.szamlazz.api.bean.SzFej.insert(SzFej.java:1700)
hu.kboss.szamlazz.gui.action.AcXmlSzamla.performAction(AcXmlSzamla.java:242)
hu.kboss.szamlazz.controller.Controller.executeAction(Controller.java:715)
hu.kboss.szamlazz.controller.Controller.doGet(Controller.java:468)
hu.kboss.szamlazz.controller.Controller.doPost(Controller.java:639)
javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:200)
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:307)
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
java.lang.Thread.run(Thread.java:662)

XML response

The structure of the response will be different since it is an XML, but the logic behind it is similar. Besides the XML in the header, the above-mentioned parameters are included as well. The invoice PDF is in the XML between the <pdf></pdf> tags with base64 encoding. An example XML response in the case of a successful request:

<?xml version="1.0" encoding="UTF-8"?>
<xmlszamlavalasz xmlns="http://www.szamlazz.hu/xmlszamlavalasz" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<sikeres>true</sikeres>
<szamlaszam>XXX-2012-3</szamlaszam>
<szamlanetto>30000</szamlanetto>
<szamlabrutto>38100</szamlabrutto>
<pdf>JVBERi0xLjQKJdDUxdgKMSAwIG9iago8PCAvUyAvR29UbyAvRCBbMiAwIFIgIC9GaXQgXSA+Pgpl
bmRvYmoKNCAwIG9iaiA8PAovTGVuZ3RoIDE4MDggICAgICAKL0ZpbHRlciAvRmxhdGVEZWNvZGUK
Pj4Kc3RyZWFtCnjaxVjLbttGFN37K7gpQAHlZN4P72zUTpvATVu72aRZqBLtKHqlEm0jAor8es88
RJESLduRgXoRTTjDO+fee+6LNLvJaPb66PTq6NU5c5kjTnOdXV1nmhJnMqMEMUJkV8PsQ85I7+PV
m1fntnGMCSKEg4xw4kuP2/wvykVPGp6Xk2FYK0rz/sxvfe0VQgicULRclMOyGmHJegVXxtH8crU5
Pp30l83/HvcKxrH66fXrglPGC+GxHNGEf/sXyuiMS2KsYQGmsUQLmxVcE6VtRHu56iW0SqlwZafM
....
MDAwMDg2NTIxIDAwMDAwIG4gCjAwMDAwODY2NTcgMDAwMDAgbiAKMDAwMDA4NjY5MyAwMDAwMCBu
IAowMDAwMDg2Nzk4IDAwMDAwIG4gCnRyYWlsZXIKPDwgL1NpemUgNDIKL1Jvb3QgNDAgMCBSCi9J
bmZvIDQxIDAgUgovSUQgWzxENDhERjNFQTdFM0MwQ0QyNDY0RUIzNzYwRTJBQzdBRj4gPEQ0OERG
M0VBN0UzQzBDRDI0NjRFQjM3NjBFMkFDN0FGPl0gPj4Kc3RhcnR4cmVmCjg3MTIzCiUlRU9G</pdf>
</xmlszamlavalasz>

An example response in the case of an unsuccessful request

<?xml version="1.0" encoding="UTF-8"?>
<xmlszamlavalasz xmlns="http://www.szamlazz.hu/xmlszamlavalasz" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<sikeres>false</sikeres>
<hibakod>3</hibakod>
<hibauzenet><![CDATA[Bejelentkezési hiba - a megadott login név és jelszó pároshoz nem létezik
felhasználó]]></hibauzenet>
</xmlszamlavalasz>

The response complies with the following XSD

<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.szamlazz.hu/xmlszamlavalasz" xmlns:tns="http://www.szamlazz.hu/xmlszamlavalasz" elementFormDefault="qualified">
<complexType name="szamlavalasz">
<sequence>
<element name="sikeres" type="boolean" maxOccurs="1" minOccurs="1"></element>
<element name="hibakod" type="string" maxOccurs="1" minOccurs="0"></element>
<element name="hibauzenet" type="string" maxOccurs="1" minOccurs="0"></element>
<element name="szamlaszam" type="string" maxOccurs="1" minOccurs="0"></element>
<element name="szamlanetto" type="double" maxOccurs="1" minOccurs="0"></element>
<element name="szamlabrutto" type="double" maxOccurs="1" minOccurs="0"></element>
<element name="kintlevoseg" type="double" maxOccurs="1" minOccurs="0"></element>
<element name="vevoifiokurl" type="string" maxOccurs="1" minOccurs="0"></element>
<element name="pdf" type="base64Binary" maxOccurs="1" minOccurs="0"></element>
</sequence>
</complexType>

<element name="xmlszamlavalasz" type="tns:szamlavalasz"></element>

</schema>