OSB: Send XML as response
Hi,
I have created a proxy service which will publish messages into the Queue. Once i publish the message in the response pipeline i need to send response as an xml as shown below:
For Success:
<?xml version="1.0" encoding="UTF-8"?>
<response>
</response>
For Failure:
<?xml version="1.0" encoding="UTF-8"?>
<response>
<exception> Error reason 1 </exception>
<exception> Error reason 2 </exception>
</response>
How to do this? Kindly advise.
Thanks in advance.
For success scenario in response pipeline use replace action and modify the contents of the $body with the success response.
For the fault scenarion you will need to have a fault handler in the fault handler use repalce to modify the contents of $body and then use reply node and choose reply with success.
Similar Messages
-
How to send XML packet from external socket server to OSB
Hi folks,
How do I use external Socket Server(tcp) to send payload to OSB ?
I have configured the socket protocol in my OSB. I am also able to send and receive responses by testing my proxy services from OSB itself.
But now, we want to use some external socket (tcp)server to be able to fire some xml file and then receive response on OSB.
Please help
salilYou need to use a socket client application to send a message to a socket where your proxy is listening. For receiving a message at a socket, configure business service at OSB.
Regards,
Anuj -
OSB-Catching error and sending it as response
hi,
in OSB, the system throws eror on any exception. but i want it to be catched and sent as a response to the customer. how is it possible?Hi,
I have a doubt in sending the error response to the client.
In proxy service error handler, I have used the reply activity to give the response.
On executing the proxy I could see the below in the test console.
Request Document_
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
</soap:Header>
<soapenv:Body>
<res:request xmlns:res="http://whitehorses.nl/request">
<res:id>123</res:id>
<!--Optional:-->
<res:location>chennai</res:location>
</res:request>
</soapenv:Body>
</soapenv:Envelope>
Response Document_
The invocation resulted in an error: .
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header/>
<soapenv:Body/>
</soapenv:Envelope>
Response Metadata *
<con:metadata xmlns:con="http://www.bea.com/wli/sb/test/config">
<tran:headers xsi:type="http:HttpResponseHeaders" xmlns:http="http://www.bea.com/wli/sb/transports/http" xmlns:tran="http://www.bea.com/wli/sb/transports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<http:Content-Type>text/xml; charset=utf-8</http:Content-Type>
</tran:headers>
<tran:response-code xmlns:tran="http://www.bea.com/wli/sb/transports">1</tran:response-code>
<tran:encoding xmlns:tran="http://www.bea.com/wli/sb/transports">utf-8</tran:encoding>
</con:metadata>
Invocation Trace_
(receiving request)
RouteNode1
Service Error Handler
*$fault:*
<con:fault xmlns:con="http://www.bea.com/wli/sb/context">
<con:errorCode>BEA-380000</con:errorCode>
<con:reason>Service Unavailable</con:reason>
<con:location>
<con:node>RouteNode1</con:node>
<con:path>response-pipeline</con:path>
</con:location>
</con:fault>
In response document it just shows “the invocation resulted in error” without any error details.
What I want is, I want the $fault variable which is displayed in the “service error handler” in invocation trace to be displayed as response in the response document to the client.
If you have any idea on this, help me out. -
Send XML Message via HTTP and Receive Response
Hello,
We have a scenario where we need to update Currency Exchange Rates in R/3 via a 3rd party called Oanda. I'd like to use XI for this Interface, if possible.
Basically, we need to send XML over HTTP. Here's the URL and the XML we need to use for our POST (I'll need to perform the look-up for about 15 currency codes - I plan on using a BPM process to loop through each currency code specified in a flat file):
http://www.oanda.com/cgi-bin/fxml/fxml?fxmlrequest=<CONVERT><CLIENT_ID>TestAccount1</CLIENT_ID><EXCH>USD</EXCH><EXPR>CAD</EXPR><DATE>03/25/2008</DATE></CONVERT>
And the reponse looks like this:
<RESPONSE>
<EXPR>CAD</EXPR>
<EXCH>USD</EXCH>
<AMOUNT>1</AMOUNT>
<NPRICES>1</NPRICES>
<CONVERSION>
<DATE>Mon, 24 Mar 2008 20:00:00 GMT</DATE>
<ASK>1.0257</ASK>
<BID>1.0251</BID>
</CONVERSION>
</RESPONSE>
I plan on mapping each reponse to BAPI_EXCHRATE_CREATEMULTIPLE, using BPM.
So my question is this: Should I use the HTTP adapter for the out going POST to Oanda? If so, would the HTTP adapter be consider the sender or the receiver? Also, how would the XML message be automatically appended to the end of the URL (i.e., after the fxmlrequest parameter)? I guess I'm a little confused on how to use the HTTP adapter... Are there any blogs that discuss this type of scenario?
Thanks,
MattHi guys,
I have few concerns for setting up this scenario.
1). I have created a data type for request mapping, and teste the mapping.
The output looks like below:
<?xml version="1.0" encoding="UTF-8" ?>
<ns1:MT_CONVERT xmlns:ns1="http://test.com/ExchngRate">
<CONVERT>
<CLIENT_ID>test</CLIENT_ID>
<EXPR>CAD</EXPR>
<EXCH>USD</EXCH>
<DATE>10/21/2009</DATE>
<AMOUNT>1</AMOUNT>
</CONVERT>
</ns1:MT_CONVERT>
How to pass only
<CONVERT>
<CLIENT_ID>test</CLIENT_ID>
<EXPR>CAD</EXPR>
<EXCH>USD</EXCH>
<DATE>10/21/2009</DATE>
<AMOUNT>1</AMOUNT>
</CONVERT>
to the receiver HTTP adapter.
2) I am using URL address in the receiver HTTP adapter.
Target Host: www.oanda.com
Path Prefix: cgi-bin/fxml/fxml?fxmlrequest=
What is will be Service Number?
Looking forward for you help. Your help is greatly appreciated.
Thanks,
Namadev
Edited by: Namadev Chillal on Oct 21, 2009 5:35 PM -
How to send XML using UTL_HTTP
I am trying to workout how to send XML data to a webserver using UTL_HTTP but am not getting any reply
I need to submit the following XML document to a server "http://api.fastsms.co.uk/api/xmlapi.php" Their instructions are "The XML Document should be posted unencoded, with a UTF-8 character set as parameter 'xml'"
If I submit the following XML on their test form
<?xml version="1.0"?>
<apirequest version="1">
<user>
<username>**USER**</username>
<password>**PASSWORD**</password>
</user>
<application>
<name>Example Application</name>
<version>1.0</version>
</application>
<inboundcheck lastid="10711399"/>
</apirequest>
I get an XML response back with the messages in my inbox.
This is the code I am trying to use to accomplish the same from PL/SQL : I know a response is coming back as there is header information - just no content. What am I doing wrong ?
l_xml VARCHAR2(5000);
req utl_http.req;
resp utl_http.resp;
header_name VARCHAR2(256); -- Response header name
header_value VARCHAR2(1024); -- Response header value
response_text VARCHAR2(4000); -- Response body
l_url VARCHAR2(100);
BEGIN
l_xml := 'xml=<?xml version="1.0"?>';
l_xml := '<apirequest version="1">';
l_xml := '<user>';
l_xml := '<username>**USER**</username>';
l_xml := '<password>**PASSWORD**</password>';
l_xml := '</user>';
l_xml := '<application>';
l_xml := '<name>Example Application</name>';
l_xml := '<version>1.0</version>';
l_xml := '</application>';
l_xml := '<inboundcheck lastid="10711399"/>';
l_xml := '</apirequest>';
-- Open HTTP connection
l_url := 'http://api.fastsms.co.uk/api/xmlapi.php';
req := utl_http.begin_request(l_url,'POST',utl_http.HTTP_VERSION_1_1);
-- Set headers for type and length
utl_http.set_header(req,'Content-Type','application/x-www-form-urlencoded');
utl_http.set_header(req,'Content-Length',to_char(length(l_xml)));
-- Write parameter
utl_http.write_text(req,l_xml);
-- Read response file
resp := utl_http.get_response(req);
-- Print out the response headers
FOR i IN 1 .. utl_http.get_header_count(resp) LOOP
utl_http.get_header(resp,i,header_name,header_value);
logging_pkg.info(header_name || ': ' || header_value);
END LOOP;
-- Print out the response body
BEGIN
LOOP
utl_http.read_text(resp,response_text);
logging_pkg.info(response_text);
END LOOP;
EXCEPTION
WHEN utl_http.end_of_body THEN
logging_pkg.info('End of body');
END;
-- close http connection
utl_http.end_response(resp);
EXCEPTION
WHEN utl_http.end_of_body THEN
utl_http.end_response(resp);
END;
Cheers,
BrentHi Billy
Yikes - how embarassing ! Thanks for pointing out my beginners mistake there. I've fixed my code - and also implemented the substitutions of parameters like you suggested - I like that approach.
Unfortunately the end result is no better - the line
utl_http.read_text(resp,response_text);
Still returns nothing back
The headers that are coming back are
Date: Thu, 04 Jul 2013 08:31:56 GMT
Server: Apache/2.2.16 (Ubuntu)
X-Powered-By: PHP/5.3.3-1ubuntu9.3
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Vary: Accept-Encoding
Content-Length: 0
Content-Type: text/html; charset=UTF-8
Connection: close
I guess I will need to try chasing it with the fastsms vendor so see if they can check my incoming request and see if there are any glaring problems. I know the xml is correct as I am now logging the xml string just before I send it and when I take that string and put it in their test form it works perfectly - something else in the puzzle is missing. I've had no experience using utl_http before - perhaps it's no possible to read the xml repsonse using this ?
Anyway, thanks for your help Billy.
ps - How do you paste your code into your message to get that formatting ?
Cheers,
Brent -
Struggling with Send XML to client
Hi,
I am using WL Process Integrator 2.1 with WL 6.1.
I am trying to do do an example of the "Client Call Addin Response DTD" i.e. pass
an XML document to an external java
program.
As given in docs :
http://e-docs.bea.com/wli/docs70/devclient/appa.htm#1120726
1. I have created a template definition
2. Defined a XML doc. (as per the Client Callin Request DTD) and attached to ActionSendXMLToClient
event as shown below.
<call-addin name="mywlpi.addinimpl" mode="async">
<actionid>959395846210</actionid>
<parm>itemNumber</parm>
</call-addin>
3. "mywlpi.addinimpl" is a java program I created
4. Now, the problem I run into is when I run from Worklist (Swing client program),
it errors out saying it cannot find this
class file:
ClassNotFoundException: mywlpi.AddInImpl
java.lang.ClassNotFoundException: mywlpi.AddInImpl
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
5. I have included the class file in a .jar and included in the
SVRCP of startWebLogic.cmd file. Also, when I create a Business
Operation from Studio, I can locate this Java class. So, I am
not sure what is missing. The strange part is when I run from the
Worklist JSP page, it errors out saying :
"Cannot execute this task, because it is already done." The task
is not yet done.
Is there someone who can help me here? Any suggestions
appreciated!!
Thanks,
SLNHi Sudhar.
I don't think your workflow will execute the next node before you mark the current
node as done. Conseqently setting the done in the decision box isn't possible.
Giora
"Sudhar" <[email protected]> wrote:
>
After I do the Send XML to Client from the exeucte tab of an action...instead
of
marking the task as done on the call back actions...i try to mark the
same task
as done in the next task after a decision box....it doesnt seem to work?
any ideas? should you always mark a task as done on the same task? -
How to send XML file to https server using POST
Hi, I am having an requirement, that I have to connect to https server and I have to pass an input XML file as a response server will give me output XML file.
The certificate validation part is over, I am using FileInputStream to read the XML file and attaching this to connection.getOutputStream(); but server is throwing me DTD does n't match.
Can any body tell me how to send XML file, I have to use any DOM parser to send the XML file, suggest me and give me sample code.
Thanks,Can anybody give me the solution
-
I am beginning and I need to send XML formatted data from Swing Client to Server for parsing/processing/and response.
There are no web server available to use. I think its best to use socket connection, but how do I send xml data over socket, and how do I receive it from server and parse it?
I have read and cannot find a similar example.Xerces has DOMSerializer which can be used to serialize a Document object to a string. Once it's a string it's trivial to transmit over a socket connection. On the other side, to parse it, you'll have to create a StringReader for the received string and then an InputSource from the StringReader. You'll then be able to pass the InputSource to the DocumentBuilder.parse( ) method to generate a Document on the receiving side.
Hope that helps,
- Jesse -
Send xml file from sap to third party url through https
Hi,
I have a requirement to send the xml file from ecc to a 3rd party url through HTTPS. How can we achieve this using ABAP.
Client doesn't have XI enviroment. The client has provided the 3rd party url where the file needs to be uploaded.
Please help ! <removed by moderator>
Thanks in advance.
Regards,
Chitra.K
Edited by: Thomas Zloch on Sep 12, 2011 12:58 PMHi Chitra,
I had similar requirement and here is what I did: -
REPORT Z_HTTP_POST_TEST_AMEY.
DATA: L_URL TYPE STRING ,
L_PARAMS_STRING TYPE STRING ,
L_HTTP_CLIENT TYPE REF TO IF_HTTP_CLIENT ,
L_RESULT TYPE STRING ,
L_STATUS_TEXT TYPE STRING ,
L_HTTP_STATUS_CODE TYPE I ,
L_HTTP_LENGTH TYPE I ,
L_PARAMS_XSTRING TYPE XSTRING ,
L_XSTRING TYPE XSTRING ,
L_IS_XML_TABLE TYPE STANDARD TABLE OF SMUM_XMLTB ,
L_IS_RETURN TYPE STANDARD TABLE OF BAPIRET2 ,
L_OUT_TAB TYPE STANDARD TABLE OF TBL1024
MOVE 'https://<hostname>/xxx/yyy/zzz' TO L_URL.
MOVE '<XML as string>' TO L_PARAMS_STRING.
*STEP-1 : CREATE HTTP CLIENT
CALL METHOD CL_HTTP_CLIENT=>CREATE_BY_URL
EXPORTING
URL = L_URL
IMPORTING
CLIENT = L_HTTP_CLIENT
EXCEPTIONS
ARGUMENT_NOT_FOUND = 1
PLUGIN_NOT_ACTIVE = 2
INTERNAL_ERROR = 3
OTHERS = 4 .
"STEP-2 : AUTHENTICATE HTTP CLIENT
CALL METHOD L_HTTP_CLIENT->AUTHENTICATE
EXPORTING
USERNAME = 'testUser'
PASSWORD = 'testPassword'.
"STEP-3 : SET HTTP HEADERS
CALL METHOD L_HTTP_CLIENT->REQUEST->SET_HEADER_FIELD
EXPORTING NAME = 'Accept'
VALUE = 'text/xml'.
CALL METHOD L_HTTP_CLIENT->REQUEST->SET_HEADER_FIELD
EXPORTING NAME = '~request_method'
VALUE = 'POST' .
CALL METHOD L_HTTP_CLIENT->REQUEST->SET_CONTENT_TYPE
EXPORTING CONTENT_TYPE = 'text/xml' .
"SETTING REQUEST DATA FOR 'POST' METHOD
IF L_PARAMS_STRING IS NOT INITIAL.
CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
EXPORTING
TEXT = L_PARAMS_STRING
IMPORTING
BUFFER = L_PARAMS_XSTRING
EXCEPTIONS
FAILED = 1
OTHERS = 2.
CALL METHOD L_HTTP_CLIENT->REQUEST->SET_DATA
EXPORTING DATA = L_PARAMS_XSTRING .
ENDIF.
"STEP-4 : SEND HTTP REQUEST
CALL METHOD L_HTTP_CLIENT->SEND
EXCEPTIONS
HTTP_COMMUNICATION_FAILURE = 1
HTTP_INVALID_STATE = 2.
"STEP-5 : GET HTTP RESPONSE
CALL METHOD L_HTTP_CLIENT->RECEIVE
EXCEPTIONS
HTTP_COMMUNICATION_FAILURE = 1
HTTP_INVALID_STATE = 2
HTTP_PROCESSING_FAILED = 3.
"STEP-6 : Read HTTP RETURN CODE
CALL METHOD L_HTTP_CLIENT->RESPONSE->GET_STATUS
IMPORTING
CODE = L_HTTP_STATUS_CODE
REASON = L_STATUS_TEXT .
WRITE: / 'HTTP_STATUS_CODE = ',
L_HTTP_STATUS_CODE,
/ 'STATUS_TEXT = ',
L_STATUS_TEXT .
"STEP-7 : READ RESPONSE DATA
CALL METHOD L_HTTP_CLIENT->RESPONSE->GET_CDATA
RECEIVING DATA = L_RESULT .
"STEP-8 : CLOSE CONNECTION
CALL METHOD L_HTTP_CLIENT->CLOSE
EXCEPTIONS
HTTP_INVALID_STATE = 1
OTHERS = 2 .
"STEP-9 : PRINT OUTPUT TO FILE
CLEAR : L_XSTRING, L_OUT_TAB[].
CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
EXPORTING
TEXT = L_RESULT
IMPORTING
BUFFER = L_XSTRING
EXCEPTIONS
FAILED = 1
OTHERS = 2.
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
EXPORTING
BUFFER = L_XSTRING
TABLES
BINARY_TAB = L_OUT_TAB .
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = 'C:AMEYHTTP_POST_OUTPUT.xml'
TABLES
DATA_TAB = L_OUT_TAB .
Also, following is the detailed link for use of HTTP_CLIENT class: -
http://help.sap.com/saphelp_nw70ehp1/helpdata/EN/1f/93163f9959a808e10000000a114084/content.htm
Also, in below link, you can ignore XI specific part and observe how its sending XML to external URL:-
(I know it describes call to SAP XI server's URL, but it can be used to call any URL)
http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/ae388f45-0901-0010-0f99-a76d785e3ccc
In addition to all above, following configs to be present at ABAP application server: -
1. The hostname used to URL should be present in SAP ABAP application server's 'hosts' file.
2. Security certificate (if available) for URL to be called must be installed in SAP ABAP application server.
Let me know if you achieve any progress with it... -
Is there a way to create a rule that sends and Auto Response for a shared mailbox?
I have a shared mailbox set up that receives emails that are sent to 3 different addresses:
[email protected]
[email protected]
[email protected]
I would like to create a rule that would send an auto response when someone emails one of these addresses. However, I don't want an auto response sent to [email protected] so I can't just set up an "out of office" reply for the mailbox.
Is there a way that I can create a rule to send an automated response to 2 of the 3 addresses?
NateHi
we can enable the shared mailbox in ADUC and create Outlook rules for it in Outlook to achieve it. please follow these steps:
1. In Active Directory Users and Computers, right-click the shared mailbox and click Enable Account.
2. Configure the Outlook account for the shared mailbox in Outlook.
3. Click Rules > Manage Rules & Alerts.
4. Create a rule like the following format:
Apply this rule after the message arrives
Have server reply using a specific message
Except if the subject contains specific words
Select exception(s) (if necessary) of the Outlook Rule - (“except if from people or public group“)
5. Apply the auto reply rules for this shared mailbox.
Then users can receive auto reply of the shared mailbox except the exceptions we have set when they send messages to this shared mailbox.
Remember to mark as helpful if you find my contribution useful or as an answer if it does answer your question.That will encourage me - and others - to take time out to help you -
When I send a text message from my iPhone response only comes back to my iPhone . If I send from iPad, response only comes back to iPad. Whichever I used last is where response comes. Responses are not coming to both anymore!
On both devices when you go to settings>messages>send and recieve how are poeple contacting you on each device?. e.g. email or mobile number.
-
Processing the multiple sender xml one by one in a time gap to RFC
Dear Experts,
I have to process the multiple sender xml file one by one from FTP to RFC in time gap.
For Ex:
I will place 10 xml file in a FTP path at a time, PI is picking 10 file at a time and process it to RFC at a time.
Any other way to process the multiple file one by one through PI in a time gap to RFC
(i,e) PI needs to process the 10 files one by one, once the first file processed successfully from FTP to RFC then the next file to process in a time gap to avoid getting the error in RFC.
Kindly suggest your ideas or share some links how to process this multiple files.
Best Regards,
Monikandan.Hi Monikandan,
You can use CE BPM with PI 7.1 But first check the suggestion of Anupam in the below thread:
reading file sequentially from FTP using SAP PI file adapter
Regards,
Nabendu. -
How to send XML file into XI using sender HTTP adapter
I am using HTTP sender adapter to post the XML file into XI. I tried to form the URL by using the following String query , but I am unable to execute file.
String urlString = "http://<servername:portno>/sap/xi/adapter_plain?namespace=<namespace>&interface=<interface name>&service=<service name>&party=&agency=&scheme=&QOS=BE&sap-user=xiappluser&sap-password=satyam&sap-client=100&sap-language=EN";
How can I execute xml file by using HTTP sender adapter.
Any one with better suggestions, about this idea?
Thanks in advance for all.
Ram RajHi
Just use the following parameter to send xml file using HTTP adapter.
"http://xiserver:8000/sap/xi/adapter_plain?namespace="senderNamespace"&interface=senderinterface&service=sender service";
"&party=sender party"&agency=&scheme=&QOS=BE&sap-user=userid &sap-password=password&sap-client=100&sap-language=D";
with the help of this you are able to point out which interface you would like to use.
And in payload pass the xml.
and thats it
carry on
Cheers
Regards
Piyush -
Send XML as attachment in Email activity
Hi
My requirement is to send XML as an attachment through email .
In the attachment if i select the MIME type as "XML" then no email notification is sent,
but if i select the MIME type as "text/html" , then attachement is sent through email , but attachment is in different format( with no content inside attachment) .
Can anyone help me on this .have you tried the example on this page : http://java.net/projects/oraclesoasuite11g/pages/Notification
-
Send XML to client: message box
Hi,
In a BPM workflow I'm putting together, I need to open a message box for information
(title, message, OK button). In the documentation, I found that I should send
an XML document to a client that looks like this:
<message-box title="title" style="information" options="ok">
<actionid>"1013679664318"</actionid>
</message-box>
Which I did: I added a "Send XML to client" action in the "True" part of a decision
node with a message-box element and its attributes, and actionid as a nested element.
When I trigger the workflow, it goes through all the expected steps but the window
does not pop up at all. I could not find the reason why anywhere. So has anyone
experienced the same problem ? If yes, how did you solve it ?
Cheers,
YannHi Sudhar.
I don't think your workflow will execute the next node before you mark the current
node as done. Conseqently setting the done in the decision box isn't possible.
Giora
"Sudhar" <[email protected]> wrote:
>
After I do the Send XML to Client from the exeucte tab of an action...instead
of
marking the task as done on the call back actions...i try to mark the
same task
as done in the next task after a decision box....it doesnt seem to work?
any ideas? should you always mark a task as done on the same task?
Maybe you are looking for
-
Performing goods receipt based on TO confirmation for putaway
Hi All, I am testing the possiblity of creation/confirmation of TO that will post goods receipt the purcharse order or inbound delivery. I have set the Shipping control value to 2 - Copy WM quantity as delivery quantity and post GR/GI. But what is th
-
When I am opening a .jpg image not an actual raw camera image from Elements 12 it is being opened as a camera Raw image and the image is cropped, I can't find anyway to get the image to uncrop or zoom out so that the entire image is visible so that I
-
How do I synch photos from my pc to my ipad?
How do I synch photos from my pc to my ipad?
-
I can access almost all web sites on my desktop, laptop, and smartphone, but there are a few that will load on the desktop and smartphone, but will not load on my laptop, with either Firefox or IE. There is no error message, and the animated icon tha
-
LATEST NVIDIA DRIVER OR MSI OLDER DRIVER
I'm currently using MSI 311.06 driver but NVIDIA has already released version 320.18. Should I update to NVIDIA driver and why?