Reputation: 5866
I am trying to add a web service reference to my customer's windows server. I can add it by clicking the Add Service Reference
from the menu and type the correct web service url in the address bar. Then I click the GO
button to validate the url. It locates the web service perfectly. Then I click the OK
button to finish the job.
Then I see that Visual Studio creates a folder called App_WebReference
, and puts a file like this Reference.svcmap
in that folder.
When I go to the c# code, I am trying to call the web service but I cannot reach it. However this work if I create a local project and do the same things I explained above.
Here is web service url if you want to take a look at it. What am I doing wrong? I don't have any code to display because I couldn't code anything since I cannot reach the web service from c#. What am I supposed to do?
Upvotes: 1
Views: 676
Reputation: 8147
When you added your Service Reference you gave it the Namespace of ziraat
so the following code should access the method you are trying to call:
using (var client = new ziraat.RegisterTransactionSoapClient())
{
client.SaveTransaction(...);
}
In addition I have seen an issue in Visual Studio where the Service Reference is added but the code generated is incorrect... This might be your issue?! To try a work-around:
ziraat
service reference item in your Solution Explorer treeThen try the code sample above again.
Upvotes: 2