WCF Test Client - Sort service functions by name - web-services

When I add a service reference in WCF Test Client all of the exposed service functions are listed but in no order I could figure out...
Is there a way to sort the exposed service functions alphabetically?
Weather in WCF Test Client or in the service itself?

It appears to not be possible.
According to this answer, WCFTestClient will take the same order as the Type.GetMethods method which follows no particular order.
But as pointed out in this other answer, you can just type the first letters of the name of the method to highlight it (I agree this is not what we really want!)

Related

Is it possible to create Siebel inound web service based on workflow with more than one operation?

I have a requirement to publish Siebel inbound web service with only one port, at the same time WS has to receive three different operations.
My WS's are based on workflow.
As I could read in the bookshelf the only one operation is possible to add in the one port of WS based on WF:
https://docs.oracle.com/cd/E14004_01/books/CRMWeb/CRMWeb_Overview12.html
(see p.5)
However I've found vanilla WS that looks as I need:
FinancialAssetService
Could anyone give me some tips how to create such WS?
Is it possible to receive different IO by different operations of this WS?
Thanks in advance!
Well, if your web service provides 3 operations, you must be invoking 3 different workflows, right? (It says so in the page you linked: a workflow corresponds to a single Web service operation). Then, yes, you'll need to define 3 "service ports" in your web service.
However, I don't see why that would be a problem at all. I've never done this myself, but you can define the same endpoint URL and HTTP port for each one of the 3 service ports. The external application consuming your service would never notice any difference.
As for your second question, yes, having 3 different workflows would obviously allow you to choose different integration objects for each operation.
On the other hand, if you only have one workflow and need 3 operations because you want it to accept different input structures, then you might want to rethink your solution. Perhaps create 3 tiny workflows (or a BS with 3 operations) to just transform the data to a common IO (using Siebel data mappings), and then pass it to your existing WF.

Web service recommendation, what and why?

I just read a great article on web services by Patrick Cooney at AListApart. However, something is still vague to me on why web service recommendation is important and how it works? Is this approach an alternative for UDDI and similar solutions?
UDDI provides the infrastructure for web service discovery. As the linked article from the comment says, it is basically the "yellow pages" for web services.
If I understand your reference to "web service recommendation" correctly, you mean a system that, given a list of equivalent candidate services, chooses the best one for you, probably based on matching a set of requirements against some kind of QoS metrics of these services.
Therefore, such a system can be used as either an addition to UDDI (if the consumer performs the basic discovery and only delegates the dynamic selection to the recommendation system) or replace it transparently for the consumer (the consumer asks the recommendation system for a service type with some given QoS parameters). In the second case, the recommendation system would use UDDI for discovery and then filter the answer for the consumer based on the QoS parameters.

Calling web service to web service; Architecture View

An interesting situation has came today as in the past too.
I have two web services. The transaction will be over after those two has done their own jobs. For this discussion I will name these web services as:
RLService
NavService
I cannot combine both services because the service 2 is owned by 3rd party. This 3rd party web service provides me a webmethod that read the xml file stored in that machine, where web service is, and process.
I have two options:
Client to Service**(S)**
Client call my web service, RLService, with xml data.
RLService store xml data to xml file and return the xml file path
Client call Navision web service, NAVService, with xml file path
NAVService return the result as xml path.
Client call my web service, RLService, with xml file path, which returns back with an Object to proceed further.
State Diagram:
Service to Services
Client call my web service, RLService, with xml data.
RLService store xml data to xml file
RLService call Navision web service, NAVService, with xml file path
NAVService return the result as xml path.
RLService, processed returned xml and convert to an Object to proceed further.
Client receive a class Result object.
State Diagram:
Here is how the physical architecture looks like:
I have followed both ways, but what is the right approach and why?
Of course, I know that the second solution is good. But what about patterns and best practices.
Q: Which approach is better?
A: The fewer round trips, the better.
A: The more you can do in one call (without making another, separate call), the better.
In other words (all things being equal), it looks like your second design is a LOT better than the first alternative.
IMHO...
If you put this logic in your service, obviously it decouples the client application from the needed workflow and makes sure the application/business logic is in your business service. In fact, it would be better to keep your client as thin as possible. So solution two would be the preferred solution (for me). You can still decide to make it an asynchronous operation, of course, that depends on your use case.
As a result, any change in logic only impacts your service, not the clients.

Can Webservices be stateful? Can two different operations(from same client) of a stateful web-service be under same transaction?

I am a newbie in stateful webservices area. Please ignore if any of the below questions do not make sense.
I have mostly dealt with stateless webservices. One question in my mind is that can we pass session id to a web service thru the XML API. Is there already a provision for this(so that it becomes stateful)? Does a Java-XML api to invoke a web service has a provision to make use of cookies?
Are RESTful web services stateful? Is this the reason they are called RESTful?
Let's say I am using a stateful web-service. And I have two different operations where 'Atomicity' of operation has to maintained(take an example of Credit/Debit of card and cruz booking). Both have to be successful or neither.
Can such a thing be achieved using a web service?(because I dont know how transaction control can be applied to web services. It would have been easy if I had to deal with only services(ejb) layer).
If yes-this gives rise to another question-how transaction manager identify client context and does the same transaction context gets applied to these operations which should be part of one meaningful and atomic transaction?
Does this depend on the framework/programming language that we gonna use? For e.g. I want to achive this using JSF/SpringMVC UI and JAX-WS/Axis web service. If no, please let me know what other similar frameworks(from Java) have this and provides the solution. Servers - weblogic/jboss.
Thanks
Prakash

Transforming a web application to a web service

a. What are the things I must consider?
b. I have several Stored Procedures being execute by the current application. If I create equivalent methods to execute these procedures, what would be the risk or the challenge.
Architecturally, one thing you must consider in transforming a web app to a web service is that local access to methods and data is not the same as remote access. Remote access should be designed so that invocations are more course-grained and exchange more information at once.
Another thing you would need to think about is what your serialization protocol you will use. For example, SOAP vs a REST-based protocol.
Also, think about security - the security considerations are different between a web application and a web service.
Finally, think about how others will know about your web service (or if they will at all).
One risk is ensuring that your code remain the same.
What I mean by this is that there is a distinct possibility of code duplication in this situation, and as such means that you may inadvertently forget to modify one of the places where the Stored Procedure is used (say if you add a new variable to the stored proc call).
Then you also must consider security. For example, exposing a web service call that provides a list of users to the wild is probably not that good of an idea. you need to plan for how you're going to pass/receive authentication & authorization information.
Managing your code base as Stephen said is going to be a big challenge if you create equivlant methods. Your much better off extrapolating the methods into a new library, that both the web application and web service will use. Your web apps shouldn't have any data access code in them.
With a web service you need to consider your clients. Who is going to access your data and from where. If for example its from a .net windows client on the same network or machine a TCP binding might be best. Or if you need to support older .net framework clients or even java clients you need to be careful about what technology you use.
You will also want to choose between WCF or ASMX. Which the previous paragraph shouuld help answer.
It seems to me that the greatest challenge will be that you are obviously tempted to do this. I think you're making a mistake.
Your web application, and the web service you propose, have different requirements. By "transforming" the application into the service, you will burden the service with the requirements of the application.
Here's a "thought experiment": what if you were to write the service from scratch, ignoring the application. How similar would the service and application be? If they would wind up alike, then transformation would make sense. Otherwise, not so much.