Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WCF wsdl wsdl:import location,soap:address location are having machine name?

Tags:

Hi

We developed web service using WCF service and hosted on Windows 2003 server machine with IIS 5.1. WCF hosted on basicHttpBinding.

when try to access wsdl of service "*.svc?wsdl" it generating wrong wsdl, that wsdl cannot be used java and php clients.
when I check the wsdl in

<wsdl:import namespace="xxxxx" location="http://machine name/xxx/xxx.svc?wsdl=wsdl0"/> 
<soap:address location="http://machine name/xcxx/xxx.svc" /> 

How can i remove machine and replace it with my web site url?
How can i generate full WSDL document like what ASMX web service will generate?

like image 813
nRk Avatar asked Mar 02 '10 08:03

nRk


People also ask

What is soap address location in the WSDL?

the soap:address location appears with the Hostname of the machine. This part of the xml tells the application where to find the web service. So, because the machine is in a private network, this site is unreachable to everyone behind the cloud.

Does WCF use WSDL?

You can use WCF to export WSDL documents from a ServiceDescription instance for your service. WSDL documents are automatically generated for your service when you publish metadata endpoints.

What is WSDL in WCF service?

WSDL stands for Web Service Description Language. The WCF service exposes the WSDL document for the clients, to generate proxies and the configuration file. The WSDL file provides the following information for the consumers of the WCF service.


2 Answers

Here's how I fixed it:

  1. In your IIS bindings, be sure to include a host name.

  2. Install this hotfix: http://support.microsoft.com/kb/971842. There are links on the KB page to download the hotfix. The hotfix required a reboot for me.

  3. To "activate" the hotfix, add the following to the behavior element in your web.config:

    <useRequestHeadersForMetadataAddress>
        <defaultPorts>
            <add port="80" scheme="http" />
            <add port="443" scheme="https" />
        </defaultPorts>
    </useRequestHeadersForMetadataAddress>
like image 172
Matt Varblow Avatar answered Oct 11 '22 13:10

Matt Varblow



I browsed net and got solution for my problem the following helped me a lot.
Hope these will be help some other.


nRk

For generating flat WSDL
http://my-tech-talk.blogspot.com/2008/07/adding-flatwsdl-to-wcf-webservice.html
http://weblogs.thinktecture.com/cweyer/2007/05/improving-wcf-interoperability-flattening-your-wsdl.html
http://isinghblog.blogspot.com/2009/03/wcf-service-and-adobe-livecycle_10.html

For chaning host name which will reflect in wsdl address
http://forums.asp.net/p/1096811/1659596.aspx

like image 38
nRk Avatar answered Oct 11 '22 14:10

nRk