3 Replies Latest reply on Mar 2, 2010 12:35 PM by DavidMcDivitt

    read a string variable from remote URL

    DavidMcDivitt

      I have a simple web service. I'm using remoteUrl in the request XML to read a string variable. How do I format the file corresponding to the remore URL? It should be XML. What is the syntax so information will transfer into the string variable of the Adobe process? Thanks

        • 1. Re: read a string variable from remote URL
          Steve L Walker Level 5

          Are you referring to calling an external "simple web service" via the Web Service Foundation service, where the SOAP response includes an XML document that you need to coerce to a string?

           

          Steve

          • 2. Re: read a string variable from remote URL
            DavidMcDivitt Level 1

            Steve,

             

            Pasted below are two VBScript files used to test the Adobe webservice, and their results. Also pasted is TemplateName.ref which is referenced in 009.vbs. The difference between 004 and 009 is use of an additional string variable by the process on the Adobe server, 004 works OK. 009 does not. I don't know what to put in the file TemplateName.ref. If I just put "/GenericProcesses/Templates/TravelVoucher.xdp" in the file without surrounding it with tags, the XML returned says "xmldata: Content is not allowed in prolog., cause: Content is not allowed in prolog." If I do use tags the XML returned shows nothing happened in the Adobe process and no PDF was generated. It also comes back too quickly to have created a PDF.

             

            For 009.vbs, <template_name> equates to a string variable in the Adobe process and the file TemplateName.ref needs to contain what should go into the string variable. Thanks

             

            ---- 004.vbs ----------------------------------------------------------------------

            dim fs,writer,xml
            xml = "<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"">" & _
                    "<soapenv:Body>" & _
                      "<intf:invoke xmlns:intf=""http://adobe.com/idp/services?wsdl"">" & _
                        "<travel_voucher_xml>" & _
                          "<remoteURL>http://j11070:82/travel/test/FY10_IN-STATE_LC_XSD.xml</remoteURL>" & _
                        "</travel_voucher_xml>" & _
                      "</intf:invoke>" & _
                    "</soapenv:Body>" & _
                  "</soapenv:Envelope>"

             

            'set req = createobject("MSXML2.ServerXMLHTTP.3.0")
            set req = createobject("Microsoft.XMLHTTP")
            req.open "POST", "http://d97510:8080/soap/services/DHSIP01Travel", false
            req.setrequestheader "Content-Type", "application/soap+xml; charset=UTF-8"
            req.setrequestheader "SOAPAction","invoke"
            req.send xml
            set fs = createobject("Scripting.FileSystemObject")
            set writer = fs.createtextfile(".\004.xml",true)
            writer.Write req.responseText
            writer.close
            msgbox "done"

            ---- 004.xml  ----------------------------------------------------------------------

            <soapenv:Envelope>
            <soapenv:Body>
            <invokeResponse>
            <ns1:travel_voucher_PDF>
            <ns1:contentType>application/pdf</ns1:contentType>
            <ns1:remoteURL>
            http://d97510:8080/DocumentManager/docm1267191625562/2deeb111db3da8af13c634d79c2b3966?type =YXBwbGljYXRpb24vcGRm
            </ns1:remoteURL>
            </ns1:travel_voucher_PDF>
            </invokeResponse>
            </soapenv:Body>
            </soapenv:Envelope>

            ---- 009.vbs  ----------------------------------------------------------------------

            dim fs,writer,xml
            xml = "<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"">" & _
                    "<soapenv:Body>" & _
                      "<intf:invoke xmlns:intf=""http://adobe.com/idp/services?wsdl"">" & _
                        "<template_name>" & _
                          "<remoteURL>http://j11070:82/travel/test/TemplateName.ref</remoteURL>" & _
                        "</template_name>" & _
                        "<template_xml>" & _
                          "<remoteURL>http://j11070:82/travel/test/FY10_IN-STATE_LC_XSD.xml</remoteURL>" & _
                        "</template_xml>" & _
                      "</intf:invoke>" & _
                    "</soapenv:Body>" & _
                  "</soapenv:Envelope>"

             

            set req = createobject("Microsoft.XMLHTTP")
            req.open "POST", "http://d97510:8080/soap/services/DHSIP01Travel", false
            req.setrequestheader "Content-Type", "application/soap+xml; charset=UTF-8"
            req.setrequestheader "SOAPAction","invoke"
            req.send xml
            set fs = createobject("Scripting.FileSystemObject")
            set writer = fs.createtextfile(".\009.xml",true)
            writer.Write req.responseText
            writer.close
            msgbox "done"

            ---- TemplateName.ref -------------------------------------------------------------------

            <?xml version="1.0" encoding="UTF-8"?>
            <template_name>/GenericProcesses/Templates/TravelVoucher.xdp</template_name>

            ---- 009.xml  ----------------------------------------------------------------------

            <soapenv:Envelope>
            <soapenv:Body>
            <invokeResponse/>
            </soapenv:Body>
            </soapenv:Envelope>

            • 3. Re: read a string variable from remote URL
              DavidMcDivitt Level 1

              This is resolved by the following syntax in the VBScript file. There were issues with the server preventing the process from running correctly. A remote URL is not needed. The string value should be placed directly between the XML tags that name the string in the process.

               

              dim fs,writer,xml
              xml = "<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"">" & _
                      "<soapenv:Body>" & _
                        "<intf:invoke xmlns:intf=""http://adobe.com/idp/services?wsdl"">" & _
                          "<template_name>/GenericProcesses/Templates/TravelVoucher.xdp</template_name>" & _
                          "<template_xml>" & _
                            "<remoteURL>http://j11070:82/travel/test/TravelVoucher.xml</remoteURL>" & _
                          "</template_xml>" & _
                        "</intf:invoke>" & _
                      "</soapenv:Body>" & _
                    "</soapenv:Envelope>"

               

              set req = createobject("Microsoft.XMLHTTP")
              req.open "POST", "http://d97510:8080/soap/services/GenericTemplatePrint", false
              req.setrequestheader "Content-Type", "application/soap+xml; charset=UTF-8"
              req.setrequestheader "SOAPAction","invoke"
              req.send xml
              set fs = createobject("Scripting.FileSystemObject")
              set writer = fs.createtextfile(".\009.xml",true)
              writer.Write req.responseText
              writer.close
              msgbox "done"