How to call WCF method from the SSRS? - wcf

I am developing the SSRS report and wanted to consume the one method call of the WCF service. Suppose I have a service Url like http:\\localhost\2014\security.svc and wanted to consume string Encrypt(string data) method from that service.
Now I know how to use XML and Web service as the data source. I don't want that what I want is to call the web service to get the some values encrypted on the report so I can use the expression to set the encrypted values for the some fields. In case of confusion feel free to leave a comment. Any help would be great .

Related

How do I create and Axis2 client

I've been given a WDSL file and have to create a web service client using axis2. I've been able to generate the CallbackHandler and Stub using WSDL2java. I've tried following this tutorial to create the Client http://briansjavablog.blogspot.com.au/2013/01/axis2-web-service-client-tutorial.html
I'm not sure if I implemented the client properly. It runs, but I'm not sure how you view any output results. I've never dealt with web services before. The Stub file that was generated contains so much code, how am I supposed to know what I should be calling? All tutorials I've found give example Clients, but I want to know what I need to look at to create my own.
If anyone has any advice or links to creating clients that are easy to understand, it would be appreciated.
I think that this probably went un-answered for a while due to the fact that the question is not clear and you probably need an introduction to Web Services and SOAP in general. If you are given the WSDL (or can pull it from a URL out there somewhere) then you are using the Web Service as a client - you have (from the post) already created the stub for client use. You simply need to use it. You are sending a request to the server (Web Service) and sending it the data that it requires (as the SOAP parameters that are laid out in the Web Service schema). Based on this SOAP request you will get a response. Your stubs that are created for the client act as the invocation and response points for your client.
So your question as to how do you test it: you decide what to do with the response as this is what you are coding into the client.
And about creating your own Web Service - you would need to start with a schema (often times you write your objects/data and the functions that you want them to perform and tools (like Axis2) will generate the server code (for Web Services and SOAP transport) on top of this.
So in your question, I think that you need to a) check out some Web Services books/online tutorials to figure out what it is, b) code your client to display the results and stuff - and just make sure that you are actually sending and getting responses from the Web Service, and c) also see what it would take to create your own Web Service (for whatever purpose you are planning the service to be established for, before creating your own.
Effectively I think that you just need to get your feet wet with Web Services in the first place. And the tutorial that you pointed out ( http://briansjavablog.blogspot.com.au/2013/01/axis2-web-service-client-tutorial.html) is excellent for anyone looking to get a web services client started - thanks for posting that.

access wsdl file and display methods and parameters in c#

Hello I am very new to WCF Services kindly excuse me for wrong terminology. I need to display all the methods in a list and when the method is selected I need to show the parameters so the user can enter the parameter value like id and name so that we can invoke the service and compare the result with expected and actual result.
Note: the user will only provide the WSDL URL, and from there I can generate a dynamic proxy because our services usually change using (http://blogs.msdn.com/b/vipulmodi/archive/2006/11/16/dynamic-programming-with-wcf.aspx).
How do I get the operation and parameter types so that we can generate client and invoke service with the parameters. Just want to display methods get the values for parameters from user and invoke the service in a C# windows application.

Architectural Advice on designing a WCF contract to expose a desktop app functionality

We're currently working on exposing the functionality of a Windows Forms application via WCF services.
As an example, there is a form with multiple dropdowns in the desktop app. We would like to design a service that will allow a client to submit a request with all required values as if that client filled the info in the desktop app.
My question is:
What is the best way to expose allowable values for the dropdowns in the WCF service contract?
Enums in contract (Enumerations in DataCountract)
Shared assembly
Accept strings from client, on the server find the id or return an error
Note that some fields have a lot of allowable values (desktop app uses type ahead search).
How did you handle issues like this in your projects?
Thanks in advance
IMO, the best way is to use an enumeration in the DataContract (first option you listed).
It's much more interoperable than a .Net assembly (if you expose a SOAP webservice through WCF, you'll be able to consume it from other technologies).
And you won't need to manually parse a string, an exception will automatically be sent if the client tries to use an invalid value.

Windows Phone - WCF - cannot refresh webservice call

I have a WCF web service, and a windows phone application.
The phone app's home page has a WCF ("GET") call I would like to refresh every 30 seconds.
No matter what happens to the data on the back end... the call to the WCF service will always return the data from the original call to the WCF service.
If i go to another page, and make the same call I will get the different modified data.
Is there some kind of caching on "GET" calls on the phone side?
Debugger
I do not think it is even going to the WCF to make the call.
My debugger looks like it's not even hitting the WCF again when I try to refresh. The HTTPWebRequest just spits out the oroginal GET call if i am on that same page.
Details
WCF - webHTTPBinding (REST)
I found the answer...
There must be some Magic Caching on windows phone going.
I recall reading on some other thread a while back and tried it.... and it worked !!
Basically i'm just adding a unique id that doesn't matter to he URI string. In the case below.. i decided to use a GUID... this way each call uses a unique different URI for the REST call. It seems to work.
string uri = RESTCon.BaseString + "RESTMethodCallName?id={0}";
w.DownloadStringAsync(new Uri(String.Format(this.uri, Guid.NewGuid().ToString())));

View underlying SOAP message using vb.net

I have a VB.NET web service that calls a third party web service. How can I view the SOAP message generated by .NET before it is sent to the third party web service and how can I see the SOAP response before it is serialized by .NET.
When creating a standalone EXE, I see the Reference.vb file that is automatically generated, but don't see a similar file when my project is a web service. I have found lots of C# code to do this, but none in VB.NET.
Edit - Fiddler and TCP loggers are great, but will not work for my purposes. I need to be able to access the raw SOAP messages from within the application so I can log them or modify them. I need to do more than just see the messages going back and forth.
You can use fiddler or a tcp sniffer to filter and identify all outgoing and incoming traffic on your host.
This is if you want to see the xml request and response.
How about using an extension to allow you to examine the SOAP message?
Accessing Raw SOAP Messages in ASP.NET Web Services
http://msdn.microsoft.com/en-us/magazine/cc188761.aspx
I was trying to do the same thing and this seems to work for me:
Dim message As String = OperationContext.Current.RequestContext.RequestMessage.ToString()
I didn't think it would be that easy since most of the time ToString() returns the name of the class, but I tried it out and low and behold.
I know you asked this back in January so if since then you've figured out a better way let me know.
Please note that if you're catching the exception in a class that implements IErrorHandler then you have to perform this operation from within the ProvideFault() method instead of the HandleError() method because the context is closed before it gets to call the HandleError() method.
Hope this helps.