Forum Discussion

Dheepha's avatar
Dheepha
Contributor
12 years ago

integrating soapui with QC 11 using Scriptom or ActiveX

Hi,

I'm trying to integrate soapui 4.0.0 with QC using groovy script.
I followed the steps provided in below sites to connect to QC by scriptom and Activex.

http://stackoverflow.com/questions/1872 ... ith-soapui
viewtopic.php?f=2&t=22960

But im getting the same error like
"com.jacob.com:ComFailException:Invokeof:InitConnectionEx"
Source:
Description:Invalid Server response

And my sample code looks like below

Scriptom:
import org.codehaus.groovy.scriptom.*
import com.jacob.activeX.ActiveXComponent
import com.jacob.com.*
Scriptom.inApartment
{
def tdc = new ActiveXObject ('TDApiOle80.TDConnection')
tdc.InitConnectionEx('http://servername:port/qcbin/start_a.jsp')
tdc.Login('Loginname', 'pwd')
tdc.Connect('Domain','Project')
}

Activex:
import org.codehaus.groovy.scriptom.*
import com.jacob.activeX.ActiveXComponent
import com.jacob.com.*
def QCUrl = "http://10.8.236.54:8080/qcbin/start_a.jsp"
def QCcom = new ActiveXComponent("TDApiOle80.TDConnection")
def conQC = QCcom.getObject()
Dispatch.call(conQC, 'InitConnectionEx', QCUrl)

Could anyone please let me know what to do next?

Thanks,
Dheepha

9 Replies

  • Hi,

    I did the same and did not face any issues. I was able to connect to QC. Could you please check again the configurations like placing Jar files in respective folders etc. If everything is in place, check the QC server is up and running.
  • Hi,

    I just checked the jar files. I'm pretty confused about the jars now, as in many post said one version of jar files to be placed in bin , ext, and lib folders.

    Here by i'm, providing the screen shot of my bin, ext and lib folders. Any one who has executed successfully please check whether I have placed the jar files in correct location.

    You can find too many jars in same place with diff version, as i got to know from diff posts.

    Pls update me about the correct jars and dll's to be placed in the right folder also.

    Thanks,
    Dheepha
  • Hi,

    It looks like some messy happened, i see duplicate files. Could you please follow the below steps and try again.

    1. Uninstall the soapui and install the latest version (if possible...) and follow the below steps. If not, remove all the scriptom and jacob files from all folders and follow the below steps.
    2. Download the latest Scriptom module from here http://groovy.codehaus.org/COM+Scripting.
    you will see the link with the name "Scriptom 1.6.0", download that. That will have only the windows installer files.
    3. Find out the java.library.path in soapUI using. log.info System.properties["java.library.path"].
    4. Copy all the jar files (all the 7 'scriptom.... .jar' files and jacob-1.14.3.jar) from "..\\scriptom-all-assembly-1.6.0\lib" to the "soapui_HOME/bin/ext" folder.
    5. Copy the jacob*.dll (both dlls) from "..\\scriptom-all-assembly-1.6.0\bin" to the "soapui_HOME/bin" folder (java.library.path from step 3).
    This is mostly the soapUI_home/bin folder.
    6. Restart soapUI and verify that you can see messages in the soapUI log that all the scriptom jars were loaded.
    7. Now run a simple scriptom code to verify the configurations.

    Try the above steps and let me know if you can succeed.
  • I just re-installed the soapui and installed the jars as you mentioned.
    Still I'm getting the same error.

    "com.jacob.com:ComFailException:Invokeof:InitConnectionEx"
    Source:
    Description:Invalid Server response

    and my piece of code is:

    import org.codehaus.groovy.scriptom.*
    import com.jacob.activeX.ActiveXComponent
    import com.jacob.com.*

    Scriptom.inApartment
    {
    def tdc = new ActiveXObject ('TDApiOle80.TDConnection')
    tdc.InitConnectionEx('http://hostname:port/qcbin/start_a.jsp')
    tdc.Login('loginname', 'pwd')
    tdc.Connect('domain','proj')
    }

    Anything i missed from my end?

    Thanks,
    Dheepha V
  • Ok. I guess the problem is with QC URL. Can you provide URL upto /qcbin/ like below.

    tdc.InitConnectionEx('http://hostname:port/qcbin/')
  • Hi,

    You are correct mamar. After updating the QC URL, i'm not getting that connection error.

    But now I'm getting 'Login Failed' error. But I'm able to connect to the QC from IE by using the same user name/pwd along with the same Domain and Project name.

    What to do now to make it work using sicriptom?

    Thanks,
    Dheepha
  • I am not sure what is the exact issue. But the same is working from my side. Could you please check your login details, upper and lower cases, proper domain and project name? If possible could you attach the error snapshot?

    Here is the code i use.

    import org.codehaus.groovy.scriptom.*
    import com.jacob.activeX.ActiveXComponent
    import com.jacob.com.*

    Scriptom.inApartment
    {
    def tdc = new ActiveXObject ('TDApiOle80.TDConnection')
    tdc.InitConnectionEx('https://dqa.cbank.com/qcbin/')
    tdc.login('abc123', 'Password12')
    tdc.connect('BANK','Systest')
    }
  • I used user code and just updated the qc url and login credentials.

    Still the same login error.

    Attached the snapshot
  • Try running this code. If it works then the scriptom configuration has no issues. You have to tune the QC connection code.

    import org.codehaus.groovy.scriptom.*

    log.info 'test'
    def wshell = new ActiveXObject('Wscript.Shell')
    wshell.popup("This message is from Groovy")