Forum Discussion

hbjastad's avatar
hbjastad
Contributor
8 years ago
Solved

WSDL not displaying when hitting WAR

I have created a Virt from WSDL, and it works well within Ready!API. I can access the SOAP interface, and I can add '?wsdl' to retrieve the WSDL. But when I package the Virt as war and try to hit it with the added '?wsdl' I only get "Log is disabled." and no WSDL.

 

The server log shows the following, which leads me to believe that Ready!API tries to provide the WSDL:

[WsdlMockDispatcher] Mounted WSDL for interface [ABCEndpoint] at [/abc?WSDL]
  • Switching on the web UI helped debug the problem - the context path had been added in the Virt, so that it was needed twice:

    /abc/abc?WSDL

    The solution was to change the context path in the virt to just

    /

2 Replies

  • Digging for a solution in the documentation, I found this (https://www.soapui.org/soap-mocking/deploying-mock-services-as-war-files.html):

     

    If you plan to use the ?WSDL exposure functionality of the MockService you will need to set the MockService Endpoint to the external endpoint to be used in related port addresses.

     

    Could someone explain exactly what this means?

     

    I guess I should add that I have 3 other virts, which are created exactly the same way as this 4th one, yet the first 3 work well even with '?wsdl' and this 4th one doesn't. My suspicion now goes in the direction of actual endpoints availability: I am behind a firewall and the first 3 services are accessible from within the firewall. The 4th service is NOT available from within the firewall, but I have downloaded the WSDL+XSD files and placed them alongside the Ready!API project file. Since this setup works within Ready!API, could the problem be that Ready!API is smart enough to access the local files...while the war file is trying to access the remote endpoint?

     

    If my assumption above is correct, is there a way to package WSDL+XSD inside the war file and have the mock-as-war use those?

    • hbjastad's avatar
      hbjastad
      Contributor

      Switching on the web UI helped debug the problem - the context path had been added in the Virt, so that it was needed twice:

      /abc/abc?WSDL

      The solution was to change the context path in the virt to just

      /