Getting Xml problem from TCP/IP connection - iphone

I am working on an application where i have to get some feeds from the server. now when i start the application, i send a request for login and get schedule, in response it gives me a string "VALID" and then it gives me some xml for schedule. Now most of times it gives me the string in more then one response and also mix two xmls.
Infect it gives me some lines of an xml "CHANGES" and then start giving my required xml "SCHEDULE" and at the end it completes the "CHANGES" xml. I don't need "CHANGES" xml.
its look is like
<Changes>
<Schedule>
</Schedule>
</Changes>
So what should I do to get just "Schedule" xml?

I think you are trying to read contents of Schedule tag ().
To read that You can NSXMLParser.
see this tutorial
and chk NSXMLParserDelegate methods

I solved this problem by get all that responses on server side and then I bind them and then hosted them on a server and fetch that xmls with the help of a url

Related

How to convert soap message in Oracle OSB

I'm just starting with Oracle Service Bus 12C.
I created a proxy service that takes in a couple of parameters. A pipeline that moves those parameters to the request-headers. A business service that calls my PHP. So far, the PHP receives the parameters correctly.
Next, I am returning a response from PHP. As a first step, I did a simple echo "Hello, World";
Two things are happening at this point.
Firstly, when debugging the app, JDeveloper shows that $body in Response Action is blank. However, in a log action, I added $body. That shows:
<soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">Hello, World</soapenv:Body>
No idea why JDeveloper doesn't want to show this.
So, how do I get the string part from this so I can use a Insert Action to build the XML response that the proxy service would understand?
I tried these in the log action, but all of them give blank outputs:
$body/*
$body/soap-env:body
$body/soap-env:Body
$body/soap-env:Body/#value
$body/soap-env:body/#value
Edit: According to https://docs.oracle.com/cd/E13171_01/alsb/docs25/consolehelp/context.html $body/* should extract the payload without the soap-env:Body wrapper.
Got it:
$body/text()
I noticed that the tag is soap-env in the request and soapenv in the response. The $body/* works for the request to remove the wrapper in the request only.

Node-Red HTTP Input verify json

this might be a stupid question but I was unable to find a solution, also no luck with search.
My Node-Red flow gets triggered by a HTTP Input because I want to create a REST Webservice. It works fine so far but I wonder how to verify the content someone send to me.
As I see right now, I can pass any kind of content. There is no verification if the content matches to the content I want as input.
If I set content-type to application/json, it only accepts json data. That's great but I also want to ensure, users can post only a specific json string.
If someone sends data I'm unable to proceed (not the json object I expected), I want to send HTTP 400 as response.
I'm pretty new to Node-Red and also to json. I'm more an old-school programmer using classic webservices and soap. What I'm missing is some kind of WSDL (not sure if it exists when using REST) and some kind of payload validation.
It would be great if someone can point me the way to go.
Best regards
Patrick
There are some nodes available for doing schema validation on JSON objects.
For example, node-red-contrib-json-schema-validator - which uses ajv as the validation engine under the covers. Unfortunately this node doesn't come with much in the way of help. Essentially it lets you provide your schema and if a message fails to validate, it logs an error which can be handled with a Catch node if you want.
I found the issue. It was too bad.
I just forgotten to set HTTP Header content-type to application/json.
node-red-contrib-json-schema-validator works like a charm if content type is set corret

http POST vs GET request for getting a document sending a XML file

I know for getting a data we have to use a GET request. But this time I have to send a XML document (who will not be stored) for getting the data. What are the best practice in this case ?
You need send a xml document to your end-point to get your interested data.
As you need a xml doc, it has to be a POST REST end-point. (On a side note, sending any file contents as part of GET parameters is a bad design practice.)

Sending a URL/filePath in Resteasy request

I want to send path of a file alongwith some Strings.
After spending some time I was unable to find anything that can help. Could anyone suggest any link on how to do this on server side
You can use any of the following methods to submit a file path and some strings to the server:
Submit a Form with the file path and strings.
Encode the file path and send it as a query parameter in the URL along with the strings.
Create a message body containing the file path and other strings you want to send and submit it via a POST call.
Send the file path and strings in custom http headers.
Take a look at the Resteasy documentation here: http://docs.jboss.org/resteasy/docs/3.0.4.Final/userguide/html_single/
Pay special attention to the sections that talk about using the #Form, #FormParam, #QueryParam, and #POST annotations.

Json Parsing Problem with Dotnet webserivces

I am posting some values to dotnet webservice.For this i am using AsiFormDataRequest.Values are posted suceesfully but coming response is in xml format. so iam not able to get the success or failure message in json format.
What i want to do for getting json response after posting to server.
Thanking in advance.
You need to configure the server to respond with JSON instead of XML. There is nothing you can do about this from within your app. If you don't have control over the server then you need to forget JSON and parse the XML instead.