WSDL has wrong soap:address?

I have been just learning WCF and I have a virtual machine running Windows Server 2003. I develop my hello world WCF Service and the Hosting website locally on my own PC, and if I browse to http://localhost/MyHost/HelloWorldService.svc?wsdl I get a WDSL that has all the correct information in it.

But when I deploy this Web Host app to my Windows Server 2003 machine, and I go to the address http://servername/MyHost/HelloWorldService.svc?wsdl the soap:address property of the WSDL file is incorrect and I cant load any Service References, I get the following output:

The document was understood, but it could not be processed.
- The WSDL document contains links that could not be resolved.
- There was an error downloading 'http://markv.kram/HelloWorldService.svc?xsd=xsd0'.
- The remote name could not be resolved: 'markv.kram'
Where my virtual computers full name is markv.kram (according to the properties of My Computer) but my PC cant seem to resolve that name, what can I do so that my PC resolved the name of markv.kram correctly, or make the WSDL render with just http://markv/blah...

Thanks for any help!

[1150 byte] By [MarkMacumber] at [2008-1-7]
# 1

Mark,

Try to publish metadata. It may be due protocol (get, post, soap)

http://msdn2.microsoft.com/en-us/library/ms734765.aspx

LeonardoBrunoLima at 2007-10-2 > top of Msdn Tech,Visual Studio Orcas,Windows Communication Foundation (Indigo)...
# 2
Is the service still hosted on the virtual PC? If so, the address is not wrong, is it? If not, can you figure out why the address is wrong (e.g. is the service base address hardcoding a machine name?)?
HaoXu-MSFT at 2007-10-2 > top of Msdn Tech,Visual Studio Orcas,Windows Communication Foundation (Indigo)...
# 3

The service is hosted on the virutal machine, so I guess the address is correct, but then what does the error mean when it says:

The document was understood, but it could not be processed.
- The WSDL document contains links that could not be resolved.
- There was an error downloading 'http://markv.kram/HelloWorldService.svc?xsd=xsd0'.
- The remote name could not be resolved: 'markv.kram'

Why not? Is it my local DNS (im not on a domain)?

Thanks for any help!

MarkMacumber at 2007-10-2 > top of Msdn Tech,Visual Studio Orcas,Windows Communication Foundation (Indigo)...
# 4
Can you try to load the page http://markv.kram/HelloWorldService.svc?xsd=xsd0 from IE? I assume you are able to ping markv.kram from the client machine, right?
HaoXu-MSFT at 2007-10-2 > top of Msdn Tech,Visual Studio Orcas,Windows Communication Foundation (Indigo)...
# 5

I cannot load the service from the client machine at all, and I cannot ping markv.kram, but I CAN ping "markv". (there are only 2 computers in this equation, so you dont need to worry about other computers conflicting).

Im not too sure how the DNS works so there maybe a problem with how the client machine referes to the host machine. If I go to my computer on the host machine, and go into the Computer Name section, the full name is markv.kram.

Which also meant that I CAN get to the address:

http://markv/HelloWorldService.svc?xsd=xsd0

so I dont know what to do here...

MarkMacumber at 2007-10-2 > top of Msdn Tech,Visual Studio Orcas,Windows Communication Foundation (Indigo)...
# 6

I am not sure why your virutal PC is in a domain. Can you change it back to WORKGROUP (My Computer -> Properties -> Computer Name -> Change)?

The other workaround will be to mimic a DNS entry by adding a line in your %windir%\system32\drivers\etc\hosts to point to markv.kram to its IP address.

HaoXu-MSFT at 2007-10-2 > top of Msdn Tech,Visual Studio Orcas,Windows Communication Foundation (Indigo)...
# 7
Hi Hao,

I think you may have miss-understood (or I made a typo), but none of the PC's are in a domain at the moment.

But I did do the host's file change and that worked just fine, but I would like to know why my computer (the client to the app) couldnt resolve the name markv.kram when that computer is a vitrual PC that sits on the same machine...

oh well, it works now. So thanks for the help so far.

MarkMacumber at 2007-10-2 > top of Msdn Tech,Visual Studio Orcas,Windows Communication Foundation (Indigo)...
# 8

You may have not joined the machine to a domain, but the name markv.kram indicates it is in a domain "kram". What do you see when you go to My Computer -> Properties -> Computer Name?

In any case, it doesn't look like a WCF issue. You could probably get a more definitive answer from Virtual PC experts.

Cheers,

Hao

HaoXu-MSFT at 2007-10-2 > top of Msdn Tech,Visual Studio Orcas,Windows Communication Foundation (Indigo)...
# 9
Now that you mention it, I did try to setup active directory a while back but failed miserably. I think I did call the domain "kram". But I was pretty sure that I removed it.

The "Computer Name" section says markv.kram, but it is on WorkGroup, not a domain...

MarkMacumber at 2007-10-2 > top of Msdn Tech,Visual Studio Orcas,Windows Communication Foundation (Indigo)...
# 10

Hi Mark,

It's been a couple of months and I quite sure you solved your problem, but just in case - If you look at the generated wsdl, you'll notice that each and every one of the composite types you've used has been referenced as xsdXXX (XXX is a sequencial number).

The problem is, that if your baseaddress is configured to Localhost, so will the uri's for the xsd files, meaning that when you add a reference to the service from a different computer, it thinks that the xsd files are on the local computer instead on the server.

If you change the server name of the baseaddress from localhost to the server's name, it should work.

If you have already done so and found a better way than to hard-code your server name to the .config file, I'd appreciate if you can tell me how you did it (it's my first day in WCF so I have a lot of things I have to learn).

Ido.

IdoFlatow at 2007-10-2 > top of Msdn Tech,Visual Studio Orcas,Windows Communication Foundation (Indigo)...

Visual Studio Orcas

Site Classified