My wsdl put a wrong domain in address location, How to fix it?
-
-
Another option is to use the IIS URL Rewrite module (http://www.iis.net/downloads/microsoft/url-rewrite)
First up - capture the output from XWebService.asmx?WSDL and save it as an HTML file (e.g. wsdl.htm).
Edit this file and change the location to the alternative address
... from thishost.domain.com:
-
...to thathost.domain.com:
-
In IIS - find the URL Rewrite icon in the website/virtual Feature View . Then click Add Rule(s) and choose Inbound Rule - Blank rule.
With the rule - name it appropriately and set the pattern match for the webservice URL that will receive the WSDL request. For RegEx:
(.*)XWebservice.asmx
For the conditions match {QUERY_STRING} to WSDL and {REQUEST_METHOD} to GET.
For the Action - set it to Rewrite (so this is transparent to the client) and choose the file that we saved it as earlier (wsdl.htm).
This also adds a new rewrite section to the system.webServer section of the web.config