Harry

Harry

  • NA
  • 13
  • 0

Get rid of tempuri in wsdl?

Feb 17 2011 6:10 AM
Hello!
I have the problem that my WSDL file generated from my WCF service still contains a tempuri value although I did what the various forums say:

1. Put a [ServiceContractAttribute] into the declaring interface

[ServiceContract(Namespace = "www.XXX/Wcf")]
public interface ICaseService
{
[OperationContract]
ServiceGetCaseResponse GetCaseData (ServiceGetCaseRequest request);
}



2. Put a [ServiceBehaviorAttribute] into the implementing class

[ServiceBehavior(Name="CaseService", Namespace="www.XXX/Wcf")]
public class CaseService : ICaseService
{
    public ServiceGetResponse GetCaseData(ServiceGetCaseRequest request)
   {
   // do some stuff here...
   }
}



3. Put a "bindingNamespace" attribute into the web.config
<services>
 <service  name="CaseService"  behaviorConfiguration="CaseService.Service1Behavior">
        <endpoint address="http://127.0.0.1:9998/CaseService.svc"
                  binding="basicHttpBinding"
                  contract="HaWcfCoreServices.ICaseService"
                  bindingNamespace="www.XXX/Wcf"
                  bindingConfiguration="Binding_CaseService"
                  name="WCFEndPoint">
        </endpoint>

      
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
       
 </service>
</services>




In my opinion all the facts for removing the tempuri should be given. There is no difference if I host with the Wcf-testhost or the IIS.



The WSDL-file:

<wsdl:definitions name="CaseService" targetNamespace="www.XXX/Wcf">
<wsdl:import namespace="
http://tempuri.org/" location="http://127.0.0.1:9998/CaseService.svc?wsdl=wsdl0"/>
-
<wsdl:types>
-
<xsd:schema targetNamespace="www.XXX/Wcf/Imports">

........


http://127.0.0.1:9998/CaseService.svc?wsdl=wsdl0 in the browser tells me this:

<wsdl:definitions targetNamespace="http://tempuri.org/">
<wsdl:import namespace="www.XXX/Wcf" location="http://127.0.0.1:9998/CaseService.svc?wsdl"/>
<wsdl:types/>

.....

How can I get the tempuri.org removed?
Thank you for any idea!

Greetings,
Harry


Answers (7)