How to change the location of my wsdl address

My wsdl puts the wrong domain in the address place, how to fix it?

- <wsdl:service name="XWebService">
- <wsdl:port name="XServiceSoap" binding="tns:XWebServiceSoap">
  <soap:address location="https://machine.wrongdomain.com.br/webservices/MapleStoryWebService.asmx" /> 
  </wsdl:port>
- <wsdl:port name="XWebServiceSoap12" binding="tns:XWebServiceSoap12">
  <soap12:address location="https://machine.wrongdomain.com.br/webservices/XWebService.asmx" /> 
  </wsdl:port>
- <wsdl:port name="XWebServiceHttpGet" binding="tns:XWebServiceHttpGet">
  <http:address location="https://machine.wrongdomain.com.br/webservices/MapleStoryWebService.asmx" /> 
  </wsdl:port>
- <wsdl:port name="XWebServiceHttpPost" binding="tns:XWebServiceHttpPost">
  <http:address location="https://machine.wrongdomain.com.br/webservices/XWebService.asmx" /> 
  </wsdl:port>
  </wsdl:service>

The true domain is similar to https://machine.goodDomain.com.br

+3
source share
4 answers

The address is taken from the URL used to access the WSDL. If it is different from the server on which you want to actually run, you can change it by creating a class that extends SoapExtensionReflector. Here is an example article on how to change the url:

http://blogs.msdn.com/kaevans/archive/2005/11/16/493496.aspx

+4
source

- URL- IIS (http://www.iis.net/downloads/microsoft/url-rewrite)

XWebService.asmx? WSDL HTML (, wsdl.htm).

... thishost.domain.com:

- <wsdl:port name="XWebServiceHttpPost" binding="tns:XWebServiceHttpPost">
  <http:address location="http://thishost.domain.com/XWebService.asmx" /> 
  </wsdl:port>

... thathost.domain.com:

- <wsdl:port name="XWebServiceHttpPost" binding="tns:XWebServiceHttpPost">
  <http:address location="http://thathost.domain.com/XWebService.asmx" /> 
  </wsdl:port>

IIS - URL Rewrite -/ . () - .

- URL- -, WSDL. RegEx:

(.*)XWebservice.asmx

, {QUERY_STRING}, WSDL {REQUEST_METHOD}, GET.

( ) , (wsdl.htm).

rewrite system.webServer -

<system.webServer>
    <rewrite>
        <rules>
            <rule name="WSDL Rewrite" stopProcessing="true">
                <match url="(.*)XWebService.asmx" />
                <conditions>
                    <add input="{QUERY_STRING}" pattern="WSDL" />
                    <add input="{REQUEST_METHOD}" pattern="GET" />
                </conditions>
                <action type="Rewrite" url="wsdl.htm" />
            </rule>
        </rules>
    </rewrite>
</system.webServer>
+1

. URL- WSDL URL-, WSDL.

, URL- (, ), wsdl.exe - - ( - , Visual Studio ), -, URL- (??), : , ...

0

WSDL, ?

If the WSDL is generated by some other tool, let us know how it is created and maybe we can help. Otherwise, there is no law against modifying the generated file to suit your needs. If everything that does not match the WSDL for the original user environment is that the URL is incorrect, it is perfectly correct to change the URL directly.

0
source

Source: https://habr.com/ru/post/1721814/


All Articles