Visual DataFlex: call WebService from the web page - dataflex

I have the web service and generated class for it. I can use this generated class in windows application as it described in Help. The question is: how can I use this generated class in the web project? (the analogous actions - creating object and use its functions -, as it was in windows app, are not worked)

Visual Dataflex questions are best asked at: http://support.dataaccess.com
There are a couple of possibilities.
Your class may not be cWebService or you have not included it as part of a web project.
For web services to be available, they MUST be part of a web project. This will usually be called webapp.src.
For functions to be available to the web service, you need to decorate them as "published"
e.g.
{ Published = True }
{ Description = "SOAP Hello World function definition." }
Function HelloWorld Returns String
Function_Return "HELLO WORLD"
End_Function
Those top two lines make sure that the function is available as a SOAP or web service call.

Sorry to answer so late, I hope you've already solved it.
There's actually a tutorial section for this in the VDF Help under Tutorials > Quick Start > Consuming Your First Web Service > Consuming a Web Service in a Web Application.

Related

How to debug MVC web app with rest api controller backend? [duplicate]

In VS 2012, I am attempting to create an MVC 4 web application with jQuery calls to a Web API project. (Other devs will be consuming the API with our current, native app, and probably adding to the API in the future.) So I have one project that is the Web API, and another project that is the MVC 4 website. I can only set one of them to run, and they use localhost:xxxxx.
How do I debug changes to both? For example, let's say I add a new API path /api/customer/get and then a new jQuery ajax call to that path and do something with the resulting JSON. I've changed code in both projects and want to follow it end-to-end; how do I launch both? How do I debug both?
Just to be clear, the MVC app isn't making server-side calls to the API, I'm using MVC mostly to be able to easily use bundling, minification, and (hopefully) pre-compiled Handlebars templates in .NET; the API calls are coming from jQuery. As I am still relatively new to these technologies, alternate suggestions are welcome.
Thank you in advance.
I had the same problem and have found a solution from here:
forums.asp.net
The fix is to do the following:
In your solution file, click properties go to the Startup project node (if it is not already selected)
Next select Multiple startup projects. Select your website and your webservice and in the Action column make sure both of them have "Start" selected.
Now when you debug your website and put a break point in your webservice, it should hit the break point.
Coming late to the party but in case anyone else is looking for a solution, this is what was best for me: Set the Api project up to be the starting project (I needed to limit to one startup so that I could flip between browsers more easily). After firing up the service project, right click on the web/ui project and select debug, start new instance. You'll have both running and you'll seamlessly step from web to api.
I had a similar problem with my web api project. My solution consisted of an angular front end with 2 web api projects on the backend. One web api project handled "authorization" and the other handled "resources". I used the following tutorial by Taiseer Joudeh as a starting point:
http://bitoftech.net/2014/09/24/decouple-owin-authorization-server-resource-server-oauth-2-0-web-api/
Breakpoints worked on the "authorization server"... but not on the "resource server". I compared the packages from the two projects to see what was different. Once I added "Microsoft.AspNet.WebApi.Cors" to the "resource server" project, the breakpoints starting working.

Can't access webservice using Xamarin and WCF

I would like to consume a public web service using Xamarin and WCF. For this demo, I'll be using Xamarin.iOS .
This is the (public) webservice I'm trying to consume:
http://www.webservicex.net/globalweather.asmx?WSDL
Inside Xamarin Studio, I add a Web Reference with the URL from the webservice. The selected Framework is set to Windows Communication Foundation (WCF).
Now, I'm using the following code to connect with the service:
var _client = new GlobalWeatherSoapClient();
_client.BeginGetWeather ("Berlin", "Germany", (ar) => {
var result = _client.EndGetWeather(ar);
}, null);
When executing this code, I'm getting a System.NullReferenceException. This is the problem, why isn't it working correct?
The strangest part: When I'm not using WCF, but select .NET 2.0 Web Services as Framework, everything seems to be working fine.
I can't see what's wrong with my WCF code - according to the docs, everything should work ok.
I hope somebody can help me out! Thanks in advance!
You are not following the docs.
Quote from that page:
To generate a proxy to a WCF service for use in Xamarin.iOS projects,
use the Microsoft SilverlightServiceModel Proxy Generation Tool
(SLSvcUtil) that ships with the Silverlight SDK on Windows. This tool
allows specifying additional arguments that may be required to
maintain compliance with the service endpoint configuration.
So, first thing is that you need to create a proxy on a Windows machine with slsvcutil. Adding WCF references to project through Xamarin Studio does not work. It only works for .NET 2.0 Web Services, that's why that option is OK.
Second thing, after you have created your proxy on Windows with slsvcutil, you need to add it to your project.
Third, you need to initialize it like this, with basic http binding (again, code from the above link):
var binding = new BasicHttpBinding () {
Name= "basicHttpBinding",
MaxReceivedMessageSize = 67108864,
};
//...
client = new Service1Client (binding, new EndpointAddress ("http://192.168.1.100/Service1.svc"));
Suggestion: forget about WCF on iOS. That article contains very useful information on other means of client-server communication.

is there a web service client code generator on iOS?

i am going to develop some features which need to invoke remote web service implemented by c#, i've already googled it get that join wsdl content seems like:
NSString *requestBody = #"<wsdl:definitions xmlns:soap=\"http://schemas.xmlsoap.org/wsdl/soap/\" xmlns:tm=\"http://microsoft.com/wsdl/mime/textMatching/\";
is there a tool could generate a class used to invoke specified web service like asp.net or java?
for example in c# open visual studio terminal execute this:
wsdl http://google.com/service/weather?wsdl
anyone get any idea?
it is disgusted with join mess of string
You can find a code-generator for translating a WSDL to multiple languages here: http://sudzc.com/

Consuming a Web Service in Delphi 2007

Can any one explain or help me create a code to consume the following Web Service: http://207.150.244.30:9000/txserver/1?wsdl I've worked with this web service but with no luck!
Simply let the WSDL Importer do the stuff for you. Go to File / New / Other and there go to Delphi Projects / WebServices / WSDL Importer. In the wizard just paste your web service definition link you've posted and finish the wizard. Delphi will generate complete unit including all classes, functions and properties.
.....................................................................................................................................................................
Complex guide for creating web service clients you can find for instance here.

Integrating FedEx Web Services into .Net, stuck at step 1

I'm signed up, I've downloaded sample code, I've got a WSDL...and yet I have no idea how to get this stuff into my existing .Net application. The WSDL was in a zip file, not a URL so I can't just "Add Web Reference." I've run the wsdl tool from the .Net command prompt, and it made a nice class for me...yet dropping that into my web_reference folder doesn't give me any kind of instantiatable class.
I know I'm missing something stupid. Can someone point me in the right direction please?
The proper way to load the FedEx API WSDL file in Visual Studio 2010:
Open the Solution Explorer
Right click your project
Click 'Add Service Reference'
Click the 'Advanced...' button
Click the 'Add Web Reference...' button
Enter the exact path to the WSDL file for the specific FedEx web reference you're using. For example, I extracted mine to the root of my C:\ drive, so all I entered into the URL field was "C:\ShipService.wsdl" without quotes. If you leave quotes, it won't work.
When you hit go, Visual Studio should consume the wsdl into workable classes for you. Click Add Reference and enjoy!
Note: Make sure you read the FedEx documentation well - a lot of their services have gotchyas and implementation can be a nightmare. For example, their address validation service is consumed incorrectly and creates two-dimensional arrays in Reference.cs where they shouldn't exist - this is detailed in the documentation. Worse yet, the fact that they don't allow address validation on their dev environment isn't documented anywhere! Good luck!
Actually, you can just "Add Web Reference". Give the path to the URL.
OTOH, you should be doing all new web service development (even client development) using WCF. Microsoft now considers ASMX web services to be "legacy technology".
BTW, I just tried using their address validation service, and it won't work with .NET. Both ASMX and WCF clients will attempt to use the XML serializer to consume this service, and there is a bug there that prevents that service from being used.
Matt, the WSDL zip file has the WSDL and its associated transactions for that service. Unzip the file and then "Add the reference" to the WSDL in your code.
Try changing the namespace of the proxy class to that of your application. I currently use the proxy class with C# and it works in spite of FedEx's limited documentation and samples.

Resources