OSB Proxy Based Logging - soa

Is there any way to create separate log files based on Proxy services?
http://carlgira.blogspot.in/2014/07/osb-custom-proxy-logging.html
The above url provides some info. But that seems not working. We require something as in what is described in url.

The report is a way to do it, but if you are going to use that option i would recommend to create a custom report provider.
The solution on the blog (the blog entry is mine) tries to use a startup-class of weblogic to modify the order of the loggers so you can add a custom one, before the real one.
There is a second blog entry with more detail and the complete maven sources in github.
The blog entry http://carlgira.blogspot.com.es/2015/05/weblogic-filter-logs.html
The github sources https://github.com/carlgira/soa-utils/tree/master/weblogic-custom-logging

If you want to log the request and the response for single proxy service , then you can go for Report Action.
Here , you can do reporting for single operations and proxy service.

Related

How to listen HTTP post requests behind ipfs gateway?

I was able to create a website with a domain name behind a ipfs gateway like cloudflare.
Can I listen HTTP post requests ?
A ipfs website like torrent-paradise.ml, seems to send HTTP post requests (ex: /api/search?q=test)
IIUC the website you mentioned uses old school nodejs app for the /api/search endpoint.
Search feature is not provided by the IPFS daemon.
By default IPFS gateway allows only HTTP GET.
One can enable experimental Writable Gateway feature, which then accepts HTTP POST: https://discuss.ipfs.io/t/writeable-http-gateways/210?u=lidel, but it only allows you to import data to IPFS. There is no search feature.
That being said, I believe you should not care about HTTP method used, but ask "how to build dynamic app on IPFS" or "how to do search using immutable data on IPFS" instead.
Some pointers/ideas:
Build a DAG-based index and put it on IPFS, then have your app traverse the graph while looking for answer (fetching only subset of the index, only when needed)
Leverage libp2p's pubsub for real-time features (eg. by running js-ipfs on the page)
Look into CRDTs for decentralized conflict-free data types
While you can do it all by hand and tailor your solution to a specific problem, reusable primitives for the last two are provided by existing projects built on top of IPFS, like OrbitDB.

asp.net mvc and web api which is better Http POST or PUT

I have an application of type asp.net mvc and web api.
I m little bit confused over http post and http put.
When to use what and what is the pros and cons of each.
I have gone through many blogs but no solid reason what is designed for what.
Use POST where you would have to create completely new record from scratch.
Use PUT where you would have to update existed record in your database
Here are Differences between PUT & POST
`POST is Not idempotent`-->
Means running POST operation again and again will create new instance everytime when you run call it.
`PUT is Idempotent`-->
PUT is Idempotent operation calling PUT again and again will result same result.
So POST is not idempotent while PUT is idempotent.
`There is also PATCH` -->
Use patch when you would have to update only few properties of your model.In other words Partial Updates.
Put simply (no pun intended):
POST is usually used to CREATE new objects.
PUT is usually used to UPDATE existing objects
Using the correct HTTP verbs allows you to publish a cleaner API and negates the need for encoding intent within the endpoint (url). For example, compare:
Using the correct verbs:
GET api/user/12345
POST api/user/12345
PUT api/user/12345
DELETE api/user/12345
Hacking the endpoint:
GET api/user/12345
POST api/user/12345/create
POST api/user/12345/update
POST api/user/12345/delete
I think the only Cons of using PUT etc are that not all developers are familiar with them and some third party software may not support them or at least it may not be as easy as using the more familiar verbs like GET & POST.
For example, I had a problem a few weeks ago when a proxy was placed in front of an API just before it was to go live and the proxy didn't support the HTTP PUT verb (maybe a config issue - but we didn't have access to the proxy to fix it) so we had to tweak the API and change it to POST at the last minute (which also meant we had to change the clients (mobile apps) that were using it).

Post to another site with Java EE

We are implementing support for punchout/oci which follows this basic flow:
Our procurment system opens a new tab/window to an external webshop and in our request we append a parameter called HOOK_URL. When the user finishes the external site will redirect to the hook_url and perform a post. example here:
http://help.sap.com/saphelp_crm20c/helpdata/en/30/67483936dd7607e10000000a11402f/content.htm
That system is a black box for us and we are basically just supposed to retrieve the post then process the form data into whatever information we need and send it on its way through our business logic.
So I need to build a simple Test application that can play the role of an external webshop and I need our system to send and receive.
We are using servlet 2.5, JSF 2.0, and CDI. But I'm guessing that I'll be needing a good old servlet or two for this purpose.
So far what I've got is:
procurment system perform window.open and send to test system
Test system presents a very basic html page and posts to a simple servlet that redirects to hook_url
procurment system get's the response
But what I can't figure out how to do nicely is to actually perform the post? When I recieve the response from the test system it's a totally new request. And must I use servlets?
I have tried to follow some guides but the examples map to poorly. It must be a Post by specification.
cheers
Solved by using apache http and url connections

HTTP PUT and POST alternatives for uploading content

Other than HTTP PUT and POST, what other methods can a web application designer use to allow users to upload content (either files or listbox text) from a page of his web app to a remote server?
On the same topic, I was wondering what technology/APIs does a service like Google Docs or Google Drive use? The reason I ask this is: Our Sys Admin has disabled file uploading (via Squid proxy), yet I was able to create and share a document using Google Docs / Google Drive.
Many thanks in advance,
/HS
EDIT Please see the strikeout above.
This depends on the server in question - as the standard set of HTTP commands can be expanded, and some may not be configured/allowed. One of the common commands is "OPTIONS" that ask "what can I do".
But to answer more helpfully: you generally have two main options:
POST (the one you probably want to user as it's nearly always avaiable
GET. You could use GET (but I'm NOT advocating it - just saying you could you it - you should not use a GET to make changes to the server). There are problems with this approach (including size of files, manually handling the encoding etc) but it's possible if you have to go this route.
PUT it often not enabled on servers for security reasons.
More reading: http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html
Edit: if "file uploading" is prevented by proxy, have you tried encoding the POST? i.e. As opposed to sending a multipart POST, try encoding the files yourself into POST string and sending that instead? Or encode the file and split into multiple small posts and piecing them together at the other end?
Google Docs uses a mixture of POST and GET. POST for the updates. Google Drive I don't know.

Running SOAP and RESTful on the same URL

Say we have a website that responds to a host header "kebab-shop.intra.net"
Is is possible to have both SOAP and RESTful in this URL?
That is, both of these are handled within the deployed code.
kebab-shop.intra.net/takeaway.asmx
kebab-shop.intra.net/kebab/get/...
I've been told this can't be done, without much explanation. Like this answer. This could be, I'm a database monkey, but I'd like some thoughts on what options I do or don't have please.
Thoughts so far
Separate host headers eg add kebab-shop-rest.intra.net
Separate web sites
Ideally, I'd like to have one web site, one URL domain name, one host header. Zero chance?
This is IIS 6 with .net 4. And we have some large corporate limitations that mean we are limited to a zip file to drop into the relevant folder used by the web site. This is intended to allow our clients to migrate without incurring the large corporate support, infrastructure and deployment overhead. The co-existence will only be for a month or three.
Edit: I'm asking because I'm not web developer. If my terms are wrong, this is why...
So... I want both SOAP and REST on kebab-shop.intra.net on IIS 6 without complexity.
That is, both of these are handled
within the deployed code.
* kebab-shop.intra.net/takeaway.asmx
* kebab-shop.intra.net/kebab/get/...
Yes, that should definitely be possible. If you have a single WCF service, you could easily expose two separate endpoints for the same service - one using e.g. basicHttpBinding (roughly equivalent to ASMX), and another with webHttpBinding (REST).
The complete URL's must be different - but the first part can be the same, I believe.
If you're hosting in IIS6, you need one virtual directory and that will partly dictate your SOAP endpoint - it will have to be something like:
http://kebab-shop.intra.net/YourVirtDir/takeaway.svc
(or: http://kebab-shop.intra.net/YourVirtDir/takeaway.asmx if you insist on using an ASP.NET legacy webservice).
and the REST endpoint can live inside the same virtual directory and define URI templates, e.g. you could have something like:
http://kebab-shop.intra.net/YourVirtDir/TakeKebab/gbn
or similar URL's.
However: checking this out myself I found that you cannot have both service endpoints "live" off the same base address - one of them has to have another "relative address" associated with it.
So either you add e.g. "SOAP" to your SOAP endpoint
http://kebab-shop.intra.net/YourVirtDir/takeaway.svc/SOAP/GetKebab
http://kebab-shop.intra.net/YourVirtDir/TakeKebab/gbn
or you add something to your REST service
http://kebab-shop.intra.net/YourVirtDir/takeaway.svc/GetKebab
http://kebab-shop.intra.net/YourVirtDir/REST/TakeKebab/gbn
I don't see a reason why you can't. Typìcally your SOAP endpoints will be one specific URLs per service, whereas for resources exposed via REST you will have one URL per resource (following 'URL patterns').
Example URLs for SOAP:
http://kebab-shop.intra.net/soap/service1
http://kebab-shop.intra.net/soap/service2
Example URL patterns for REST:
http://kebab-shop.intra.net/rest/{resourcetype}/{id}/
e.g.: http://kebab-shop.intra.net/rest/monkeys/32/
etc...

Resources