Please tell me, can i accomplished something like..
Some company has created CRM, this CRM provides some Web Services. I can communicate with this services via XML. So my question is can i create Windows Services with WCF which will be send some request ( every hour ) to Web Service and receive data from this web services.
Example:
At 9am, 10 am... WCF has sent request ( XML ) to Web Service:Hey CRM how many users you have?
Web Service received a message and response via XML: I got 10 users.
WCF received message: I got 10 users... and did something with it.
Please for some help. Articles, code sample, or key words what should i look for.
nothing in your question indicates the need for WCF, it sounds like all you need to do is create a SOAP reference (web reference) to this CRM Web Service and call it every hour. This could be a console app or any app for that matter.
If the provided web services are standard, WCF should be able to communicate with them.
Add a service reference, specify the URL, and if discovery (WSDL) is available, Visual Studio will allow you to quickly generate a proxy class that makes using the server very easy.
Scheduling the requests every hour is not related to wcf, use task scheduler or a manual solution for that.
Related
I am developing a software that, apart from having its own BackEnd, has a module that must be integrated with an external web service. The external web service is as follows: https://e-seida.sunat.gob.pe/ol-ad-itseida-ws/ReceptorService.htm?wsdl
In the project (.NET C#), it can be easily referenced and I can see all the contract and methods that the external web service has exposed. I can do the same thing from the SOAP UI when I test successfully hitting the web service.
As you can see in the image, when you hit the web service, you have communication and a response from the SOAP UI. Now this does not happen in my project because although it is true the web service could be referenced, but until now I am still looking for the way or way to send the security data (UsernameToken) to the web service, honestly it is somewhat frustrating because I've been having this same problem for several days now and I can't give you a solution and researching I have found some possible solutions and none of them have really helped me.
I understand that the Header of this web service contains WS-Security type security, which is basically an open standard approved by OASIS to provide transport layer security (through SSL/TLS from HTTP).
I have also investigated some forums where they indicate that creating the following interfaces/classes (MessageHeader, IClientMessageInspector, IEndpointBehavior) but implementing that does not solve it either.
What can I try to resolve this?
This is a difficult one so hoping someone has been here before with this.
Long story short - we have several hundred web services in projects that use Microsoft's "Add Service Reference" to generate methods from the wsdl.
We now need to push these thru another service first and relay on the call to the original server and do the same with the response.
We have a service that takes soap requests (XML) and does this already so want to reuse this if possible.
How do we get at the SOAP request data either via intercepting the web service call (redirect to stream or file etc.) or see what it would have generated as SOAP XML.
We have no way of using current software to redirect these calls so need a bespoke solution as we need also to track everything going thru the re-director.
The existing rerouting service takes a SOAP XML and passes to another URL and works well for a different project - so we just need the SOAP XML produced by the web service call and we can reuse the service.
//Example call to a simple wsdl generated interface...
Calc.CalculatorSoapClient clc = new Calc.CalculatorSoapClient();
clc.Open();
int x = clc.Add(1, 2); // need to get soap that would have been sent to the web service here
clc.Close();
I know that ASP.net web service supports only HTTP protocol and with WCF you have more options like TCP and Named pipes etc. Can you think of any scenarios in which one might have to consume a WCF service through an ASP.net Web API?
Following would be one of them use case where you want to call wcf service from web API.
If you already have a wcf service running and available which is doing some complex operations and you do not want it to be available directly to your consumers, you can create a web API and call the wcf service to perform the complex tasks and let the consumers to use the web API. In web API you can put extra logic of validation and authorization of the incoming requests.
Wcf being an older technology it would be better to write something new and eventually replace wcf rather than maintaining it.
Also If the current wcf is setup is not available via http protocol then not all the clients can communicate with it. Web API has that edge over wcf service.
How web API would connect to wcf service?
This depends on lot of factors such as network, deployment strategy, security etc.
But following would be one of the examples.
If the wcf service is available on tcp and web API and wcf are running on the same network, then web API can call wcf.
There may be a different answer to this question based on what exact problem you are trying to solve.
My answer is based on what information you have provided and the experience I gained by solving similar issue in real life.
I have been looking up on youtube regarding Web Services being consume using android. Most of the video are all 1 or 2 years old. Is this doing outdated? is there a better way to do this? currently i am in a company and i was assign to have a android version of their webservice.
I was told to create the service with sql using Visual studio.
Create the android UI and using the services to pull the data.
Am i doing it right?
What is the better or ideal way of going about this?
Should i add JavaScript or something like that?
I have been looking at RESTful , Soap , Json and Wcf. But what is the best way to go if i have to start everything from scratch?
-Programs/System that i am using.
Microsoft Visual Studio Express 2013 for Web
SQL server
IIS express
Android Studio
*I was told to only user framework 4.0 for Visual studio
You can use WCF (SOAP), WCF (RESTful) or WebApi to create a service, both has it's own advantages and disadvantages. You may want to take some time to look at your requirement and then decide what type of service you want to develop. SOAP uses a more complicated messaging pattern using XML, where as REST uses the standard HTTP protocol and methods to communicate and transfer data. But if you are planning consume this service across of variety of applications like mobile, web, desktop, client side script interaction etc, you may consider developing the service as a RESTful. More information on SOAP and RESTful and for detailed understanding you may refer to this link
Understanding SOAP and RESTful
There is a third party application and its web service and it has some web methods that I call them in my application. For some technical and administration resasons that we have on our side I cannot install anything like Fiddler or WireShark, etc on the Citrix box that runs our application. All I can do and I want to write is to write a very small C# winApp that kind of shows me a log report of what is going one when I call one of the web methods of that web service. What should I do? Is there any sample source codes I can look at?