We’ve developed some resources to help you work effectively from home during COVID-19 Click here to learn more

SOAP does not work (Bad Gateway)

At one of our customers service SOAP endpoints - e.g. http://localhost/service/scripts/soapAdmin.exe - yield "HTTP Error 502.2 - Bad Gateway" instead of an XML response.
I cannot figure out any difference in the IIS settings between customer and a working environment (CGI, handler mappings). Also, there is no difference in SOAP settings between the two installations.
For the sake of simplicity, I set the binding to http with empty hostname, and I tested the endpoint on the SuperOffice server. Everything else works fine, e.g. http://localhost/service/scripts/rms.fcgi
SuperOffice 8.0 SR4 onsite
Any ideas?
Best regards, Marc

RE: SOAP does not work (Bad Gateway)

Hi Marc,

You have of course configured the SOAP ip-range under Settings?

Sverre

Av: Sverre Hjelm 7. feb 2018

RE: SOAP does not work (Bad Gateway)

Marc, funny that you should mention this. I had the exact same problem yesterday with a customer. What we did was creating a new site, gave it a name "mysuperoffice", and set the hostname to "http://mysuperoffice" with the applications /Service and /SuperOffice.

And then it worked for the customer. I could browse soap.exe from http://mysuperoffice.com/Service/scripts/soap.exe?action=ticket

The setup it self was identic to the Default Web Site, but it seems that the Default Web Site has some settings that disables browsing soap.exe somehow.

Anyway, I would advice you to try setting up a new site (remember to change regedit and the urls in config table as well as ejcrontab.txt and so on).

Give me a shout if you need some help :)

Av: Simen Mostuen Iversen 7. feb 2018

RE: SOAP does not work (Bad Gateway)

@Sverre, yes I did (SOAP ip-range)

@Simen, I forgot to lookup registry, config table, and the files. They probably have different settings as my test installation, and do not match the hostname (localhost). I will try the new web site  - next week as I am quite busy now - and give you feedback then.

Av: Marc Eberhard 7. feb 2018

RE: SOAP does not work (Bad Gateway)

Hi Simen,

after many attempts we managed to get rid of the bad gateway error.
First, we needed to use the productive base URL (e.g. https://crm.customer.ch/service/scripts), and second to adapt the config file of the client application:

<system.serviceModel>
  <bindings>
    <basicHttpBinding>
      <binding name="adminService" ...>
        <security mode="Transport"></security>
      </binding>
      <binding name="customerService" ...>
        <security mode="Transport"></security>
      </binding>
      <binding name="ticketService" ...>
        <security mode="Transport"></security>
      </binding>
    </basicHttpBinding>
  </bindings>
  <client>
    <endpoint address=" https://crm.customer.ch/service/scripts/soapAdmin.exe?action=admin" binding="basicHttpBinding" bindingConfiguration="adminService" contract="adminService.adminServicePortType" name="adminService" />
    <endpoint address=" https://crm.customer.ch/service/scripts/soapCustomer.exe?action=customer" binding="basicHttpBinding" bindingConfiguration="customerService" contract="customerService.customerServicePortType" name="customerService" />
    <endpoint address=" https://crm.customer.ch/service/scripts/soapTicket.exe?action=ticket" binding="basicHttpBinding" bindingConfiguration="ticketService" contract="ticketService.ticketServicePortType" name="ticketService" />
  </client>
</system.serviceModel>

(... represent some more properties that are not essential. The important attribute is mode = "Transport")

The localhost entry always resulted in bad gateway – we also tried a new site with regedit and config table and everything.

Regards, Marc

Av: Marc Eberhard 20. feb 2018