How to convert soap message in Oracle OSB - soap

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.

Related

REST Client extension - API response as HTML

I wanted to use vs code's extension REST client for testing purposes. So I used a curl of an existing API running on my local machine. But instead of JSON, I got HTML as a response. The curl works as expected in the terminal but not with the extension.
The same Behaviour is with another extension named Thunder Client.
Postman is getting JSON responses for the same API I believe that issue lies within vs code itself, I just don't know how to resolve it.
According to this article:
https://softwareengineering.stackexchange.com/questions/207835/is-it-ok-to-return-html-from-a-json-api
If you have declared you only accept one format in the header then the service should only send back that format or throw an error. If you have not put an ACCEPT in the header, the the service may send back whatever.
Check what is in the ACCEPT header:
But also check how Thunder Client translates the call in powershell:
I see that in my call the response is translated to JSON. I would guess that most REST clients are assuming that users want to work in JSON. Maybe that's what your two REST clients are doing?

OTRS WebService SOAP TicketCreate not returning

I'm fairly new to OTRS and perl and i'm working with it for about 2 weeks.
I have been creating and modifying webservice operations in perl and testing them with SoapUI. The version of OTRS being used is 3.3.
Right now i'm facing a problem which i can't understand. When i make a SOAP request to call TicketCreate operation i don't always get a response on SoapUI. I found out that this issue seems to be connected with the values that are passed on the soap request.
If i use a certain QueueID, ServiceID and SLAID i get a response that tells me the ticket id, ticket number and article id from the created ticket. If use other QueueID, ServiceID and SLAID i get nothing, not even an error.
I have been putting outputs through TicketCreate.pm to see if the execution stalls and where. But the only thing i got to see is that everything runs and that until the last return on the code that everything is fine.

use pingdom to monitor soap service

I'm sending a SOAP request to my server via Pingdom -- just put the XML content in the POST data field.
When clicking "Test Check", the button greys out for a few seconds and then comes back.
I've tried with SoapUI and Postman respectively, it works there -- is this possible with Pingdom at all?
OK, found the answer myself -- Pingdom can do this without a problem, I only needed to remove line breaks from the SOAP message.

RESTful post in Oracle Service Bus

Does anyone know how to create a proxy service that will handle this sort of thing?
What I'm looking for is a path parameter and a post body being formatted similar to this:
POST www.myurl.com/{123}
Post body:
myId=1&myOtherId=2
I am currently passing in an XML document and I'm doing an insert on the http:relative-URI element in the transport. This seems to work.
I am also currently doing an insert on the http:query-parameters for my post body name/value pairs.
I am inserting these on the outbound variable. When I debug, both are showing up and I'm contacting the REST service. I am getting a 400 -- Bad Request error. This happens when the post body is not configured correctly.
Any ideas how to do this?
If you are just Posting an XML, then while creating Proxy Service, Select Service Type as Any XML.

Getting Xml problem from TCP/IP connection

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