Consuming wcf service in coldfusion without generating proxy - c#

We are consuming a WCF service using coldfusion. the wcf service does not expose metadata endpoint instead they share service contracts in dll and svcutil.exe generated proxy class.
Now, how can i consume the wcf service in coldfusion without generating proxy.? i see .net client can access that way by creating channel factory as given in the following url:
http://www.c-sharpcorner.com/UploadFile/dhananjaycoder/accessing-wcf-service-without-creating-proxy/
i researched adobe help page:
http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec22c24-78b4.html
but there is no clue.
what possibilities i have to consume the service?

I don't understand the question. Let me see if I can figure this out:
No proxy would be involved unless you specify one. The client computer will invoke and consume the web service on the server without anything inbetween. It's a standard HTTP call.
You say you are connecting to svcutil.exe, a c# utility. So you seem to mean you have an additional layer between the two CF applications, correct? So svcutil.exe is acting as the "proxy"?

Related

Azure Relay for Soap WebServices

I've recently discovered Azure Relay and it seems very powerful. I have a basic project using it now to expose a WCF Windows Service. I've read in the documentation about how it can be used to expose RESTful services, but I'm having trouble understanding if it can be used to expose a SOAP web service. I can't seem to find any examples of that and the closest I can is this post about exposing the WSDL. I have an extremely simple SOAP web service with a single method that takes in 5 strings as arguments. I know WCF Services can be hosted in IIS but my client's requirement is that no firewall ports are opened so here's my actual question:
Is there a way to use a Relay to expose an internal IIS WebService publicly? Is there another method I might have overlooked to get around opening a port in the firewall?
I would be very open to exposing the service I have or rewriting it completely since it's so simple, I'm just not sure what my options are.
You could try to re-implement the service as RESTful service or as a Web API and then use Azure's API Management to expose it to the outer world.
Hope it helps!

Build a WCF according to a reference service

I am building a WCF service based on a given wsdl reference service given by Readify as a part of its technical interview process. What I did is that I built a client application that explores the methods exposed through this WCF, and then I started implementing my own version from this WCF.
I have finished the coding and the hosting part for my WCF version, and I had built another client that tests the results return from both WCFs, and everything seems okay. However, when I pass my WCF URL to the Readify testing app, it gives me this message:
I couldn't connect to that service with the contract I expected. The exception message was: There was no endpoint listening at {My WCF URL} that could accept the message.
Although, I am sure that the methods names and parameter types and the returned are the same.
Any hint???

Should I use a web service or wcf service with various endpoints? (Web service calling another web service on same server?)

I’m currently working on a web service application project which will run in IIS7 on Windows Server 2008. The web services will be invoked from various clients, from outside the server but also from other components from within the same server. (Other web services and windows services)
My view is that the purpose of web services is to expose functionality so that external clients can invoke it. I really don’t see much sense in a web service invoking another web service on the same server or a windows service invoking a web service on the same server. Please correct me if I’m wrong?
I’ve started looking into WCF, but I’m quite confused.
Would it be more appropriate to do the following?
Instead of a web service project implement a WCF service.
Expose two endpoints:
1)One, which will be exposed using traditional web service binding which will be invoked from external clients.
2)Another endpoint so that internal services, (other web services or windows services) can invoke them, supposingly more effectively, surpassing a security layer as these are aplications already running on the server.
Would my approach be correct or am I overcomplicating things?
Any suggestions or links which could point me in the right direction appreciated.
Thanks
A web service calling another web service?
If they have different responsibilities I think it's a good idea to separate them. You get better separation on concerns (easier to share with other projects / code bases), easier maintainability and independent deployability.
I would go with WCF and have two different endpoints for the different consumers, and for example use net.pipe for communication on the same server (if the client supports it) and http for external clients.
I think WCF gives you more power and flexibility that old xml web services, and the configuration part is really good.
BasicHttpBinding will give you most interoperability with external clients.
named pipes will give you the best efficiency when both services are hosted on same machine.
BasicHttpBinding is like old asmx & XML web services.
Exposing both endpoints is AOK!
One service calling another service is NOT unusual.
Hosting multiple services on same machine is common. In the enterprise, running multiple instances of SQL-Server is commonplace. Of course it depends on hardware, services & response times.

How to make an Asynchronus call to WCF service from a smart device application?

I am developing a smart device application, which is going to communicate with a wcf service over wi-fi. As there is no option to add a service reference into a smart device project I decided to use the NetCFSvcUtil.exe. Everything works great!
But...
In the end I understood that the application must interact with the service in the background.
Having read this article Microsoft .NET Compact Framework Background Processing Techniques. I decided to use the Asynchronous Web Service Call. There http://msdn.microsoft.com/ru-ru/library/aa347733.aspx I found the /async parameter, but it appeared to not work for the NetCFSvcUtil.exe.
What can I do to get the async proxy for my smart device application? Is there a way to generate it or I'm expected to add async methods to the interface with my own hands? Maybe it would be suitable for .Net CF to use SvcUtil.exe to generate the async proxy in my case?
A further more information like which platform you are using to build your Smart phone application would be helpful.
I have done Blackberry development and consumed web services. There are two ways you could build your web services
RestFul Service - Consumption of web services would be pretty easy. Posting data could be a little pain as multipart form data is posted as stream in Wcf - Rest Starter Kit
Soap Service - If you decide to use SOAP, then for blackberry and Android you have to use preverified KSOAP -2 to send and receive soap messages between your app and the web service. If you decide to use KSOAP -2 , go back ASMX services. Somehow WCF services does not communicate with KSOAP -2 (due to change in SOAP version or something) where as a simple ASMX service works pretty smoothly. There are dozens of article which you could use to learn how to use KSOAP
he original idea was to host it in a windows service...
Windows Services could never be web facing. If you want any thing to be web facing, you need a Web Server !
In the end it worked. The "Add web reference" tool created a proxy with Begin/End async methods and the proxy interacted with the wcf service hosted by a simple console application (later a windows service) through the URL property of the proxy.

Creating web service and client with shared types

I have created two wsdl files with shared types imported from xsd schema file.
After that I have created web services using interface generated by wsdl.exe tool with parameter /serverInterface.
Frist web service, have web method “RegisterData” with put into queue some complex object to be processed, by system “A”. As result of this method is returned Boolean (with tell us that object was registered successful).
Second web service, have web method “UpdateData” to update some data in system “B” based on this same object , with was changed in process on system “A”.
So in system “A” I have to create client for second web service, where I will call method “UpdateData” with this modified complex object us argument.
But when I’m creating this client in Visual Studio (by add web reference or add service reference) I have to create some namespace for client. And then when I’m trying to call “UpdateData” agument have different namespace for this same object received from first web service “RegisterData” method.
I would like to create first web service and second web service client , where I can use this same type object between them.
Thank you very much for help.
I don't believe this is possible with ASMX web services.
WCF does support this, however.
WCF Links:
WCF Developer Center
Beginner's Guide to Windows Communication Foundation
How to: Configure a Service to Reuse Existing Types
Actually, I think I may have misread your question. I though you were trying to share the same types between the client and the server. ASMX cannot do that. However, it appears you are trying to share the same types between two client proxies. You can do that easily using the WSDL.EXE tool.
Consider a schema, DataTypes.xsd, and two WSDL files that import it, ServiceA.wsdl and ServiceB.wsdl. To create the server interfaces, use:
wsdl /serverInterface /n:SharedTypes.Servers /out:Services.cs ServiceA.wsdl ServiceB.wsdl DataTypes.xsd
This will create interfaces which you can implement in order to create your services. These interfaces will both use one set of classes created from DataTypes.xsd. To create the proxy classes, simply use:
wsdl /n:SharedTypes.Proxies /out:Proxies.cs ServiceA.wsdl ServiceB.wsdl DataTypes.xsd
Notice that you do not need the /sharedTypes switch. That has a different purpose. It is for combining types of external services when you need to download the WSDL and any XSD from the service.
I have tried this using an example like yours, ServiceA posting a message into a queue, and a client picking up that message and sending it to ServiceB. It works quite well.
I agree that it is not possible to do this via the VS Web Reference functionality. To meet your requirements you can use the wsdl.exe utility with the /sharetypes switch.
For more information see Web Services Description Language Tool (Wsdl.exe)

Categories