views:

2269

answers:

2

I began using WCF last night to setup a simple client server that will allow me to send game information to the client at the beginning of a session.

I followed the microsoft tutorial on WCF and used the VS2008 "WcfSerivce" template to begin and added my methods. I then copied and pasted the address it gives me into the service reference dialog in my client project and added the code to get data from the server. However the problem is now, no matter what it always returns error 400 when I request data.

I googled this error and found many people had a problem with a certain message size limit was exceeded, but I get this error even when the method only returns a single character.

The only thing I can think of is that the URI or namespace address is wrong, what value should they be instead? Thanks

EDIT: Here is the code I am using in the service and client, I'm not sure what the rule on post huge amounts of text so I put it on Pastebin, but if its allowed here I will edit again

http://pastebin.ca/1401443

A: 

You should be able to hit "play" on the service project, and it will navigate to the screen that shows the available methods etc. This is the url you need to use in the client.

Is this what you are doing already? Or are you using the url from the sample? In particular, if you are using the integrated development web server (rather than IIS), the port numbers are likely to be random.

A working WCF service project will generate a page something like:

{YourService} Service

You have created a service.

To test this service, you will need to create a client and use it to call the service. You > can do this using the svcutil.exe tool from the command line with the following syntax:

...

If you can get that working, then try adding the client reference.

Marc Gravell
Well, I'm using the URL from the sample page, and yes, I'm using the VS websever, though the port seems to be randomized once per project.I take that URL and put it in the client as a service reference, and it appears to work until I call any methods from it.
edude05
A: 

Incase anyone else had/has this problem, it a Window 7 compatibility issue. I tried on the RTM and it works.

edude05