ACHawk

My WCF server is behind a firewall
https://www.myserver.net/QA/WS wsdl
 
but the schema locations are incorrect in the wsdl

   <xsd:schema targetNamespace="http://www.myserver.net/Imports">
      <xsd:import schemaLocation="http://10.3.100.01:860/WS xsd=xsd0" namespace="http://www.myserver.net" />
      <xsd:import schemaLocation="http://10.3.100.01:860/WS xsd=xsd1" namespace="http://schemas.microsoft.com/2003/10/Serialization/" />
      <xsd:import schemaLocation="http://10.3.100.01:860/WS xsd=xsd2" namespace="http://www.myserver.net/" />
    </xsd:schema>

How do I change this to generate schemaLocation="https://www.myserver.net/QA/WS xsd=xsd#" for all of these above.

I also have the same question for wsdl:import and soap:address.
  <wsdl:import namespace="http://www.myserver.net" location="http://10.3.100.01:860/WS wsdl=wsdl1" />
  <soap:address location="http://localhost:860/WS/" />


Thanks for any info.




Re: Windows Communication Foundation (Indigo) WCF WSDL generated paths for xsd:schema, wsdl:import, soap:address wrong for WCF behind a firewall.

Daniel Roth

You can setup your service to use a static wsdl with the correct addresses by using the ExternalMetadataLocation property on the ServiceMetadataBehavior.

Daniel Roth






Re: Windows Communication Foundation (Indigo) WCF WSDL generated paths for xsd:schema, wsdl:import, soap:address wrong for WCF behind a firewall.

Padmaja B

When i set ExternalMetaDataLocation property on the ServiceMetaDataBehaviour to

http://(machineIP)/service1/service.svc wsdl

When i test the service and click the link, page can not be found error is coming.

using the below also not working.

<host>

<baseAddresses>

<add baseAddress=http://IPaddress/service1/service.svc />

</baseAddresses>

</host>

Can anyone help me how can i display ip address instead of machine name for the link to .svc wsdl while testing the WCF service

Thanks in advance





Re: Windows Communication Foundation (Indigo) WCF WSDL generated paths for xsd:schema, wsdl:import, soap:address wrong for WCF behind a firewall.

jvshore

I have posted the same question, and I do not think there is a way to do that - hopefully Microsoft will implement this shortly (ie., an additional parameter to the .svc file, specifying a domain name to be used instead of the machine name). I was forced to set the ExternalMetaDataLocation property to a static wsdl, and also create the xsd files and put all files in the virtual directory for the web service. The reason you have to create the xsd file(s), is the .svc file that generates these files is not correct due to the machine name thing. I was able to create the xsd file(s) by hitting the link in the wsdl (... xsd) on my browser and saving the file to disk.





Re: Windows Communication Foundation (Indigo) WCF WSDL generated paths for xsd:schema, wsdl:import, soap:address wrong for WCF behind a firewall.

Padmaja B

Thanks for your reply. Can you suggest me the file name and extension to be used for xsd files to save in the virtual directory folder Do we need to save the wsdl file also Any changes required (like schema url) in xsd or wsdl while saving

Can you provide me the steps required to do this

--Thanks





Re: Windows Communication Foundation (Indigo) WCF WSDL generated paths for xsd:schema, wsdl:import, soap:address wrong for WCF behind a firewall.

jvshore

1) Produce the wsdl in the browser and save to file (by hitting .svc wsdl from browser)

2) Produce the xsd files by hitting url from wsdl (xsd=xsd0, etc), and save to file from browser

3) replace all machine name references from wsdl with domain name (or ip address) and change xsd references and save

4) replace all machine name references from xsd files with domain name (or ip address)

5) make sure to name xsd file with .xsd extension (ie, name_0.xsd, name_1.xsd)

6) copy wsdl and xsd file(s) to virtual directory

7) add the following entry in your web.config file:

<behaviors>
<serviceBehaviors>
<behavior name="CallRoutingBehavior">
<serviceMetadata httpsGetEnabled="true" externalMetadataLocation="https://vconsole.virtualpbx.com/callrouting/callrouting.wsdl"/>
</behavior>
</serviceBehaviors>
</behaviors>





Re: Windows Communication Foundation (Indigo) WCF WSDL generated paths for xsd:schema, wsdl:import, soap:address wrong for WCF behind a firewall.

Christian Weyer

...or just run disco.exe on the wsdl and it downloads it all and then tweak it.






Re: Windows Communication Foundation (Indigo) WCF WSDL generated paths for xsd:schema, wsdl:import, soap:address wrong for WCF behind a firewall.

Padmaja B

Thanks alot. It is working. Sometimes while adding service reference, i m getting error like

Cannot find file "C:\Documents and Settings\padmajab\Local Settings\Temp\23hzb1ps.ym5\Service1.cs".

Service.cs is my WCF service class.





Re: Windows Communication Foundation (Indigo) WCF WSDL generated paths for xsd:schema, wsdl:import, soap:address wrong for WCF behind a firewall.

Padmaja B

When i give

externalMetadataLocation =http://IPaddress/Services/Service1.svc,

i am getting the error as

Cannot find file "C:\Documents and Settings\padmajab\Local Settings\Temp\23hzb1ps.ym5\Service1.cs".

When i use externalMetadataLocation = http://IPaddress/Services/Service1.wsdl , everything is working perfect.

Thank you so much.





Re: Windows Communication Foundation (Indigo) WCF WSDL generated paths for xsd:schema, wsdl:import, soap:address wrong for WCF behind a firewall.

jvshore

create the cs file by calling svcutil and passing the wsdl as the parameter, or you can try add web reference instead of add reference.

Your welcome,

John Shore





Re: Windows Communication Foundation (Indigo) WCF WSDL generated paths for xsd:schema, wsdl:import, soap:address wrong for WCF behind a firewall.

Padmaja B

Can you tell how you have configured the service in .config file to get the wsdl and xsd's with IP address.

My problem is exactly opposite to you. I need to create wsdl and xsd with url includes ip like your created files. My wsdl and xsd's got created refering the machine name by default when i click file.svc wsdl in service test page.

Can you help me





Re: Windows Communication Foundation (Indigo) WCF WSDL generated paths for xsd:schema, wsdl:import, soap:address wrong for WCF behind a firewall.

jvshore

You have to follow these steps:

1) Produce the wsdl in the browser and save to file (by hitting .svc wsdl from browser)

2) Produce the xsd files by hitting url from wsdl (xsd=xsd0, etc), and save to file from browser

3) replace all machine name references from wsdl with ip address and change xsd references and save

4) replace all machine name references from xsd files with ip address

5) make sure to name xsd file with .xsd extension (ie, name_0.xsd, name_1.xsd)

6) copy wsdl and xsd file(s) to virtual directory

7) add the following entry in your web.config file:

<behaviors>
<serviceBehaviors>
<behavior name="CallRoutingBehavior">
<serviceMetadata httpsGetEnabled="true" externalMetadataLocation="https://vconsole.virtualpbx.com/callrouting/callrouting.wsdl"/>
</behavior>
</serviceBehaviors>
</behaviors>

Currently, this is the only way to produce a wsdl and xsd file(s) from the svc file using something other than the machine name. I have asked Christian Weyer to bring this issue up with Microsoft, and I have given him source code to demonstrate.





Re: Windows Communication Foundation (Indigo) WCF WSDL generated paths for xsd:schema, wsdl:import, soap:address wrong for WCF behind a firewall.

Gabriel Lozano-Moran

I have something similar I believe. Here is our situation:

We have a development server named DVL01. For each project we create a new web site and a DNS entry on our DNS server that points to that website.

For each project we also create a new Application Pool and a new service account in the Active Directory that will be used to set the security context of the application pool.

Next we create a Service Principal Name (SPN) in the Active Directory so that this service account can only be used in a specific correct context.

Eg:

We have a project called ProjectX. When we navigate to http://ProjectXDVL:9501 it will be resolved to http://DVL01:9501. Navigating directly to http://DVL01:9501 gives a 401 (unauthorised) which is exactly what we want, that is the SPN kicking in. The problem now is that in the WSDL the schemaLocation for the XSD's point to http://DVL01:9501/EmployeeService.svc xsd=xsd0 and this gives a 401 (again SPN). The correct URI should be http://ProjectXDVL:9501/EmployeeService.svc xsd=xsd0.

I have tried chaning the host header value, I have also tried adding a baseAddress in the web.config but nothing seems to help.

Are you trying to say that this is not possible by configuration






Re: Windows Communication Foundation (Indigo) WCF WSDL generated paths for xsd:schema, wsdl:import, soap:address wrong for WCF behind a firewall.

jvshore

All you need to do is set the default host header name for that site. For example, I needed to use adsutil.vbs to set the default header for our https site. Once I did this, the computer name was replaced by the domain name in the links for the schemas.





Re: Windows Communication Foundation (Indigo) WCF WSDL generated paths for xsd:schema, wsdl:import, soap:address wrong for WCF behind a firewall.

Gabriel Lozano-Moran

I already tried that but that doesn't change the uri of the schemaLocation it still points to http://DVL01 instead of http://ProjectXDVL