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!
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?)?
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!
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...
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.
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.
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
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...
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.