Forum Discussion

snsandeep's avatar
snsandeep
Occasional Contributor
16 years ago

Adding multiple WSDLs with same interface name

Hi,

I have 3 WSDL URLs to be added in a project and used for running various tests.

ex:  http://servername:8080/pwd/Interface1?wsdl
      http://servername:8080/abc/Interface1?wsdl
      http://servername:8080/jkl/Interface1?wsdl

I observe that since the interface names are same in all the 3 urls, the definitions get overwritten each time and the existing methods obviously gets replaced depending upon the new URL.

The workaround I used is to create a dummy project, add a WSDL and then clone the interface into the main project. I repeat this for the other 2 urls and I get 3 treeviews with the caption "Interface1Binding" for the parent node. Each tree view displays the methods under relevant URLs.

Is there any other workaround?

Regards
Sandeep
  • KarelHusa's avatar
    KarelHusa
    Champion Level 1

    The workaround I use for this issue is following:

    1. select the existing interface (called e.g. "serviceBinding")
    2. go into "Interface Properties" window and change the Name property (e.g. to "serviceBinding_v1") 
    3. import the second WSDL (which you could not import up to now)
    4. you get a new interface (e.g. "serviceBinding")
    5. you can rename the newly created interface similarly as you did in step 2 (e.g. to "serviceBinding_v2"
    6. the interfaces have a different name, though they have the same binding name

    The advantage is that you can distinguish the interfaces between each other. However, you need to be careful and avoid updating the interface, in such a case the interface name would get renamed back to the binding name from the WSDL.

     

    This approach is especially helpful when you need to test or mock multiple versions of the same service within the same SoapUI project.

     

    Best regards,

    Karel

     

    • Amruthavani's avatar
      Amruthavani
      Senior Member

      This workaround helped me. how can we implement the same using groovy script to rename the interface name after importing? 

  • scr's avatar
    scr
    Occasional Contributor
    I'm not sure I understand your problem... can you elucidate? Maybe I just don't have the experience needed to understand what you are trying to do...
  • I have the same problem. I am using the same wsdl:binding/@name attribute for different web services. When I add a WSDL to a project that already has an interface of the same name, soapUI complains "Interface [xxxxxx] already exists in project, update instead?". If I say no, the new interface is not added, if I say yes the new interface is added and replaces the existing one. What I want is for both interfaces to be in the project, even though they have the same name.

    I use the same workaround as snsandeep, but it would be better if I could add the WSDL directly to the existing project without having to use a dummy project.
  • snsandeep's avatar
    snsandeep
    Occasional Contributor
    Hi SCR,

    If you try to add 2 WSDL URLs with the same interface name as I have mentioned in the hypothetical example I have given, the methods of the second URL I add replaces the methods of the firts URL. Just try thiis workflow and you will know.

    Regards
    Sandeep
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hello,

    Sadly, this is a limitation of soapUI. You will have to continue using these workarounds for now. Sorry for the inconvenience.

    Regards,
    Dain
    eviware.com
    • KarelHusa's avatar
      KarelHusa
      Champion Level 1

      Dear Dain,

      I face the same issue in version 5.4.0. I have raised a feature request.

       

      It would be very helpful if this gets resolved.

       

      Best regards,

      Karel

       

  • Hi guys,

    Suddenly the work around solution is not working for me. you guy any idea ?
    I am using SoapUI Pro 3.6.2

    I am getting the error message ''target project already contains interface for binding"

    Regards
    Vijay
  • I am getting the same error posted by the last person (''target project already contains interface for binding") when trying to clone an interface from one project to another when the binding name exists in the target project, but it has a different endpoint. What have people been doing to resolve this? I really don't want to have to create another environment, for maintainability reasons. My soapUI version = pro 4.5.1