1 Reply Latest reply on Mar 13, 2014 6:35 AM by bqui

    SOAP issues



      I'm new to this comunity.

      And I'm not shure if this is the right place for my question...


      This discussion was in 'Acrobat SDK', but now I think it's better in this forum...



      I'm working with Acrobat pro 11.0.06 on Mac OS X 10.8.5


      I try to connect from a PDF to a webservice via SOAP to get a database connection.

      The script sends some data to the service and expects a response with product data.


      The webservice is written in PHP.

      When I connect to the service via a php-script it works fine.


      This is the JavaScript function that calls the webservice:


      function getData()


                var vartnr = "123456789";

                var vartnr_teil = "";//"3456789";

                var vpreis = "";//"0,36";


                try {

                          SOAP.wireDump = "true";


                          var strURL = "http://test.mydomain.de/webservice.wsdl";

                          var service = SOAP.connect(strURL);

                          var thedata = {

                                    artnr: vartnr,

                                    artnr_teil: vartnr_teil,

                                    preis: vpreis


                          var results = service.getData(thedata);











      When the script is running, I get an error message:

      'SOAPError: SOAP-ERROR: Encoding: Violation of encoding rules'.


      In the JavaScript-debugger of Acrobat I see the following message:


      <?xml version="1.0"?>

      <SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">


                          <ns0:getData SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns0="urn:getData">


                                              <artnr xsi:type="xsd:string">123456789</artnr>

                                              <artnr_teil xsi:type="xsd:string"></artnr_teil>

                                              <preis xsi:type="xsd:string"></preis>


                                    <artnr_teil xsi:nil="true"/>

                                    <preis xsi:nil="true"/>






      <?xml version="1.0" encoding="UTF-8"?>

      <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">




                                    <faultstring>SOAP-ERROR: Encoding: Violation of encoding rules</faultstring>






      The first XML seems to represent the data that Acrobat sends to the webservice. The second XML seems to be the answer of the service.


      I don't know what exactly this means... where to look for the fault script...


      I see, that there is a bug in the first XML: '<artnr>' is closed twice.

      But this XML is generated throu the SOAP-object of Acrobat. So, I don't know how to change it.


      Any suggestions what to do?


        • 1. Re: SOAP issues
          bqui Level 1

          Hello again,


          now I tried the same with Acobat pro 7 (7.1.0) on Windows XP.


          I got the same result: 'SOAP-ERROR: Encoding: Violation of encoding rules'.


          Mybe there are some lines in the wsdl-file, that cause this problem:


          <?xml version ='1.0' encoding ='UTF-8' ?>

          <definitions name='myService'









                    <message name='addRequest'>

                              <part name='artnr' type='xsd:string'/>

                              <part name='artnr_teil' type='xsd:string'/>

                              <part name='preis' type='xsd:string'/>


                    <message name='addResponse'>

                              <part name='result' type='xsd:string'/>



                    <portType name='addPortType'>

                              <operation name='getData'>

                                        <input message='tns:addRequest'/>

                                        <output message='tns:addResponse'/>




                    <binding name='addBinding' type='tns:addPortType'>

                              <soap:binding style='rpc'


                              <operation name='getData'>

                                        <soap:operation soapAction='urn:myserver#getData'/>


                                                  <soap:body use='encoded' namespace='urn:getData'




                                                  <soap:body use='encoded' namespace='urn:getData'






                    <service name='addService'>

                              <port name='addPort' binding='addBinding'>

                                        <soap:address location='http://test.mydomain.de/myserver.php'/>






          So again: Any suggestions what to do?