Question

So I am currently running into a weird situation where my web service WSDL and server specifies two parameters but when I add the web service as a reference in my project. Visual studios creates a reference.cs page that says I need three parameters. I've used soap UI to confirm that the web service does indeed only request two parameters.

Anyone else run into this problem?

I have to manually change the reference.cs to only take two parameters so my code will compile and I can use the WS correctly. Ive checked all the other web services which run just fine and do not have this problem. only this one service.

here is a pic from the wsdl enter image description here here is a pic from the reference page enter image description here

Was it helpful?

Solution

Most probably you added your web service as a web reference instead of a service reference. When using this type of references with wcf services, sometimes you find that your service methods change from

mymethod(string param1, bool param2)

to

mymethod(string param1, bool param2, bool hasParam2)

Or something very similar. Right? Just remove the reference and add it again as a service reference.

In case you did that to spare web.config changes and endpoints, just remember changing the url property of your service in other enviroments. Because is hardcoded in the reference and you may not know it!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top