Wondering if somebody done it before. We are using WCF in our current architecture and when internally not going over the boundaries I would like the ability to reference the project directly.
I don't want to use tcp or named pipes, I would like to know if is technically possible to alternate between a project reference or normal communication with WCF eg tcp-http etc..
Is there any example or approaches to achieve this?
Looked on google and stackoverflow but I could not find an answer if the title was the same
Many thanks
Related
I really like all the boilerplate code Spring Data Rest writes for you, but I'd rather have just a 'regular?' REST server without all the HATEOAS stuff. The main reason is that I use Dojo Toolkit on the client side, and all of its widgets and stores are set up such that the json returned is just a straight array of items, without all the links and things like that. Does anyone know how to configure this with java config so that I get all the mvc code written for me, but without all the HATEOAS stuff?
After reading Oliver's comment (which I agree with) and you still want to remove HATEOAS from spring boot.
Add this above the declaration of the class containing your main method:
#SpringBootApplication(exclude = RepositoryRestMvcAutoConfiguration.class)
As pointed out by Zack in the comments, you also need to create a controller which exposes the required REST methods (findAll, save, findById, etc).
So you want REST without the things that make up REST? :) I think trying to alter (read: dumb down) a RESTful server to satisfy a poorly designed client library is a bad start to begin with. But here's the rationale for why hypermedia elements are necessary for this kind of tooling (besides the probably familiar general rationale).
Exposing domain objects to the web has always been seen critically by most of the REST community. Mostly for the reason that the boundaries of a domain object are not necessarily the boundaries you want to give your resources. However, frameworks providing scaffolding functionality (Rails, Grails etc.) have become hugely popular in the last couple of years. So Spring Data REST is trying to address that space but at the same time be a good citizen in terms of restfulness.
So if you start with a plain data model in the first place (objects without to many relationships), only want to read them, there's in fact no need for something like Spring Data REST. The Spring controller you need to write is roughly 10 lines of code on top of a Spring Data repository. When things get more challenging the story gets becomes more intersting:
How do you write a client without hard coding URIs (if it did, it wasn't particularly restful)?
How do you handle relationships between resources? How do you let clients create them, update them etc.?
How does the client discover which query resources are available? How does it find out about the parameters to pass etc.?
If your answers to these questions is: "My client doesn't need that / is not capable of doing that.", then Spring Data REST is probably the wrong library to begin with. What you're basically building is JSON over HTTP, but nothing really restful then. This is totally fine if it serves your purpose, but shoehorning a library with clear design constraints into something arbitrary different (albeit apparently similar) that effectively wants to ignore exactly these design aspects is the wrong approach in the first place.
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Best practices for versioning your services with WCF?
Alright so this has been my weak point and really do not know how to approach this. I have designed a WCF Web Service and cannot figure out what the best way to version (that is if I am using the correct word for it) the application so when changes are made for one client I dont have to have all others update and recompile their apps until they actually want changes made than they will get the new version that others might be using. I was hoping to eliminate client specific service. The web service references a common library for business layer. I don't know if I should follow a specific standard or doing this completely wrong, so I hope you can help me out or point me into right direction of the best way to do web service versioning.
One of the most common and useful (from my point of view) ways to version your WS is by putting the version number in the URL according to each release.
For example, this is the url for the Twitter API
https://api.twitter.com/1.1/
So one of the functions are hosted here
https://api.twitter.com/1.1/statuses/mentions_timeline.json
In case you need to update it and work in a new release, you can publish it here:
https://api.twitter.com/2.0/statuses/mentions_timeline.json
Let me know if that helps you somehow.
Regards,
Is there any site from where I can get the most of the information about WCF configuration settings e.g. keyEntropyMode,maxStatefulNegotiations,sessionKeyRolloverInterval, negotiationTimeout etc.
I have started recently working in wcf but is facing many troubles in understanding the terms. There are to be honest huge. And whenever I get stuck, it takes a long time for me to solve it (searching and searching in google and after spending sometime hours I may get the solution).
Henceforth, I think it is better to know if not all astleast some of the terms and their usage and what they means.
It would be great help if anyone can point such a link. I searched in the net with " wcf configuration file elements" but with not much luck.
Thanks
That would be a very very large page! All the WCF settings..... don't know if you could have that "at a glance"....
WCF is a big beast - it has a ton of options and settings, and they do get almost overwhelming. Point is: do not try to know and master all of them - you won't be able to do that. Get to know what you need to know, build a solid foundation, and then go from there and learn more as you need to.
Also - do you know about the visual WCF Service Config Tool in Visual Studio?? Extremely helpful indeed! Invoke it from the Tools > WCF Service Configuration Editor menu or right-click on a app.config in your solution explorer and pick Edit WCF Configuration. You'll get something like this:
The great thing about this is:
it gives you dropdown lists for lots of stuff, like the bindings - you can pick your binding, so you always see your valid options
it will show you the properties on each item, so you can fill them out as needed (or even discover new properties)
it gives you nice tasks you can perform, like adding a new service or a new endpoint
That's probably as close as it gets to a "complete overview" of WCF. Other than that - check out the great books Learning WCF by Michele Leroux Bustamante for intro to intermediate level, and Programming WCF Services by Juval Lowy for really advanced stuff. Great references and great places to look up stuff!
Learning WCF http://ecx.images-amazon.com/images/I/41wYa%2BNiPML._BO2,204,203,200_PIsitb-sticker-arrow-click,TopRight,35,-76_AA240_SH20_OU01_.jpg
Exactly what problem are you trying to solve? You don't really need to learn all WCF config settings. There are a lot of settings, some are specific to hosting methods, concurrency (or lack thereof), session management, instancing, bindings, behaviors, etc...
I've been looking around for good wcf samples which expose both WCF and REST endpoints with end to end examples and I am having a bit of trouble finding anything concrete. There are a lot of samples which say you can do this or you could do that, but nothing that really seems to bring it all together.
For instance, I'm looking for something that brings together suggestions on uri's you should use to avoid problems (both for the services and data contracts), where to place your xsd's, whether its worth trying to use the same server end point for both rest and soap, versioning and generally best practices when using WCF with rest and soap in an enterprise situation.
Cheers
Anthony
Here is a popular stack overflow question on the subject. It is based on .Net 3.5 though. I have not seen many samples relating to .Net 4 yet.
However, IMHO I would avoid this trap like the plague. Doing a good API is difficult, SOAP APIs and REST apis are very different and despite what the marketing material claims, you can't just twiddle some config files, add some attribute dust and convert between the two.
Pick the one architectural style that suits your needs and do it well.
NerdDinner.com : NerdDinner uses WCF Data Services, which is a great way to correctly implement RESTful services on top of WCF. The reason I am point to that, and not WCF data services directly is because it is a public website and you can use it.
Our application is interfacing with a lot of web services these days. We have our own package that someone wrote a few years back using UTL_HTTP and it generally works, but needs some hard-coding of the SOAP envelope to work with certain systems. I would like to make it more generic, but lack experience to know how many scenarios I would have to deal with. The variations are in what namespaces need to be declared and the format of the elements. We have to handle both simple calls with a few parameters and those that pass a large amount of data in an encoded string.
I know that 10g has UTL_DBWS, but there are not a huge number of use-cases on-line. Is it stable and flexible enough for general use? Documentation
I have used UTL_HTTP which is simple and works. If you face a challenge with your own package, you can probably find a solution in one of the many wrapper packages around UTL_HTTP on the net (Google "consuming web services from pl/sql", leading you to e.g.
http://www.oracle-base.com/articles/9i/ConsumingWebServices9i.php)
The reason nobody is using UTL_DBWS is that it is not functional in a default installed database. You need to load a ton of Java classes into the database, but the standard instructions seem to be defective - the process spews Java errors right and left and ultimately fails. It seems very few people have been willing to take the time to track down the package dependencies in order to make this approach work.
I had this challenge and found and installed the 'SOAP API' package that Sten suggests on Oracle-Base. It provides some good envelope-creation functionality on top of UTL_HTTP.
However there were some limitations that pertain to your question. SOAP_API assumes all requests are simple XML- i.e. only one layer tag hierarchy.
I extended the SOAP_API package to allow the client code to arbitrarily insert an extra tag. So you can insert a sub-level such as , continue to build the request, and remember to insert a closing tag.
The namespace issue was a bear for the project- different levels of XML had different namespaces.
A nice debugging tool that I used is TCP Trace from Pocket Soap.
www.pocketsoap.com/tcptrace/
You set it up like a proxy and watch the HTTP request and response objects between client and server code.
Having said all that, we really like having a SOAP client in the database- we have full access to all data and existing PLSQL code, can easily loop through cursors and call the external app via SOAP when needed. It was a lot quicker and easier than deploying a middle tier with lots of custom Java or .NET code. Good luck and let me know if you'd like to see my enhanced SOAP API code.
We have also used UTL_HTTP in a manner similar to what you have described. I don't have any direct experience with UTL_DBWS, so I hope you can follow up with any information/experience you can gather.
#kogus, no it's a quite good design for many applications. PL/SQL is a full-fledged programming language that has been used for many big applications.
Check out this older post. I have to agree with that post's #1 answer; it's hard to imagine a scenario where this could be a good design.
Can't you write a service, or standalone application, which would talk to a table in your database? Then you could implement whatever you want as a trigger on that table.