Click here to Skip to main content
15,880,469 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi friends, I am consuming a web service hosted on server.


I have .wsdl files at my local and able to consume my web service where I reference the .wsdl file from my local machine "D:\WSDL\abc.wsdl" this gives me the successfully generated the "Web Reference" in my project and able to consume the classes.


Now when I publish my code and run the application on another machine I am unable to use the web service this gives an error inside the application and function doesn't get perform.

Please guide / suggest me the way how can I consume the web service when holding the .wsdl at my local.

However, I have tried to do something like this below:

As the WebService generated in my "Web Reference" folder in the project, I opened the "Reference.cs" file and change the below line in the constructor
C#
this.Url = global::Project.Properties.Settings.Default.WebService1URL;

to
C#
this.Url = "local path";


This file was auto generated.

C#
[global::System.Configuration.ApplicationScopedSettingAttribute()]
        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.WebServiceUrl)]
        [global::System.Configuration.DefaultSettingValueAttribute("http:// mywebservice path")]
        public string WebService1URL{
            get {
                return ((string)(this["WebService1URL"]));
            }
        }


I got this error: that is gone over my head
WSE 808: The following transport scheme is not supported: file.


Please guide me where I am lacking and pardon me if I could not explain the scenario well.

Thanks
Posted
Updated 14-Nov-14 3:37am
v2
Comments
Sinisa Hajnal 14-Nov-14 9:38am    
Which error? And also, did you copy wsdl along with the application?
Manish Kumar Namdev 14-Nov-14 10:08am    
Error is this--> "WSE 808: The following transport scheme is not supported: file"
yes I copied the file at the location but this didn't work.

I am looking how to consume service at client side if I have only wsdl file at my local and that should work if I publish my site and try to consume the service. In my scenario service is hosted on server and I am building client with wsdl file. I am not using Service url for e.g. ("http://abc.com/somemething/endpoint1") while adding web reference to my project.

1 solution

Hello Manish,

The wsdl file contains the necessary information so you can generate some code called proxy (to the web service).
This code must have an endpoint to the web service, so you cannot point your endpoint to the local wsdl file. Instead it must be pointed to an http address endpoint where your web service is executed.

You can edit the wsdl file and search for the http address endpoint.

Hope this helps.

Regards,
@jafc
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900