I have created WSDL file and when I add service reference in VisualStudio I can use it to fetch the data. However what I want to achieve is when I add service reference it should ask me for credentials by an authentication windows popping up.
What do I need to add to my WSDL file?
I am attaching link to my WSDL file.
Any help will be appreciated.
https://gist.github.com/anonymous/654fcddcdee2f9848500
There is no way to achieve this when you add a local Wsdl file in the IDE as a service reference to your project.
Unless you place the file on a network file share which will popup and ask for credentials.
Another way would be to host the Wsdl via an IIS web service with basic or windows authentication.
According to your comment you are accessing the WSDL using a URL. The question is this a WCF service endpoint? If so (MEX) meta data exchange is used to provide you the Wsdl. You can change the MEX endpoint to use https mexHttpsBinding. See following link:
https://msdn.microsoft.com/en-us/library/aa967391(v=vs.110).aspx
Related
I am really new in services and are having some problems with one issue. The fact is, i have a WSDL of a SAP system and i need to create a Web API in Visual Studio based on it.
I passed some time searching for tutorial's of how to do that but don't have lucky. Someone would help me, explaining the concept or sending some tutorial where i could understand how to do that? I am completely lost and i need it for my job.
If anyone could help me i would stay quite grateful. Thank you everyone for the support.
Just host the WSDL in ur IIS i.e Create an application in IIS pointing to the directly that contains the WSDL.
And add service reference to the WSDL by pointing to the IIS Url of the application.
Then in config, change it to point to actual implementation of the service.
If you have WSDL of the service you might be able to use ServiceModel Metadata Utility Tool (Svcutil.exe) to generate your WCF client proxy with all the required contracts for it. Here is another link on generation and answer with an example, plus another example.
I had a .svc file which my end user gave to me for integration of a web service.
I try most of the way the internet mention which is to 'add a web service' but i keep getting an error as follows
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://someAddress/VFCSMTStep2StripService/MapManagementServices.svc?xsd=xsd0'.
- The remote name could not be resolved: 'someAddress'
I believe the address is intended to be use within an internal web service.
Does that mean if i cannot connect to that address i cannot carry on the programming as it does not allow me to create and web reference. I am using VS2005.
Do point me to any link if this question is a repeat.
Thanks
I keep going back and forth on using the Service References (proxy client) and creating the SOAP XML manually. I imported the WSDL files into my project as Service References. I use the objects provided by these references to create populate my request.
My Code Base is C# using Visual Studio 2013.
My Service Reference solution runs into the error:
"The WS Security Header in the message is invalid. Please review the transmission instructions outlined in Section 5 of the AIR Submission Composition and Reference Guide located at https://www.irs.gov/for-Tax-Pros/Software-Developers/Information-Returns/Affordable-Care-Act-Information-Return-AIR-Program, correct any issues, and try again."
How are other folks passing Security successfully through the Web Service to the IRS?
Any thoughts on how to resolve the issue I am facing by using the proxy client?
the proxy client?
Update
I have abandoned the approach of using the WSDL files as Service References, and am manually creating the SOAP Request for transmittal.
I have created a WCF service.
I am now following tutorials on how to consume this service, and the way I've been instructed to do this is to...
"..note the http address and port that Visual Studio is using to run you WCF webservice. It may look like this ([LOCAL HOST ADDRESS]). You will need this url from within the Windows Form to add a reference to the WCF service.."
http://www.thebestcsharpprogrammerintheworld.com/blogs/create-and-consume-a-wcf-windows-communication-foundation-service.aspx
Now, that's fine. But if I'm literally going to copy and paste this url into my application it will no longer be relevant to a live environment will it?
Is this really the best way to point to a WCF service in a solution?
You will see that in your app.config file the url is saved. If you deploy your service to a live server you will only need to change the config to look at the new url.
Hope I understood your question.
What do I need to call a web service over https in C#?
Do I need to get the certificate form the site? How do I use this to call the web service?
There's nothing special or different for calling a web service over https than over http. You generate a client proxy from the WSDL using either svcutil.exe (or Add Service Reference in VS) or wsdl.exe and invoke the method. The lower level classes HttpWebRequest and HttpWebResponse will eventually take care of the actual call and certificates but it should be transparent for your code. Of course the server hosting the web service needs to provide a valid certificate.
I take that you are using Visual Studio to create your projects, if you are it is pretty easy to do. I take that you have the url for the web service that you would like to connect to and it starts with HTTPS.
In your project in the solution explorer (assuming you using Visual Studio), you should see a node saying "References" and another one saying "Web References". Right click on the "Web Reference" and then basically follow the wizard. It is pretty straight forward. You can spec your own Namespace. I usually use the format SomethingAPI. Then use the API as you would like any other object in your project. You will get the intellisense and all.
There might occur known problems with some certificates though. See http://support.microsoft.com/kb/823177/en-us
Do you have a client certificate that has been supplied by the provider of the web service?
If so, there are various different ways of doing this depending upon which version of .NET you are using. What version are you using, and are you limited in how you can generate your client proxy classes?