apisoapwsdlwcf-endpoint

Get Api end points from wsdl file


I'm trying to consume a commercial soap Api. I know their wsdl file but did not have any api endpoints to make request. I have searched on internet about how to get api endpoints from wsdl file but did not succeed. the wsdl file location is http://cbs.zong.com.pk/reachcwsv2/corporatesms.svc?wsdl.


Solution

  • According to this answer the end point url is obtained by removing the ?wsdl from the path to wsdl

    So WSDL is: http://cbs.zong.com.pk/reachcwsv2/corporatesms.svc?wsdl then End-point is: http://cbs.zong.com.pk/reachcwsv2/corporatesms.svc


    More accurately, the endpoint is defined in WSDL file by address <address/> tag as below. It could be different from what you get by just removing ?wsdl suffix from URL, but most often thats not the case.

    <wsdl:port name="BasicHttpBinding_ICorporateCBS" binding="tns:BasicHttpBinding_ICorporateCBS">
    <soap:address location="http://cbs.zong.com.pk/ReachCWSv2/CorporateSMS.svc"/>
    </wsdl:port>