Consuming REST services

Hi,
Can you please let me know the approach to consume a REST service dynamically. 
I have a custom orchestration service as described in the below thread. I use BRE resolvers to resolve and set the endpoints runtime on dynamic ports. Also using dynamic transforms.
http://www.ithero.nl/post/2013/06/02/Creating-a-Custom-Itinerary-Orchestration-Service-for-the-Recipient-List-pattern.aspx
Now i want to extend this to invoke REST apis as well. Can you please guide to a link or share some ideas on how this can be achieved using BizTalk 2013.
Also could you please comment on authentication of such requests.
Thanks,
Ujjwal
-Ujjwal

Hi Ujjwal,
Here is a useful link for you.
Calling Restful Service using Dynamic Send Ports – BizTalk 2013
How to call RESTFULL service using Dynamic Ports with Variable Mapping in
WCF-WebHttp Adapter
Rachit
Please mark as answer or vote as helpful if my reply does

Similar Messages

  • Http 302 found response while consuming rest service

    Hi,
    When Sap Pi consumed rest service in receiver rest adpater, the response is as following:
    HTTP PUT call to http://host:port/backend/v2/test/test1  not successful. HTTP/1.1 302 Found
    when i tried  with rest client tool:
    firstly it said :
    Redirect  To: http://host:port/login.jsp with status: 302 HTTP/1.1 302 Found
    Redirection information has not been cached.
    the second is:
    Status
    200 OK Loading time: 22
    How can i redirect in sap PI?
    Thanks,
    Nurhan

    Can you please post some of the values you are using to connect to your Schema Service? (please redact the hostname URL for security purposes)
    You can also follow this tutorial:
    Data Loading and the Oracle Database Cloud Service
    Format is usually:
    username used to sign up
    password giving at sign up
    Service Instance URL

  • Consuming REST Services from Sharepoint Online (office 365) with jquery

    I hosted Rest services in one server but i am consuming the REST Service through jquery which is using from  sharepoint online.
    while consuming i am getting the error like "Blocked cross domain ........ "
    another exception like since we are calling from https(sharepoint online) to http(other server) , so the problem will be like..
    any body having any idea to solve the cross domain issue to access the http from https call.
    advance thanks !

    Hi,
    For the cross domain issue when using REST API, I suggest you take a look at the articles below with more information and code samples provided:
    http://blogs.msdn.com/b/officeapps/archive/2012/11/29/solving-cross-domain-problems-in-apps-for-sharepoint.aspx
    http://msdn.microsoft.com/en-us/library/office/fp179927(v=office.15).aspx
    http://msdn.microsoft.com/en-us/magazine/dn198245.aspx
    Thanks
    Patrick Liang
    Forum Support
    Please remember to mark the replies as answers if they
    help and unmark them if they provide no help. If you have feedback for TechNet
    Subscriber Support, contact [email protected]
    Patrick Liang
    TechNet Community Support

  • Rest services using WCF

    Hi,
    Couple of doubts about wcf rest  services.
    1, how a wcf rest service call is made from a asp.net mvc or asp.net web application .
     a, What is the better way to consume in ecommerce application (where traffic is more)
    b, is it using a httpwebrequest obejct or do we need to create a proxy class , can anybody paste a snippet of the code
    consume it ore please suggest a web reference link .
    2, is the web api took over the wcf rest service role  or still it is using in industry.
    Thanks

    Hi techasuran,
    >>1, how a wcf rest service call is made from a asp.net mvc or asp.net web application .
    a,What is the better way to consume in ecommerce application (where traffic is more)
    b, is it using a httpwebrequest obejct or do we need to create a proxy class , can anybody paste a snippet of the code
    For the WCF Rest Service, we can not do the add the service reference as do in WCF SOAP Service, because the REST Service has no concept of a WSDL in WCF. Then if you want to call the WCF Rest Service from a asp.net mvc or asp.net
    web application, please try to use the HttpWebReqest, HttpClient or the Jquery to help us. In my mind the better way to consume the WCF Rest Services in the ecommerce application is to use the Jquery Ajax Calls.
    For more information, please try to refer to the following articles:
    #Call Restful Service using HttpWebRequest:
    http://fromjami.wordpress.com/2013/05/26/call-restful-service-using-httpwebrequest-and-post-data/ .
    #Create and consume WCF Restful Service using an HttpClient:
    http://chsakell.com/2013/07/12/create-and-consume-wcf-restful-service-using-an-httpclient/ .
    #Consume RESTful service using jQuery in 2 simple steps:
    http://www.topwcftutorials.net/2013/10/consume-rest-service-using-jquery.html .
    >>2, is the web api took over the wcf rest service role  or still it is using in industry.
    Web API is open source an ideal platform for building REST-ful services over the .NET Framework. Unlike WCF Rest service, it use the full featues of HTTP (like URIs, request/response headers, caching, versioning, various content formats). It also supports the
    MVC features such as routing, controllers, action results, filter, model binders, IOC container or dependency injection, unit testing that makes it more simple and robust.
    For more information about the difference betwwen the WCF Rest Service and Web API and how to choose betwwen them, please try to refer to the following articles:
    #Difference between WCF and Web API and WCF REST and Web Service:
    http://www.dotnet-tricks.com/Tutorial/webapi/JI2X050413-Difference-between-WCF-and-Web-API-and-WCF-REST-and-Web-Service.html
    #WCF or ASP.NET Web APIs:
    http://www.codeproject.com/Articles/341414/WCF-or-ASP-NET-Web-APIs-My-two-cents-on-the-subjec .
    Best Regards,
    Amy Peng
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • No transport error while consuming WCF service in a REST way

    Hi,
    Here is a small article on when we usually face No Transport error and how to get rid of it.
    I recently worked on a sample application using “app for Office” (New in Visual Studio 11.0)
    What is “app for Office”?
    An app for Office is basically a webpage that is hosted inside an Office client application. You can use apps to extend the functionality of a document, email message, meeting request, or appointment. Apps
    can run in multiple environments and clients, including rich Office desktop clients, Office Web Apps, mobile browsers, and also on-premises and in the cloud.
    What can an app for Office do?
    An app for Office can do pretty much anything a webpage can do inside the browser, such as the following:
    Provide an interactive UI and custom logic through      JavaScript. (Develop UI using HTML and JavaScript)
    Use JavaScript frameworks such as jQuery.
    Connect to REST endpoints and web services via      HTTP and AJAX.
    Run server-side code or logic, if the page is      implemented using a server-side scripting language such as ASP or PHP.
    As “app for Office” doesn’t have an option to write server side scripting (unlike code behind or in-line coding feature in ASP.NET/MVC) we will have to go for web service or WCF service and consume the service
    using any JavaScript framework like Jquery.
    I wrote a simple WCF service to hook up with server side code and consumed the service using Jquery as follows
    $(document).ready(function () {
    $.ajax({
    type: "GET",
    url: "http://localhost/MyService.svc/rh/data?id=" + $('#sampleType').val(),
    processData: false,
    contentType: "application/json; charset=utf-8",
    dataType: "json",
    crossDomain: true,
    success: function (data) {
    alert(data)
    error: function (xhr, status, error) {
    alert(error);
    I encountered an error saying “No Transport” when I executed the client application.
     I did some investigation on this and found out the root cause that cross-domain request was disabled. But I was really not sure whether it was at my WCF service end or “app for Office” client end. I added
    Client Access policy and Cross-domain-policy xml files to WCF service in order to enable cross-domain request 
    so that service will accept any type requests sent form different domains.
    Client Access policy
    <?xml version="1.0" encoding="utf-8" ?>
    <access-policy>
    <cross-domain-access>
    <policy>
    <allow-from http-request-headers="*">
    <domain uri="*"/>
    </allow-from>
    <grant-to>
    <resource include-subpaths="true" path="/"/>
    </grant-to>
    </policy>
    </cross-domain-access>
    </access-policy>
    Cross-domain-policy
    <?xml version="1.0"?>
    <!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
    <cross-domain-policy>
    <allow-http-request-headers-from domain="*" headers="*"/>
    </cross-domain-policy>
    Both the policies should be in different XML files
    But this didn’t solve my problem. After a little bit more investigation I found exactly where and how to enable-cross domain requests.
    Solution
    We need to enable cross-domain requests in environments that do not support cross-domain requests.
    “Cors is equal to true if a browser can create an XMLHttpRequest object and if thatXMLHttpRequest
    object has a withCredentials property. To enable cross-domain requests in environments that do not support cors yet but do allow cross-domain XHRrequests (windows gadget, etc), set $.support.cors = true;”
    You just have to add jQuery.support.cors = true; in your client scripting and it works perfectly fine.
    [Cors- Cross-Origin Resource Sharing]
    A simple example:
    $.support.cors = true;
    $(document).ready(function () {
    $.ajax({
    type: "GET",
    url: "http://localhost/MyService.svc/rh/data?id=" + $('#sampleType').val(),
    processData: false,
    contentType: "application/json; charset=utf-8",
    dataType: "json",
    crossDomain: true,
    success: function (data) {
    alert(data)
    error: function (xhr, status, error) {
    alert(error);
    Hope this will be helpful.
    Thanks

    This is very good technich to resolve the problem. but this is not working in Google chrome or Firfox . can any one help me.

  • Consuming RESTful web service in Apex app

    Hi,
    I have created a RESTful Web service through an Apex application (4.0) and published as a public web service. Can someone point me to an example of how to then consume that service in another Apex app? The output is straightforward XML that I can retrieve just by pointing the browser to the URL of the service created, but when I go to create the REST Web Reference for the receiving application, I am not sure what to put for the Response Xpath or Response Namespace. The service is meant to just return report records that were created in the REStful Web service with no input required.
    The service XML looks like this:
    <ROWSET>
    <ROW>
    <PROJ_ID>132</PROJ_ID>
    <PSL_NETID>xxxxxxxx</PSL_NETID>
    <PROJECT_TITLE>11g- Oracle Upgrade to RAC 11g</PROJECT_TITLE>
    <CUSTOMER>OIT</CUSTOMER>
    <DIVISION>EIS</DIVISION>
    </ROW>
    <ROW>
    <PROJ_ID>132</PROJ_ID>
    <PSL_NETID>xxxxxx</PSL_NETID>
    <PROJECT_TITLE>11g- Oracle Upgrade to RAC 11g</PROJECT_TITLE>
    <CUSTOMER>OIT</CUSTOMER>
    <DIVISION>CSS</DIVISION>
    Any help would be appreciated.
    Thanks,
    Pat
    Edited by: patfmnd on Dec 7, 2012 3:04 AM

    Hi,
    I have made progress in this. I created the RESTful report service in an Apex 4.1 application. (previous attempt was with 4.0 version of Apex)
    I then created a separate application and created a RESTful web service reference that I tested and it was successful in bringing up XML. However in Apex 4.1, when I create a report following the Wizard for creating a report based on that Web service reference I get the error: ORA-31013: Invalid XPATH expression Which I don't know how to get past. The Xpath provided in the Web service reference test gave output below and brought back a result. There was no where during the Report creation to provide an Xpath. Am I missing something or is 4.1 not quite Web service ready??
    This is what I get from the test of the Web service reference in the Apex App from which I want to create a report: (I see in this XML the data I was expecting from the test of the RESTful web service but it looks like the output I get from the Web service test is more like the Report xml itself.)
    <!DOCTYPE html> <html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:htmldb="http://htmldb.oracle.com" xmlns:apex="http://apex.oracle.com"> <head> <title>Author</title>
    <!--[if IE]><link rel="stylesheet" href="/i/css/apex_ie_4_1.css" type="text/css" /><![endif]--> <script type="text/javascript">
    //<![CDATA[
    var apex_img_dir = "/i/", htmldb_Img_Dir = apex_img_dir;
    //]]>
    </script>
    <script src="/i/javascript/apex_4_1.min.js" type="text/javascript">
    </script>
    <script type="text/javascript">
    //<![CDATA[
    apex.security.framebreaker("D");
    //]]>
    </script>
    <!--[if IE]><link rel="stylesheet" href="/i/themes/theme_2/css/theme_4_0_ie.css" type="text/css" /><![endif]--><!--[if IE 6]><link rel="stylesheet" href="/i/themes/theme_2/css/theme_4_0_ie6.css" type="text/css" /><![endif]--><!--[if IE 7]><link rel="stylesheet" href="/i/themes/theme_2/css/theme_4_0_ie7.css" type="text/css" /><![endif]--><!--[if lte IE 6]><div id="outdated-browser">You are using an outdated web browser. For a list of supported browsers, please reference the Oracle Application Express Installation Guide.</div><![endif]-->
    <form action="wwv_flow.accept" method="post" name="wwv_flow" id="wwvFlowForm"><input type="hidden" name="p_flow_id" value="140" id="pFlowId" /><input type="hidden" name="p_flow_step_id" value="1" id="pFlowStepId" /><input type="hidden" name="p_instance" value="6146802068150520" id="pInstance" /><input type="hidden" name="p_page_submission_id" value="1940235134399423" id="pPageSubmissionId" /><input type="hidden" name="p_request" value="" id="pRequest" />
    <div id="header">
    <div id="app-logo"><a href="f?p=140:1:0"></a></div>
    <div id="navbar">
    <div class="navbar-entry">Logout</div>
    </div>
    </div>
    <div id="tabs">
    <div class="frame">
    <div class="bg">
    <div class="tab-holder">
    <div class="first-current">
    <div><span>Author</span></div>
    </div>
    </div>
    </div>
    </div>
    </div>
    <div id="topbar">
    <div class="breadcrumb-region" id="R170908223330421512">
    <div>
    <div id="breadcrumbs">
    <ul class="breadcrumb-list">
    <li class="current">Author</li>
    </ul>
    </div>
    </div>
    </div>
    </div>
    <div id="messages"></div>
    <div id="body">
    <table class="tbl-body" cellspacing="0" cellpadding="0" border="0" summary="">
    <tbody>
    <tr>
    <td class="tbl-main" width="100%">
    <div class="rounded-corner-region" id="books">
    <div class="rc-blue-top">
    <div class="rc-blue-top-r">
    <div class="rc-title">AUTHOR</div>
    <div class="rc-buttons"><button value="Reset" class="button-gray" type="button" id="B170907622885421490"><span>Reset</span></button></div>
    </div>
    </div>
    <div class="rc-body">
    <div class="rc-body-r">
    <div class="rc-content-main">
    <table id="apex_layout_170907030238421484" border="0" class="formlayout" summary="" role="presentation" datatable="0">
    <tr>
    <td align="right"><label for="P1_REPORT_SEARCH" tabindex="999"><a class="optional-w-help" href="javascript:popupFieldHelp('170907422375421487','6146802068150520')" tabindex="999">Search</a></label></td>
    <td colspan="1" rowspan="1" align="left"><input type="hidden" name="p_arg_names" value="170907422375421487" /><input type="text" id="P1_REPORT_SEARCH" name="p_t01" value="" size="30" maxlength="2000" class="text_field" /></td>
    <td align="right"><label for="P1_ROWS" tabindex="999"><a class="optional-w-help" href="javascript:popupFieldHelp('170907508375421490','6146802068150520')" tabindex="999">Display</a></label></td>
    <td colspan="1" rowspan="1" align="left"><input type="hidden" name="p_arg_names" value="170907508375421490" /><select name="p_t02" id="P1_ROWS" size="1" class="selectlist">
    <option value="10">10</option>
    <option value="15" selected="selected">15</option>
    <option value="20">20</option>
    <option value="30">30</option>
    <option value="50">50</option>
    <option value="100">100</option>
    <option value="200">200</option>
    <option value="500">500</option>
    <option value="1000">1000</option>
    <option value="5000">5000</option>
    </select></td>
    <td align="left"></td>
    <td colspan="1" rowspan="1" align="left"><button value="Go" class="button-gray" type="button" id="P1_GO"><span>Go</span></button></td>
    </tr>
    </table>
    <div id="report_170907030238421484_catch">
    <table cellpadding="0" border="0" cellspacing="0" summary="" id="report_books">
    <tr>
    <td></td>
    </tr>
    <tr>
    <td>
    <table cellpadding="0" border="0" cellspacing="0" summary="" class="report-standard">
    <tr>
    <th id="AUTHORID" class="header">
    <div class="rpt-sort">Authorid<img align="absmiddle" src="/i/arrow_up_gray_dark.gif" width="13" height="12" alt="Sort by this column" /></div>
    </th>
    <th id="LNAME" class="header">
    <div class="rpt-sort">Lname</div>
    </th>
    <th id="FNAME" class="header">
    <div class="rpt-sort">Fname</div>
    </th>
    </tr>
    <tr class="highlight-row">
    <td headers="AUTHORID" class="data">A100</td>
    <td headers="LNAME" class="data">AUSTIN</td>
    <td headers="FNAME" class="data">JAMES</td>
    </tr>
    <tr class="highlight-row">
    <td headers="AUTHORID" class="data">A105</td>
    <td headers="LNAME" class="data">ADAMS</td>
    <td headers="FNAME" class="data">JUAN</td>
    </tr>
    <tr class="highlight-row">
    <td headers="AUTHORID" class="data">B100</td>
    <td headers="LNAME" class="data">BAKER</td>
    <td headers="FNAME" class="data">JACK</td>
    </tr>
    <tr class="highlight-row">
    <td headers="AUTHORID" class="data">F100</td>
    <td headers="LNAME" class="data">FIELDS</td>
    <td headers="FNAME" class="data">OSCAR</td>
    </tr>
    <tr class="highlight-row">
    <td headers="AUTHORID" class="data">J100</td>
    <td headers="LNAME" class="data">JONES</td>
    <td headers="FNAME" class="data">JANICE</td>
    </tr>
    <tr class="highlight-row">
    <td headers="AUTHORID" class="data">K100</td>
    <td headers="LNAME" class="data">KZOCHSKY</td>
    <td headers="FNAME" class="data">TAMARA</td>
    </tr>
    <tr class="highlight-row">
    <td headers="AUTHORID" class="data">M100</td>
    <td headers="LNAME" class="data">MARTINEZ</td>
    <td headers="FNAME" class="data">SHEILA</td>
    </tr>
    <tr class="highlight-row">
    <td headers="AUTHORID" class="data">P100</td>
    <td headers="LNAME" class="data">PORTER</td>
    <td headers="FNAME" cla
    Edited by: patfmnd on Dec 12, 2012 5:59 PM
    Edited by: patfmnd on Dec 12, 2012 6:07 PM

  • Consume Restful Web Services

    Hi,
    I have experience consuming Soap Web Services using utl_dbws.
    Our client provides various rest web services that we need to access within the database.
    We wan't a pure pl/sql solution without any additional java components.
    Does anyone have any information on how to consume REST web services?
    Thanks

    Check out APEX_WEB_SERVICE.
    Ta,
    Trent

  • Best practice for consuming web services

    Hi
    we are consuming web service in orchestration by "Add Generated Item".By using this option it creates 1 orch,1xsd file and some bindings.
    we have different projects for schemas,maps and orchestration under our solution in visual studio.
    Now i need to know that what will be the best practice for consuming web service in orchestration i mean in which project should i use "add generated item" (in orchstration project or in schemas project) coz it generates both 1 orch and 1
    schema.
    thanks

    From a service orientation perspective you should abstract the service artifacts from the other artifacts. Otherwise it will be very difficult to update the service interface without affecting the other artifacts. For example you don't want to have to redeply
    your entire application if only one field changes in the service you consume.
    So I typically generate the items, remove the unnecessary stuff, and put them in a separate project.
    Depending on the control you have over the services you want to consume, it would even be better to create another layer of abstraction. By that I mean create your own interface (schema) and map that one to the one the service exposes. This basically
    is only necessary if you consume external services that are beyond your control. By abstracting the interface it exposes, you limit the impact of changes of that interface on the rest of your system. All changes are abstracted behind your own interface.
    If you consume internal services, you can probably control the way the interface is defined. In a service oriented world all internal services expose a well known interface, based on the domain objects you have within your organisation.
    Jean-Paul Smit | Didago IT Consultancy
    Blog |
    Twitter | LinkedIn
    MCTS BizTalk 2006/2010 + Certified SOA Architect
    Please indicate "Mark as Answer" if this post has answered the question.

  • Not able to call REST service

    Hi,
    I'm trying to consume a REST service. It seems that its a problem to set the http:query-parameters or http:query-string. I saw this https://blogs.oracle.com/jeffdavies/entry/enhanced_rest_support_in_oracl article and and the one in the OSB 11G Development cookbook but the http:query-parameters or http:query-string tag doesnt show up in my $outbound. I do make an assign to put the <http:http-method>GET</http:http-method> in there, and that one works........i can see it in $outbound.
    Can anyone explain me why the insert of the query parameters doesnt work?
    Thanks in advance!

    Hi,
    There's a sample on JSON REST here...
    http://java.net/projects/oraclesoasuite11g/downloads/download/OSB/osb-206-JSONREST.zip
    For other samples, see this...
    http://java.net/projects/oraclesoasuite11g/pages/OSB
    Cheers,
    Vlad

  • Expose REST service in PI

    Hi all,
    I kindly ask if it's possible to expose a REST web service with PI to be called from an external application.
    I've created many scenarios in wich I created a SOAP service (from service interface) in PI and I was able to call the service from an external application (e.g. SOAPUi).
    Is it possible to make the same thing exposing a REST service (the url should contain parameters).
    I've seen some discussions and blogs with examples of usage of "SOAP Axis" but it seems it's be possible only to invoke an external service.
    Is it possible also to create a REST web-service?
    If yes could you please provide examples or step-by-step procedure?
    Thanks in advance for any help.
    Stefano.

    Hi Stefano,
    please check the below link where REST adapter key features.
    >>>I kindly ask if it's possible to expose a REST web service with PI to be called from an external application.
    It can be used to expose internal applications as REST services or to consume external REST services by calling these services from SAP PI.
    http://scn.sap.com/community/pi-and-soa-middleware/blog/2011/11/08/rest-adapter-for-netweaver-sap-pi
    Thanks and Regards,
    Naveen    

  • UCCX - Consuming Web Services

    Hi All,
    I am looking for some advice in regards to consuming web services via UCCX scripting. In the past i have been doing so successfully in our environment by using document steps and Xpath expressions for both SOAP and REST web services that were configured to allow an HTTP GET request (tomcat running on apache server to expose public methods written in Java).
    Our company is in the midst of a Microsoft Dynamics 2012 (r2)  implementation and I have the task of establishing communication with AX in order to pass information back and forth. Our consultants with dynamics have setup a test web service using AIF, but it seems that these services require authentication. Currently the test web service is using NTLM authentication and exposed via SOAP. Apparently it is not possible to use HTTP GET for these web services.
    This means i had to write java code in Set steps to communicate with the SOAP services. I was able to successfully do this for some of our own web services using SOAP. however i am having problems with the AX test web service due to the authentication. (Thanks to Gergely Szabo, as i used some of his code found here: https://supportforums.cisco.com/document/97736/uccx-8x-really-simple-soap-client-no-custom-jar )
    I am hoping someone has some experience with having consumed AIF web services via Java or at least Java written within a UCCX script. Or if someone has been able to implement authentication and can provide some details for how that works? I don't even know if i can authenticate via NTLM from UCCX scripts due to it being a windows authentication protocol and not linux based.
    Any thoughts or ideas would be appreciated!
    Thanks,
    Kevin.

    Hi,
    Thus far I have been unsuccessful in my attempts to communicate with this particular web service. The consults did create another service using Basic HTTP Auth and I was able to consume and use the service using SOAPUI just fine.
    However, my soapResponseString code (small tweak of Gergely's code) is not working. After 2-3 minutes of sitting on that step in the CRS Editor my stacktrace exception is thrown and shows "Connection timed out". This is way past the time for the 5000ms read timeout, so I imagine the initial communication is successful but then eventually times out due to not returning a response?
    I tried to mimic the headers SOAPUI uses from it's HTTP Log, hence the number of urlCon.setRequestProperty lines..
    CODE for Set soapResponseString below:
    // create a ByteArrayOutputStream - this is actually a buffer
    // we are going to use to store the response coming from the SOAP server
    java.io.ByteArrayOutputStream baos = new java.io.ByteArrayOutputStream();
    // this is quite unnecessary: assigning the value of the soapRequest (still holding our XML document)
    // to another variable, named content, type String; but anyway, it's just cleaner
    String content = soapRequest;
    // specify a timeout - 5000 milliseconds - if the web server does not start sending back
    // anything within this timeframe, an exception will be raised
    int readTimeout = 5000;
    try {
    // a new URL, which is the soapServiceEndpoint variable value (http://ip:port/ etc):
         java.net.URL url = new java.net.URL(soapServiceEndpoint);
    // creating a HTTP connection to the above URL:
         java.net.HttpURLConnection urlCon = (java.net.HttpURLConnection) url.openConnection();
    // setting some important header parameters, first of all, content length, this is most likely expected
    // by the SOAP server
         urlCon.setFixedLengthStreamingMode(content.length());
    // setting the timeout:
         urlCon.setReadTimeout(readTimeout);
    // we tell Java we will do input (in other words, we will read):
         urlCon.setDoInput (true);
    // we tell Java we will do output (in other words, we will send):
         urlCon.setDoOutput (true);
    // we tell Java not to cache:
         urlCon.setUseCaches (false);
    // we are using HTTP POST
         urlCon.setRequestMethod("POST");
    // finally, we set the Content-Type header,
    // this way we are telling the SOAP server we are sending an XML, using the UTF-8 charset
         urlCon.setRequestProperty("Content-Type","text/xml;charset=UTF-8");
    // here we are sending our Basic Auth - authStringEnc is a base64 encoded user:pass credential that's initialized in a previous step
      urlCon.setRequestProperty("Authorization","Basic " + authStringEnc);
    //set some other header information for the request required by the AIF Web Service 
      urlCon.setRequestProperty("SOAPAction","http://tempuri.org/myService/getSiteId");
      urlCon.setRequestProperty("Host", "myServer.myDomain.com:8080");
      urlCon.setRequestProperty("Connection","Keep-Alive");
      urlCon.setRequestProperty("User-Agent","Java/1.6.0_29");
      urlCon.setRequestProperty("Accept-Encoding","gzip,deflate");
    // opening an OutputStream (this is a one-way channel towards the SOAP server:
         java.io.DataOutputStream output = new java.io.DataOutputStream(urlCon.getOutputStream());
    // we write the contents of the content variable (= soapRequest = XML document):
         output.writeBytes(content);
    // telling Java to flush "speed up!" and then close the stream:
         output.flush();
         output.close();
    // now getting the InputStream (getting a one way channel coming from the SOAP server):
         java.io.DataInputStream input = new java.io.DataInputStream(urlCon.getInputStream());
    // buffered read from the InputStream, buffer size 4Kilobytes (= 4096 bytes):
    // and the buffer is always written to the other buffer, named baos, that we specified
    // on the first line of this block of code
         int bufSize = 4096; // buffer size, bytes
         byte[] bytesRead = new byte[bufSize];
         int bytesReadLength = 0;
         while(( bytesReadLength = input.read( bytesRead )) > 0 ) {
             baos.write(bytesRead,0,bytesReadLength);
         } //while block ends here
    // closing the InputStream:
         input.close();
    // closing the baos buffer
         baos.close();
    } catch (Exception e) {
    // again, if an error occurs, let's just send the stack trace to stdout (stdout.log)
    // and then return null or can we can return e.getMessage() to see the exception caught inside the script
        e.printStackTrace();
     return e.getMessage();
        //return null;
    } // try..catch block ends here
    // construct a new String, and return that to the CRS script:
    return new String(baos.toByteArray());
    } // closure ends here

  • Do SMP3.0 supports JSON based RESTful services exposed via JBOSS server??

    Hi All,
    We are working on a PoC for a customer to consume JSON based RESTful (exposed via JBOSS Server) service from SMP 3.0. We were not able to get the DataSet. the below are the steps which we performed and the respective result.
    1) Created a SMP Application - Able to ping the application with the base URL
    2) Tested the connections - Able to create a Registration using Firefox POSTMAN client
    3) Data Consumption from the service - We are not able to get the response for the service when we try the same via SMP,but we are able to get the data when we try the REST service URL directly from the browser.
    How do we achieve this? Do SMP3.0 support JSON based RESTful service? Can Integration Gateway Help?
    Thanks, Prem

    hi Jitendra,
    attached are the screen shots of both SMP service from postman we tried and the original service from the browser.
    1- postman ping for SMP URL and header says success.
    2- Response body with entity set structure and empty data there is no data inside the collection named "Connection" as well and if i call this i fails with 501, that not implemented, so i guess SMP3 is unable to create the entity set out the JSON REST services while converting it into Odata service internally.
    3- i can view data if run directly the REST service from browser.

  • REST service consumption with webDynpro

    Hi,
    Can anyone tell me how can tell one me how to consume REST based services with WebDynpro.
    Thanks & Regards,
    Anand Kothalkar

    Hi,
    see links  belows.
    http://scn.sap.com/thread/2078546
    Tutorial on ABAP HTTP Client REST Service Calls (using Polestar OnDemand)
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/608ef65d-1ff9-2b10-b582-d6445b691719
    Thanks
    Santosh.

  • Testing OSB REST Service

    Hello,
    I have created an OSB Service(HTTP) which can be exposed as REST service to consumer application. Now, how can i test this OSB Service using SOAP UI/some tool, as its not exactly soap service(wsdl) but a REST Service.
    Also, the end point URI in Proxy would be the end point for this OSB Service which can be exposed to consumer application?
    Thanks

    You can test REST services from SOAPUI.
    http://www.soapui.org/REST-Testing/getting-started.html

  • RESTful Services comfiguration step missing TEST Button

    Hello there,
    I was asked to set up the RESTful Services. When I get to my last page, there were not a test button to test the RESTful Services Reference as well as the set bind variable button to set the bind valiable. So at this point, I was not able to get the JSON result file that will show the URI where the application will consume the Web Services. Can someone assist me in getting this work? is this problem and upgrade problem? the saystem was upgrade from 4.0 to 4.2
    Can someone help?

    Hi,
    I would recommend that you review the APEX Installation Guide, for details on Configuring RESTful Services using APEX Listener 2.0 or higher.  RESTful Services requires Oracle Application Express Listener 2.0 or later.  The "Test" and "Set Bind Variables" buttons will only be visible on the Resource Handler page of App 4850 when your instance is configured to run with APEX Listener 2.0 or higher.
    I would recommend that review the installation doc steps, ensuring that you have executed the apex_rest_config.sql script, and download the latest version of APEX Listener from OTN and configure it.  Within the downloaded Listener zipfile, you'll contain a very useful RESTful Services Developer Guide, which I recommend that you review.
    Regards,
    Hilary

Maybe you are looking for

  • Issue - Modify Query in Dev Server

    Hi All, Few days ago wit did it an homogenues copy from BW PRD to BW DEV, everything was fine. Nowadays, when i try to open a query in BW DEV appears "BEX transport request XXXX is not available or not suitable", so i cant modify it. Then i created a

  • Reset Of Purchase Requisition Release Strategy

    Dear Peers, Release strategy for PR at header level is defined (Overall Release). If we make any changes or add another line item to the same PR, the release strategy is required to get reset to unreleased state. But this is not happening. Same for P

  • Adobe doesn't work

    This program does not work. I wasted my money!

  • WebLogic 9.2 Managed Server Is not starting

    I have WebLogic 9.2 Application Server installed on Solaris Box and have deployed some ear and war files. If I try to start the managed server its getting the following exception leading to FORCE_SHUTDOWN of the server. Please help me if any one know

  • Re:  Creating blue print of company have footwear ,lfr and jewelBI project

    Hi expert, This is pradeep .right now my project in blue print face so that i required  blue print regards of footwear ,large format stores and jewellery in  BI project my id is [email protected] . I will be assign the point regards pradeep.kandepu E