Parse a SOAP request and modify data - java

I am developing an application to send a text message/sms to a user base and receive their responses. I have been given a wsdl which I have used to consume the service to sendsms using netbeans IDE .So far so good.
Now the problem is when I receive a text message a soap request is posted over to a location on our server. The request-response is as follows:
<a>http://www.csoft.co.uk/sms/api/sms_to_soap.htm</a>
I have checked the provider's sample API section but they do not have any material that does something similar.
My question is how do I parse the soap request and send the corresponding response? Also I have to check the messages and filter them for offensive/obscene content. I have the wsdl, xsd, java classes generated by netbeans, but I cant get around how to use them to achieve the goal. Any help or a pointer in the right direction would be greatly appreciated.
Thanks
Kalyan

Please search Stackoverflow and Google, there is plenty of howto around.
Even in this question, just check on the right at "related".

Related

Java library for async 'multipart-form' file upload?

I am trying to upload a file (and additional fields) using single REST POST request. This request has to be processed asynchronous and form has to be submitted using multipart-form content type (because beside file I am sending few other text fields with certain metadata).
I tried with Apache's org.apache.http.impl.nio.client.CloseableHttpAsyncClient but until now I didn't succeed (when request arrives on the server, fields from the form are not presented). When I do the same using org.apache.commons.httpclient.HttpClient request is processed without problems, so the issue is not on the server side.
Does anybody know how this async 'multipart-form' request could be made? If not possible with CloseableHttpAsyncClient, do you have some other library to suggest?
Thanks in advance...
I just want to give an update. I did some investigation and was able to fulfill my requirements with AsyncHttpClient (AHC)
It works very fast and is based on Netty Framework and NIO Java API.

What must I do to receive JSON data from a server on an android app

I have PHP script on the server side which executes the SQL query and produces a JSON string from it. But how do I get that code to execute to then retrieve and decode the JSON on the Android app?
I am quite new to android so as much help would be very appreciated.
I can't write you the whole tutorial but i can give you a to-do list which you can check your progress.
Your application to generate JSON script in txt, or real time response.
Setup your backend server(you have sql server already and also PHP, so i guess you have set it up already, probably WAMP or similar), which is the endpoint/url path to generate the response required, in this case your JSON response.
Check the API is working or not by using "advanced rest client" or simple type your endpoint in browser, if you can get the correct response from it, the API is working as expected.
Created your android app, with simple HTTP request/response, send a HTTP request to the url/path you setup, see if you can get the JSON response or not.
Please comment here if you need further details, this is relatively easy and should be able to finished in 1 day for beginner.

How to do server-side responses for multiple HTTP ranges in one response?

I'm trying to find a good example of how HTTP ranges should be handled on the server side. I would like to be able to support multiple ranges. Could somebody please show me an example, or provide some useful links? I've read the RFC, but I'm still a bit confused regarding the multipart stuff.

Give port number and passed parameters in WSO2

I am trying to learn WSO2 but have been stuck at a minor step which i believe should be quite easy to do. While creating a new api i need to give the production endpoint. What i want to give is the url along with the port as well. So it should be something like this:
Production Endpoint : http://localhost:9000
However this gives a invalid url. How can i specify port along with it. Please help. I have tried to go through the docs but could not find anything. I am doing these through the admin UI available at http://myip:9443/publisher.
Please advice
Edit: Adding image for clarity
The Test button will send HTTP OPTION request to the endpoint, and if the endpoint supports HTTP OPTION request, then it will be shown as Valid, otherwise, it will be shown as Invalid
As far as your backend point support the HTTP method you need, you don't need to worry about this Test button against the endpoint.

client server communication solution

I'd like to ask if my solution is OK or if there is a better way to do this.
I have an Android client and a Tomcat server. I send a few words (as a POST saved in JSON) to server and server sends me back a JSON with an article containing those words.
Suppose it's a public app, so a lot of people may send a 'request' for an article.
I'm not sure if I'm doing this right, or if there's another and proper way to do this.
Thanks
Since you android client appears to be "Getting" an article you might consider using a GET request as opposed to a POST request, however the differences are trivial. Otherwise your solution sounds perfectly fine. Look into "REST" and "SOAP" as different options for writing web service APIs.

Categories