10 Replies Latest reply on Dec 13, 2017 6:09 AM by paon.m

    PlugIn SDK - Http Request

    paon.m Level 1

      Hi

       

      I developed a CC12 plug-in that sends soap request to a Web Service. To do that I'm using libcurl (curl ) and it works, but to make it work on Mac I have to replace the OS libcul lib with mine, because even if the liburl has been compiled in static_mt the the plug-in try to resolve it  with the OS one. I've tried a different solution like https://pocoproject.org/index.html  but it conflicts with SDK headers (you can resolve it modifing WShukHeaders.h in this way C++ Redefinition Header Files (winsock2.h) - Stack Overflow  but it really sucks as solution ).

      Does anyone know a good solution to make http requests in the plug-in?

      Many thanks in advance.

       

      Massimo

        • 1. Re: PlugIn SDK - Http Request
          Peter Schuelke Level 3

          Hi Massimo,

           

          I'm using curl too and simply integrated the source code after configuration into my project. This avoids your problem and compile time isn't much affected. Maybe you want to choose this option too?

           

          Best, Peter

          • 2. Re: PlugIn SDK - Http Request
            paon.m Level 1

            Hi Peter,

             

            Can you share with me some tips about how do that?  I've tried to add the VS projects present in curl package 'libcurl' and 'curlsrc' to my solution but the linker still serch for an external link whilke compiling my plug-in. I also tried to add the source files from the 'libcurl' project to my project but I get this error :

            Error    1    error C1853: 'C:\Users\paon.m\Desktop\SourceTree\IndesignPlugIn\_built\Indesign_CC_version_2015\\objdx 64\PageBuilderConnector\PageBuilderConnector.pch' precompiled header file is from a previous version of the compiler, or the precompiled header is C++ and you are using it from C (or vice versa)    C:\Users\paon.m\Desktop\SourceTree\IndesignPlugIn\libs\curl-7.37.0\lib\amigaos.c    1    1    PageBuilderConnector

             

            Many thanks in advance

            • 3. Re: PlugIn SDK - Http Request
              Karoly65 Level 1

              Hi Massimo,

               

              You should use static library.

              Check this link:

              http://www.codepool.biz/build-use-libcurl-vs2015-windows.html

               

              // Karoly

              1 person found this helpful
              • 4. Re: PlugIn SDK - Http Request
                paon.m Level 1

                Hi Karoly

                 

                The problem is on Mac, to make the plug-in works I have to copy:
                licurl.a
                libcurl.la
                libcurl.4.dylib
                libcrul.dylib

                 

                in /usr/locol/lib, otherwise Indesign crash. I'm looking for a way to avoid to copy those files

                • 5. Re: PlugIn SDK - Http Request
                  Karoly65 Level 1

                  Hi,

                   

                  Including libcurl in C project - Stack Overflow

                  "3down voteaccepted

                  Mac OS X comes with a copy of libcurl, so your application doesn't need its own copy.

                  You didn't mention the version of Xcode you're using. The following applies to 3.2, but may not work in 4.

                  To use the version of libcurl provided by the system, go to Project, then Add To Project. In the dialog that comes up, type /usr/lib and press enter. Find libcurl.dylib in the list of files and click Add"

                   

                  I use libcurl.4.dylib

                   

                  It works for me.

                   

                  // Karoly

                  • 6. Re: PlugIn SDK - Http Request
                    paon.m Level 1

                    Hi

                     

                    I'm using Xcode 5.0.2 for CC10 and CC11 on MacOs 10.9, Xcode 7.2.1 for CC12 on MacOs 10.11 as per SDK documentation.

                    the problem is I'm using a different version of libcurl that is not the same of the Max OS X one. So if at runtime it links to the libcurl in /usr/lib Indesign crash, putting those libraries in /usr/local/lib resolve the issue because they are taken at runtime instead of the ones in /usr/lib

                    • 7. Re: PlugIn SDK - Http Request
                      Karoly65 Level 1

                      Maybe you need to create separated projects for all CC variation.

                      eg. CC 2014, CC 2015, CC 2017 and CC 2018

                       

                      // Karoly

                      • 8. Re: PlugIn SDK - Http Request
                        paon.m Level 1

                        I have different projects for CC variations.
                        I have tried your solution but Indesign still crashing:

                         

                        Responsible:       Adobe InDesign CC 2017 [58092]
                        User ID:           503

                         

                        Date/Time:         2017-11-03 11:22:23.709 +0100
                        OS Version:        Mac OS X 10.11.5 (15F34)
                        Report Version:    11
                        Anonymous UUID:    1446CAF6-C984-7C03-3F7E-DC4E110D673F

                         

                         

                        Time Awake Since Boot: 85000 seconds

                         

                        System Integrity Protection: enabled

                         

                        Crashed Thread:    0  Dispatch queue: com.apple.main-thread

                         

                        Exception Type:    EXC_BAD_ACCESS (SIGSEGV)
                        Exception Codes:   KERN_INVALID_ADDRESS at 0x0000000000000000
                        Exception Note:    EXC_CORPSE_NOTIFY

                         

                        VM Regions Near 0:

                        -->

                        __TEXT             0000000100775000-000000010077f000 [   40K] r-x/rwx SM=COW  /Applications/Adobe InDesign CC 2017/Adobe InDesign CC 2017.app/Contents/MacOS/Adobe InDesign CC 2017

                         

                        Global Trace Buffer (reverse chronological seconds):

                        1.483033 CFNetwork            0x00007fff96e043cb TCP Conn 0x7fe92a5441d0 SSL Handshake DONE
                        1.484354 CFNetwork            0x00007fff96e043cb TCP Conn 0x7fe92a542bd0 SSL Handshake DONE
                        1.831018 CFNetwork            0x00007fff96e042a7 TCP Conn 0x7fe92a5441d0 starting SSL negotiation
                        1.831143 CFNetwork            0x00007fff96e02c71 TCP Conn 0x7fe92a5441d0 complete. fd: 61, err: 0
                        1.831143 CFNetwork            0x00007fff96e9154b TCP Conn 0x7fe92a5441d0 event 1. err: 0
                        1.831923 CFNetwork            0x00007fff96e042a7 TCP Conn 0x7fe92a542bd0 starting SSL negotiation
                        1.832159 CFNetwork            0x00007fff96e02c71 TCP Conn 0x7fe92a542bd0 complete. fd: 59, err: 0
                        1.832361 CFNetwork            0x00007fff96e9154b TCP Conn 0x7fe92a542bd0 event 1. err: 0
                        2.006383 CFNetwork            0x00007fff96e01f43 TCP Conn 0x7fe92a5441d0 started
                        2.007608 CFNetwork            0x00007fff96e01f43 TCP Conn 0x7fe92a542bd0 started
                        2.236606 CFNetwork            0x00007fff96e043cb TCP Conn 0x7fe934a552b0 SSL Handshake DONE
                        2.237275 CFNetwork            0x00007fff96e043cb TCP Conn 0x7fe92a5441d0 SSL Handshake DONE
                        2.786144 CFNetwork            0x00007fff96e042a7 TCP Conn 0x7fe934a552b0 starting SSL negotiation
                        2.786357 CFNetwork            0x00007fff96e02c71 TCP Conn 0x7fe934a552b0 complete. fd: 61, err: 0
                        2.786598 CFNetwork            0x00007fff96e9154b TCP Conn 0x7fe934a552b0 event 1. err: 0
                        2.791605 CFNetwork            0x00007fff96e042a7 TCP Conn 0x7fe92a5441d0 starting SSL negotiation
                        2.791764 CFNetwork            0x00007fff96e02c71 TCP Conn 0x7fe92a5441d0 complete. fd: 59, err: 0
                        2.791809 CFNetwork            0x00007fff96e9154b TCP Conn 0x7fe92a5441d0 event 1. err: 0
                        2.961898 CFNetwork            0x00007fff96e01f43 TCP Conn 0x7fe934a552b0 started
                        2.967702 CFNetwork            0x00007fff96e01f43 TCP Conn 0x7fe92a5441d0 started
                        9.368071 CFNetwork            0x00007fff96e043cb TCP Conn 0x7fe933452b80 SSL Handshake DONE
                        9.414229 CFNetwork            0x00007fff96e042a7 TCP Conn 0x7fe933452b80 starting SSL negotiation
                        9.414442 CFNetwork            0x00007fff96e02c71 TCP Conn 0x7fe933452b80 complete. fd: 54, err: 0
                        9.414496 CFNetwork            0x00007fff96e9154b TCP Conn 0x7fe933452b80 event 1. err: 0
                        9.462354 CFNetwork            0x00007fff96e01f43 TCP Conn 0x7fe933452b80 started
                        13.257348CFNetwork            0x00007fff96e043cb TCP Conn 0x7fe92d8ab130 SSL Handshake DONE
                        13.359143CFNetwork            0x00007fff96e042a7 TCP Conn 0x7fe92d8ab130 starting SSL negotiation
                        13.359343CFNetwork            0x00007fff96e02c71 TCP Conn 0x7fe92d8ab130 complete. fd: 25, err: 0
                        13.359353CFNetwork            0x00007fff96e9154b TCP Conn 0x7fe92d8ab130 event 1. err: 0
                        13.404259CFNetwork            0x00007fff96e01f43 TCP Conn 0x7fe92d8ab130 started
                        • 9. Re: PlugIn SDK - Http Request
                          Karoly65 Level 1

                          Did you use libcurl.4.dylib for your CC 2017 project?

                           

                          If "yes" in this case I can only guess:

                          1.  you use a wrong system libraries

                               Check: remove all libcurl references from project -> compile - > test

                                           If test is OK  goto point 2.

                          2. your libcurl.4.dylib is wrong for your selected and precompiled Adobe libraries

                              Check your system libraries settings in your project for different xcode versions

                           

                          If I have to guess point 2. your real problem:

                          - installed systemlibraries are mixed in your project (eg. lib path point to a fail  system library version)

                            or

                          - wrong systemlibrary settings (eg. your OSX 10.11 systemlibraries contain fail libraries)

                           

                          // Karoly

                          • 10. Re: PlugIn SDK - Http Request
                            paon.m Level 1

                            I implemented the Peter's solution and it works! It was quite hard compile lib curl with Xcode , if someone needs help about that I could help