I need to consume an existing web service in ASP.net.
The documentation of the website that provides the web servicesays that I have to use WSDL.exe to generate a stub, but I can't find this tool.
I also tried the Add web reference wizard in Visual Studio 2010 (VS2010), but if I paste the URL in, VS2010 doesn't work anymore.
What am I missing?
As far as I remember there should be a choice between .net 2.0 and WCF services.
Try to select .net 2.0 web service type. We had to do it for using SOAP web services running on Python.
You might also try using the Add Service Reference Wizard instead - worked for me for WebServices the Web Reference Wizard did not like quite as much. Make sure to use the link to either the asmx (if it's one) or the .wsdl
As far as I know, you can't create SOAP webservice with .net 4. When you creating new project, you need to choos .net 3.5 or earlier first, and then create project.
As for creating stub from existing wsdl, I don't know how to do it.
Related
I have a Visual Studio 2015 solution with 2 projects:
A classic ASP web site.
A C# class library.
How do I call the C# methods from within the classic ASP pages?
I will deploy the solution to Azure App Services.
I do know that I could create a web API and call it that way. But I am wondering if there is any other way to do this.
UPDATE:
I made the C# class "COM-Visible" and checked the “Register for COM interop” option, and everything works correctly on my development machine.
But when I publish the solution to Azure Web Services, it doesn't work. The Classic ASP page runs fine, but I get this error when trying to create the object:
Server object error 'ASP 0177 : 800401f3'
Server.CreateObject Failed
/index.asp, line 34
800401f3
It seems “Register for COM interop” doesn’t work in Azure App Services. I know I could create a VM and register the dll manually, but I would prefer to use Azure App Services instead.
I think the two methods you mentioned - Web API (or similar intermediary service) and Server.CreateObject (needs a COM-visible .NET assembly) are your only two options in Classic ASP.
If the .NET assembly/library you want to use is not COM-visible, and you don't have access to source code, you can create a wrapper - your own .NET assembly that is COM-visible, with pass-through methods - you call your assembly from Classic ASP, and your assembly passes required parameters to the library you actually want to use, and returns results of the corresponding methods.
I have some web services that I need to reference in a Windows 8 Metro style application, normally you can just add a reference to the service via VS2012, but the services are behind a security layer.
I have downloaded the .WSDL file to my local PC, and now I need to generate the class file for this service.
The WSDL.exe that I have found on my local PC is for .NET 4.0 and produces code that is not suitable for the .NETCore framework. Is there a WSDL.exe equivalent for Windows 8 apps?
Visual Studio 2012 can obviously add a reference to non-secure asmx WSDL web services, so the functionality must be somewhere.
As per little investigation, the original .NET 1.x asmx-based Web Reference proxies are not supported in Metro style apps.
Web Service with SOAP 1.1 end point is supported by Add Service Reference (right-click on a project and choose Add Service Reference) in Metro style apps.
A workaround should be remove the offending constructor that fails to build (unfortunately, you'll need to do that everytime you regenerate the code), and to pass an instance BasicHttpBinding and EndpointAddress to one of the constructors of the WSFTerminalsSoapClient.
Have a look at following references, which might help you in this regard:
Web Services from WinRT Metro
WCF in Windows 8 Metro styled apps? Absolutely supported
I found out how to do this if anyone is interested.
You simply download the XML WSDL file from the site via a normal browser.
Then in VS2012, you can add a service reference to that file directly (i.e. put in the full path to the file c:\tmp\mywsdl.xml) and it will be able to generate the proxy for you.
We are about to update our Primavera system from 6.x to 8.2. We have som applications that uses the webservice but having some problems.
In Primavera 6 we used Primaveras version of the DLL helper called: p6WSStubs.dll
In the newer versions they have a guide that explains how to create this file witch we have done.
However the classes and methods in the 2 files are not completely identical.
We uses Visual studio.
In the old Version we Could create an instance of a class called Authetication service like this:
Primavera.Ws.P6.Authentication.AuthenticationService auth = new Primavera.Ws.P6.Authentication.AuthenticationService();
in the new version we have created the Namespace Primavera.Ws.P6.Authentication like descriped in the guide but I only have the Classes and methods shown here:
Does anyone have any experience with the differences in webservice in the 2 version?
You can instantiate the AuthenticationServicePortTypeClient and use it as you used the service. Assuming you might be using C# 4.0 with VS 2010, that uses WCF to connect with SOAP based services and the way you interact is a little different than Microsoft WSE in .net 2.0.
From a .NET application, how do I consume a Web Service developed using gSoap c/C++ library?
I can create a C/C++ client using gSoap library to consume the web service. But I need to consume it from within a .NET (C#) application. I tried Adding a Web Reference but that doesn't seem to work.
Would I need to work with raw Soap Packets?
You can try to call the Web Service dinamically (without adding the reference)
Call a webservice dynamically without webreference
Building Dynamic SOAP Requests with ASP.NET C#
You can also try to build a WCF client, and generate the managed source code file for a proxy using the ServiceModel Metadata Utility Tool (Svcutil.exe).
How to: Create a Windows Communication Foundation Client
Finally, the ProxyFactory project lets you build the proxy classes without WCF
The reason Web reference was not working was the hand crafted WSDL. It worked fine with gSoap library and gSoap C/C++ code generrator nut not with VS. With some changes in the way WSDL was written, I am now able to consume the gSoap C/C++ web service by adding a Web Reference in Visual Studio and also by using HTTP GET method.
Steps taken -
Instead of adding Web reference, use wsdl.exe in verbose mode to generate code using thee gSoap WSDL and XSD file
change the WSDL file to resolve any error and warnings reported by wsdl.exe
Once wsdl.exe can successfully generate code using the WSDL, you can now use VS add web / service reference wizard
Situation: I am trying to consume a clients web service for CC authorization. They are not publishing the WSDL file on there site, but they have provided the WSDL file. I am using Visual Studio 2005 and creating a web application that consumes the web service.
The only reference to this error that seems to apply is here: http://followtheheard.blogspot.com/2007/12/consuming-web-services.html. I installed WSE3.0 and configured my project to use WSE and am calling the WSE version of the web reference and I am still getting this error. Any help would be appreciated.
Apparently there is poor interoperability between web services written in Java requiring WSE and Visual Studio 2005. Upgrading to Visual Studio 2008 allows for easier use of the WSE3.0 toolset.