Monday, June 12, 2017

get details information about SAP sales orders

1) T-code ST04
2) left side SQL Command Editor
    select * from vbap where VBELN='0004714464' order by POSNR;
use export button in result table to export resultset

Monday, June 5, 2017

‘q’ Parameter in HTTP ‘Accept’ Header

‘q’ Parameter in HTTP ‘Accept’ Header

A REST API can return the resource representation in many formats – to be more specific MIME-types. A client application or browser can request for any supported MIME type in HTTP Accept header. Technically, Acceptheader can have multiple values in form of comma separated values.
For example, an Accept header requesting for text/html or application/xml formats can be set as:
Accept : text/html,application/xml

The ‘q’ Parameter

Sometimes client may want to set their preferences when requesting multiple MIME types. To set this preference,q parameter (relative quality factor) is used.
Value of q parameter can be from 0 to 1. 0 is lowest value (i.e. least preferred) and 1 is highest (i.e. most preferred).
A sample usage can be:
Accept : text/html, application/xml;q=0.9, */*;q=0.8
In above example, client is indicating the server that it will prefer to have the response in text/html format, first. It server does not support text/html format for requested resource than it shall send application/xml format. If none of both formats are available, then send the response in whatever format it support (*/*).
  • One of the benefit of ‘q’ parameter is to minimize the client-server interactions, which could have happened due to failed content negotiations.
  • It also allow clients to receive content types of which they may not be aware, an asterisk “*” may be used in place of either the second half of MIME type value, or both halves.
Here’s how the HTTP spec defines it:
Each media-range MAY be followed by one or more accept-params, beginning with the “q” parameter for indicating a relative quality factor. The first “q” parameter (if any) separates the media-range parameter(s) from the accept-params. Quality factors allow the user or user agent to indicate the relative degree of preference for that media-range, using the qvalue scale from 0 to 1. Default value is 1.
If there are two MIME types for given same q value, then more specific type, between both, wins.
For example if both application/xml and */* had a preference of 0.9 then application/xml will be served by the server.
If no Accept header field is present, then it is assumed that the client accepts all media types. If anAccept header field is present, and if the server cannot send a response which is acceptable according to the combined Accept field value, then the server SHOULD send a 406 (not acceptable) response.

Wednesday, May 31, 2017

see outlook email details include internet headers

1) double click the email in outlook
2) click file menu in top
3) make sure info is selected in left menu list
4) click the Properties button in right side
5)  open up the properties window include all information we need to check

Thursday, May 18, 2017

simulate http post with difference tools

1)curl
1       curl -A "Mozilla/5.0" -verbose -X POST http://xxx.yyy.com/Sale/BillOfSaleExport --ntlm --negotiate -u domain\\Test.msmanager1:Password -d@data1.txt --trace log1.log
2   2)wget
w   wget -d -S --post-file=data_sale_bill1.txt --http-user=domain\\Test.msmanager1 --http-password=Password http://xxx.yyy.com/Sale/BillOfSaleExport
3     3)FireFox with Firebug
c    change the request header and body make sure they are match the log from curl/wget,we will get same binary data as curl and wget, since NTLM/kerberos need noegiate, so user will get two time 401 http code, finally get 200 code and data back.



p

44) SOAPUI
55) other browser like chrome/IE



3

3

Monday, May 15, 2017

oracle db table lock

in oracle db, some time we need lock a table for long time db update, here is the command
lock table table_name in exclusive mode;

after update, we need commit or rollbak to release the lock

other application can use following code to check the lock

SELECT
    B.Owner,
    B.Object_Name,
    A.*
FROM
    V$Locked_Object A,
    All_Objects B
WHERE
    A.Object_ID = B.Object_ID and A.OBJECT_ID=1211103;

object_id is the table's object_id in table all_objects

create a short name for long name executable file in windows 7 64bit

when create a  link for executable file in 64bits windows, we should use hard link
ln -P "notepad++.exe" npp.exe

sybbolic linked will result a error says unsupported 16 bits application

Thursday, May 11, 2017

Format xml output from curl

curl -s http://localhost:8983/solr/gettingstarted/select?q=video |tidy -xml -i -