Hi are there any frameworks or libraries in php equivalent to jpos?
I came across JAK8583 php library which can parse and generate ISO 8583 messages.
However I want a php library which can generate ISO 8583 response message for ISO 8583 request message .
Please let me know if there are any.
Hi I don't know any alternative but you can always parse the request and set the response fields on that parsed request.
You can see implementation of ISOMsg.setRespnseMTI as inspiration.
Regards
You can check out this php library for iso8583.
Please note that in general you cannot throw a request at a library and tell it to give you a response that will be useful. You need to populate the response with data that is relevant to the transaction.
So normally you would get the request, create a response from the request, populate the response with relevant data, then send it.
Related
I'm start learning java programming, and I want make a simple server application. I read about com.sun.net.httpserver.HttpServer and find a good example on this link: https://github.com/imetaxas/score-board-httpserver-corejava.
I understand how to do Get-request in url, but I don't know how POST works. I think it must be sent a form or data on the server.
I attach the link of project, which I'm learning, in readme the author wrote http://localhost:8081/2/score?sessionkey=UICSNDK - it's not working...
I wrote in url and get sessionkey: "localhost:8081/4711/login --> UICSNDK"
I wrote in url this for Post request: "localhost:8081/2/score?sessionkey=UICSNDK" - not working and in chrome return 404 bad request
3.wrote in url this:"localhost:8081/2/highscorelist"
Please help me, I am beginner.
The difference between GET and POST is that with a GET request the data you wish to pass to the endpoint is done by modifying the url itself by adding parameters to it.
With a POST any data you wish to send to the endpoint must be in the body of the request.
The body of a request is arbitrary data that comes after a blank line in the header The reqiest has the request line, following by any number of header attributes, then a blank line.
The server would need to know what the format of the body of the request was and parse it as appropriate.
Of course 'modern' frameworks like jax-rs allow you to automatically convert request data to objects, so that it is much simpler.
I am a beginner in programming so please bear with my lack of knowledge.
I am working on sending and receiving a soap request via HttpsURLConnection. The problem is, the reply from the input stream has namespace declarations and the application does not recognize these.
I take the result from the input stream as text:
def reply = bufferedReader.getText()
but I can also create a Soap Message:
reply = MessageFactory.newInstance(SOAPConstants.SOAP_1_1_PROTOCOL).createMessage(null, conn.getInputStream())
Both methods still give namespace prefix. But I'm not sure if I've missed something. I can manipulate both XML and SoapMessage so any pointers will help.
When I send a request using SoapConnection.connect(), the XML file doesn't contain the prefix. However, when I use HttpsURLConnection, I get these. I cannot use SoapConnection.connect() for other reasons though.
I have been struggling for many hours. Any help is appreciated. Please ask if you need more info.
Thanks,
My main question is how can I pass JSON as well as File to post request to REST API? What needs in Spring framework to work as client and wait for response by passing post with JSON and File?
Options:
Do I need to use FileRepresentation with ClientResource? But how can I pass file as well as JSON?
By using RestTemplate for passing both JSON as well as File? How it can be used for posting JSON as well as File?
Any other option is available?
Sounds like an awful resource you're trying to expose. My suggestion is to separate them into 2 different requests. Maybe the JSON has the URI for the file to then be requested…
From a REST(ish) perspective, it sounds like the resource you are passing is a multipart/mixed content-type. One subtype will be application/json, and one will be whatever type the file is. Either or both could be base64 encoded.
You may need to write specific providers to serialize/deserialize this data. Depending on the particular REST framework, this article may help.
An alternative is to create a single class that encapsulates both the json and the file data. Then, write a provider specific to that class. You could optionally create a new content-type for it, such as "application/x-combo-file-json".
You basically have three choices:
Base64 encode the file, at the expense of increasing the data size
by around 33%.
Send the file first in a multipart/form-data POST,
and return an ID to the client. The client then sends the metadata
with the ID, and the server re-associates the file and the metadata.
Send the metadata first, and return an ID to the client. The client
then sends the file with the ID, and the server re-associates the
file and the metadata.
I am trying to connect to a website. After While authentication is successful, I get the following response:
{"code": "OK",
"data": {"session_id": "apimanager#taurusseo.com:EdiPNoBS2iYxOsAF9e2ceMbk"},
"user": "apimanager#taurusseo.com"}
What is the quick and easy way to parse through the (pure text) response given above?
Also, if the response is a JSON object, then how do I parse through the response, preferably using GSON library? I just want to use a library that is supported by Google App Engine for Java and GSON is one of those.
Finally, if a response analogous to the above is an XML response, then do I have to model a struct that resembles the response above? Again, is there a quick and easy way to get the response and parse through it, preferably using XML RPC Client? Again, I just want to use a library that is supported by Google App Engine for Java. XML RPC client is just a suggestion, if you can suggest something better then kindly do so.
I am confused as to why you would get back different data types of responses for the same request. However, you should be able to inspect the Content-Type header of the response, to determine if you should parse it as JSON or XML. As you already mentioned, you could use a library such as Gson to handle the response as JSON, or one of the build-in XML APIs (e.g. JAXP) to handle the response as XML.
I get the JSON of User Info from Facebook on Android.
And then send the JSON to my servlet (the platform is GAE).
My question is how to send it properly.
Since the JSON could be very long.
So far, I have tried this way.
But I cannot receive the entire JSON.
It always throws
Unterminated string at character 117 of
{"music":{"data":[{"created_time":"2011-05-23T16:47:21
0000","id":"176345129540","category":"Musician/band","name":"
And I print the JSON, I find that the JSON is just as above which is been cut.
Thanks in advance.
There might be a limit on the size of data you can send by Http GET, take a look at this question and rewrite your request to use Http POST.