XML payload in RESTful webservice

Hi all,
Can anyone please suggest on how to call the RESTful webservice (which is used by our client) by passing an XML payload from a PL SQL stored procedure? It is for the authentication purpose. And the username and password has to be passed as the XML payload to the RESTful webservice . Please help, it's a bit urgent.
Thanks in advance
Geethu
Edited by: 982489 on Mar 22, 2013 3:02 AM

Hi all,
Can anyone please suggest on how to call the RESTful webservice (which is used by our client) by passing an XML payload from a PL SQL stored procedure? It is for the authentication purpose. And the username and password has to be passed as the XML payload to the RESTful webservice . Please help, it's a bit urgent.
Thanks in advance
Geethu
Edited by: 982489 on Mar 22, 2013 3:02 AM

Similar Messages

  • PI Consume Restful Webservices

    Hi,
    I have scenario in which PI needs to consume Restful webservices.
    I am looking at HTTP receiver adapter in which I want to set appropreate action (POST, GET, PUT or DELETE) based on mapping.
    For example I want to DELETE purcahse order TXU-19282. The http request that sends to Restful webservice looks like as follows.
    DELETE /restfulwebservice-war/poservice/TXU-19282 HTTP/1.0
    Connection: close
    Content-Type: text/xml
    Content-Length: 0
    Pragma: no-cache
    Now my question is how do I set set above information on HTTP receiver adapater. I looked at dynamic configuration and could find it useful.
    Also I am interested in finding how do I set both heder and Payload via mapping?
    Please let me know.
    Thank you,
    Balaji

    I dont think, there is an option to mention (POST, GET, PUT or DELETE) in HTTP reciever adapter.
    usually , it is with JDBC adapter.
    Lets wait for someone to answer as well. am not much sure.
    Also I am interested in finding how do I set both heder and Payload via mapping?
    Usually, header can be filled with XSL mapping. payload can also be filled with XSL or else with simple graphical mapping.
    -santosh.

  • Error while bringing up ATG REST Webservice

    Hi,
    I am trying to bring a REST Webservice using ATG 9.3 version.I am getting the below errors in the startup of the instance.I have added "REST" module in the Manifest file and am able to see the entry " C:\ATG\ATG9.3\REST\config\config.jar" in CONFIGPATH(Please let me know if there are other ways to find if the service has come up properly).I am trying to connect to the server using JAVA based REST Client as given below.Also,i have placed the jar files in the CLASSPATH of the module.I am hoping that the webservice have not come up properly because of these startup errors.Please help me out to resolve this issue.
    STARTUP EXCEPTION SEEN IN SERVER
    ========================
    2012-06-25 06:20:36,815 INFO [STDOUT] Unable to create class atg.rest.servlet.HeadRestServlet for configuration /atg/dynamo/servlet/dafpipeline/HeadRestServlet java.lang.ClassNotFoundException: No ClassLoaders found for: atg.rest.servlet.HeadRestServlet
    2012-06-25 06:21:56,325 INFO [nucleusNamespace.atg.userprofiling.sso.PassportAuthorityService] Starting passport authority service
    2012-06-25 06:21:56,460 INFO [STDOUT] **** Error
    2012-06-25 06:21:56,460 INFO [STDOUT]      
    2012-06-25 06:21:56,460 INFO [STDOUT] Mon Jun 25 06:21:56 EDT 2012
    2012-06-25 06:21:56,460 INFO [STDOUT]      
    2012-06-25 06:21:56,460 INFO [STDOUT] 1340619716460
    2012-06-25 06:21:56,460 INFO [STDOUT]      
    2012-06-25 06:21:56,460 INFO [STDOUT] /
    2012-06-25 06:21:56,460 INFO [STDOUT]      
    2012-06-25 06:21:56,460 INFO [STDOUT] Unable to set configured property "/atg/dynamo/servlet/Initial.initialServices" atg.nucleus.ConfigurationException: Unable to resolve component /atg/dynamo/servlet/dafpipeline/HeadRestServlet
    2012-06-25 06:22:06,528 INFO [STDOUT] Unable to create class atg.rest.RestConfiguration for configuration /atg/rest/Configuration java.lang.ClassNotFoundException: No ClassLoaders found for: atg.rest.RestConfiguration
    2012-06-25 06:22:06,528 INFO [STDOUT] **** Error
    2012-06-25 06:22:06,528 INFO [STDOUT]      
    2012-06-25 06:22:06,528 INFO [STDOUT] Mon Jun 25 06:22:06 EDT 2012
    2012-06-25 06:22:06,528 INFO [STDOUT]      
    2012-06-25 06:22:06,528 INFO [STDOUT] 1340619726528
    2012-06-25 06:22:06,528 INFO [STDOUT]      
    2012-06-25 06:22:06,528 INFO [STDOUT] /
    2012-06-25 06:22:06,528 INFO [STDOUT]      
    2012-06-25 06:22:06,528 INFO [STDOUT] Unable to set configured property "/atg/rest/Initial.initialServices" atg.nucleus.ConfigurationException: Unable to resolve component /atg/rest/Configuration
    CLASSPATH ENTRY
    ============
    <classpathentry exported="true" kind="var" path="C:/ATG/ATG9.3/REST/lib/atg-rest-1.0.jar"/>
         <classpathentry exported="true" kind="var" path="C:/ATG/ATG9.3/REST/lib/commons-fileupload-1.2.1.jar"/>
         <classpathentry exported="true" kind="var" path="C:/ATG/ATG9.3/REST/lib/commons-io-1.4.jar"/>
         <classpathentry exported="true" kind="var" path="C:/ATG/ATG9.3/REST/lib/dom4j-1.6.1.jar"/>
         <classpathentry exported="true" kind="var" path="C:/ATG/ATG9.3/REST/lib/log4j-1.2.15.jar"/>
         <classpathentry exported="true" kind="var" path="C:/ATG/ATG9.3/REST/client-lib/java/atg-rest-client-1.0.jar"/>
    REST CLIENT:
    ========
    import java.util.HashMap;
    import java.util.Map;
    import atg.rest.client.RestClientException;
    import atg.rest.client.RestComponentHelper;
    import atg.rest.client.RestResult;
    import atg.rest.client.RestSession;
    public class RestClient {
    RestSession mSession;
    protected void execute() throws RestClientException {
         System.out.println("inside execute");
         mSession = RestSession.createSession("localhost", 8080, "<USERNAME>", "<PASSWORD>");
         mSession.setUseHttpsForLogin(false);
         try {
         mSession.login();
         System.out.println("Login Successful");
         catch (Throwable t) {
         System.out.println(t);
         finally {
         try {
         mSession.logout();
         System.out.println("Logout Successful");
         catch (RestClientException e) {
         System.out.println(e);
    * @param args
    public static void main(String[] args) {
         System.out.println("inside main");
         // TODO Auto-generated method stub
         RestClient testATGRest = new RestClient();
         try {
         testATGRest.execute();
         catch (Throwable t) {
         System.out.println(t);
    REST CLIENT ERROR SEEN:
    =================
    atg.rest.client.RestClientException: java.io.IOException: Not Found http://localhost:8080/rest/bean/atg/userprofiling/ProfileServices/loginUser
    atg.rest.client.RestClientException: This session is not logged in and cannot be logged out

    I am trying to expose a method using REST Webservice and access the method using the browser.I have followed the steps specified in the thread:
    http://ecomwriter.com/2012/03/19/building-restful-web-services-using-atg/ .Have added a component called ProfileRESTWebservice and have defined a method “getLoginInfo” in the class file. The following entry is placed in the restSecurityConfiguration.xml
    <resource component="/atg/userprofiling/ProfileRESTWebservice" secure="true">
    <method name="getLoginInfo" secure="false"></method>
    </resource>
    But, I am receiving the following exception when trying to access the method using http://localhost:8080/rest/bean/atg/userprofiling/ProfileRESTWebservice/getLoginInfo
    10:07:33,147 ERROR [BeanServlet] Error code: 400
    atg.beans.PropertyNotFoundException: Can't find property named: getLoginInfo in class: com.vs.commerce.profile.ProfileRESTWebservice
    Can't find property named: getLoginInfo in class: com.vs.commerce.profile.ProfileRESTWebservice
    atg.rest.RestException: atg.beans.PropertyNotFoundException: Can't find property named: getLoginInfo in class: com.vs.commerce.profile.ProfileRESTWebservice
    at atg.rest.output.RestOutputCustomizerImpl.outputBeanProperty(RestOutputCustomizerImpl.java:616)
    at atg.rest.processor.BeanProcessor.doRESTGet(BeanProcessor.java:157)
    at atg.rest.servlet.RestPipelineServlet.serviceRESTRequest(RestPipelineServlet.java:394)
    at atg.rest.servlet.RestPipelineServlet.service(RestPipelineServlet.java:237)
    at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
    at atg.servlet.pipeline.PipelineableServletImpl.service(PipelineableServletImpl.java:298)
    at atg.rest.servlet.RestPipelineServlet.service(RestPipelineServlet.java:241)
    Can you pl help me out on this?

  • Url service data control - problem while  POSTing to a restful webservice

    Hi,
    I am trying to call a restful webservice to add a new employee .I have created the url service data control. The service method consumes XML.
    When i am creating the url service datacontrol I selected the http method as POST and giving the servicepath and servicename as the source. After providing the xsd's path and all , when I test the url connection, I am getting the following error message:
    URL Test: Received Error: Method Not Allowed
    This might be because the clicking of the test url button is sending the get request, but the actual method is POST.
    Now under the data controls navigator, If i view the newly created data control, i could see the loadData(Object) method which i assume is for retrieving the data from the service. But since i have mentioned the method as POST, why such a method is created? Also if its there, can I use the same for insert and update? I have used this loadData (Object) method to create a button which calls the webservice upon click. Under the data control property inspector, i changed the supportsupdate attribute's value to true. But when i am trying to save the employee from the jspx page, I am getting the following message in the integrated weblogic's log
    Couldn't get access to the data source. Cause Unsupported Media Type exception in rest service
    And on the server side I am getting the following error message:
    No message body reader has been found for request class Employee, ContentType application/octet-stream.
    I think the request is not going as XML. But while creating the datacontrol i have specified the xsd document for the iput xml request. Does ADF automatically creates the XML from the input parametres? If it does not, then what could be done to achieve that? The default actionListener of the submit button is #{bindings.loadData.execute}. Do i have to override it to send the XML request? Or have I missed anything in trying to achieve what i intend?
    I had refered this link for reference :
    http://docs.oracle.com/cd/E18941_01/tutorials/jdtut_11r2_53/jdtut_11r2_53.html
    Rampal
    Edited by: user12011868 on Jan 22, 2012 10:03 PM

    Hi Frank,
    I had specified the HTTP method as POST as well as PUT. But the same error is appearing in the both the cases.
    URL Test: Received Error: Method Not Allowed
    And when I am clicking on the 'Test URL Connection' , I can't see any option of selecting the HTTP method. This option only appears in the step 2 of creating the URL service data control where we mention the URL endpoint and the source.
    What could be the reason for the error.
    Rampal

  • XML format Issue with Webservice

    Hi,
      Currently when I generate the XML payload in XI, it is generating as below one. But the 3rd party webservice is expecting everything in on elong big string. How can I do this in XI to convert my XML data after mapping to one long string before calling the webservice.
    Current XML Data
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns1:PutXMLDocument xmlns:ns1="http://test.com/SMIWebService/">
    - <XMLString>
    - <Contracts>
    - <Control>
      <createdWhen>2006-06-13T06:27:12</createdWhen>
      <destinationAddress />
      <documentGUID>e4a14426-9d02-4e2e-8a91-68fc81f1a672</documentGUID>
      <operation staticValue="Change" />
      <schemaVersion>31N</schemaVersion>
      <sourceAddress>Global</sourceAddress>
      <version>3.00</version>
      </Control>
    - <Contract>
      <contractAmount>2050.00</contractAmount>
      <contractBillingType staticValue="Per Contract" />
      <contractCurrency staticValue="United Kingdom - Pound">Constant</contractCurrency>
      <contractDataSource dynamicValue="SAP">Constant</contractDataSource>
      <contractEffectiveDate>2007-01-01</contractEffectiveDate>
      <contractExpirationDate>2007-12-31</contractExpirationDate>
      <contractIdentifier>ff27ab1e-3187-4d37-9122-24769d246c9d</contractIdentifier>
      <contractIncludeLaborIndicator>1</contractIncludeLaborIndicator>
      <contractIncludeLaborIndicatorForOther>0</contractIncludeLaborIndicatorForOther>
      <contractIncludeMaterialIndicator>1</contractIncludeMaterialIndicator>
      <contractIncludeMaterialIndicatorForOther>0</contractIncludeMaterialIndicatorForOther>
      <contractLaborDuration>0</contractLaborDuration>
      <contractLastRenewalDate>2007-11-01</contractLastRenewalDate>
      <contractMaterialDuration>0</contractMaterialDuration>
      <contractNotificationDate>2007-11-01</contractNotificationDate>
      <contractNumber>0040000189</contractNumber>
      <contractReconciliationStatus staticValue="Reconciled" />
      <contractStartDate>2007-01-01</contractStartDate>
      <contractStatus staticValue="Active" />
    - <Customer>
      <customerIdentifier>fe3ccebc-6f64-4849-95d5-0b3b84c204d6</customerIdentifier>
      </Customer>
    - <contractBusinessUnit dynamicValue="UK">
      <businessUnitDescription>United Kingdom</businessUnitDescription>
      </contractBusinessUnit>
      </Contract>
      </Contracts>
      </XMLString>
      </ns1:PutXMLDocument>
    3rd Part Expectation
      <?xml version="1.0" encoding="UTF-8" ?>
    - <ns1:PutXMLDocument xmlns:ns1="http://test.com/SMWebService/">
      <ns1:XMLString><Contracts><Control><createdWhen>2006-06-08T07:03:55</createdWhen><destinationAddress></destinationAddress><documentGUID>A9A5107B-45A6-43A4-8218-D72C8115C9CB</documentGUID><operation staticValue="Change"/><schemaVersion>31N</schemaVersion><sourceAddress>Global</sourceAddress><version>3.00</version></Control><Contract><contractAmount>2050.00</contractAmount><contractBillingType staticValue="Per Contract"/><contractCurrency staticValue="United Kingdom - Pound"/><contractDataSource dynamicValue="SAP"/><contractEffectiveDate>2007-01-01</contractEffectiveDate><contractExpirationDate>2007-12-31</contractExpirationDate><contractIdentifier>ADBBF61C-8188-4614-B38E-C66853BD18DF</contractIdentifier><contractIncludeLaborIndicator>1</contractIncludeLaborIndicator><contractIncludeLaborIndicatorForOther>0</contractIncludeLaborIndicatorForOther><contractIncludeMaterialIndicator>1</contractIncludeMaterialIndicator><contractIncludeMaterialIndicatorForOther>0</contractIncludeMaterialIndicatorForOther><contractLaborDuration>0</contractLaborDuration><contractLastRenewalDate>2007-11-01</contractLastRenewalDate><contractMaterialDuration>0</contractMaterialDuration><contractNotificationDate>2007-11-01</contractNotificationDate><contractNumber>0049900189</contractNumber><contractReconciliationStatus staticValue="Reconciled"/><contractStartDate>2007-01-01</contractStartDate><contractStatus staticValue="Active"/><Customer><customerIdentifier>FE3CCEBC-6F64-4849-95D5-0B3B84C204D6</customerIdentifier></Customer><contractBusinessUnit dynamicValue="UK"><businessUnitDescription>United Kingdom</businessUnitDescription></contractBusinessUnit></Contract></Contracts></ns1:XMLString>
      </ns1:PutXMLDocument>
    Thanks in advance for the help.
    Thanks
    Sri

    Hi,
    Check this Blog-
    /people/michal.krawczyk2/blog/2005/11/01/xi-xml-node-into-a-string-with-graphical-mapping
    Hope this helps,
    Regards,
    Moorthy

  • XML Payload to Transaction Input

    Hi,
    For clarification, used to be (and still appears to be) that for transaction input properties, data type needed to be 'simple' (ie: string etc), and although we can have transaction input properties of type XML, they still appear in the WSDL as string.  Although I can see that this works fine even if the string content is actually XML, and the inbound data (which in fact is XML as a string) still looks like XML in the transaction, is this still the recommended approach?  Or is there another recommended way to get an XML payload passed in to a transaction using Runner / SOAPRunner from an external application.
    Additionally, when calling the Runner (or SOAPRunner) from an external application, is there then any limit to the length of the URI call?  I know that browsers have limits on the path, but here we're playing with a path + query string outside of browsers? 
    Are there any limitations on the Netweaver side?
    By the way, currently using MII V12.2.2
    Regards
    Kevin.

    Hi Kevin,
    You can pass XML as string to a transaction and make input parameter as XML in transaction.
    That is perfectly fine.
    As far as I know about the limit of URL, It depends on the server.
    However there are two methods to call a http webservice. GET and POST.
    Use the POST method which is having more limit than GET method. I have faced issue with GET on high volume of data so replaced it with POST method. I have used the url with query parameters of a few MB's (approx 4-5) and never faced the limit issue with POST. You can check exact limit with some load testing on the server.
    Thanks
    Anshul

  • Invalid request when calling REST-webservice with UTL_HTTP.

    Hello,
    When i try to send some data to a REST-webservice i get as response "INVALID REQUEST"
    I Think it is about the request-body that seems to be no UTF-8.
    I tried to set the characterset with utl_http.set_body_charset(t_http_req, 'UTF-8').
    But when i read the characterset with utl_http.get_body_charset(t_charset);, is still get "ISO-8859-1"
    I am using: Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
    Some help would realy be appreciated because i am out of options trying to get the code working..
    ======MY CODE==========
    create or replace procedure ipm40_send_bekendmaking(p_bdmg_id in number)
    as
    r_bekendmaking ipm40_bekendmakingen%rowtype;
    r_gemeente ipm40_gemeenten%rowtype;
    l_url httpuritype;
    t_http_req utl_http.req;
    t_http_resp utl_http.resp;
    t_request_body varchar2(32767);
    t_respond varchar2(32767);
    -- t_teller integer := 1;
    -- t_output varchar2(2000);
    t_start number := 1;
    t_body_lengte number;
    t_chunkdata varchar2(4000);
    t_tijd_1 varchar2(256);
    t_tijd_2 varchar2(256);
    t_timeout integer;
    t_length number;
    t_charset varchar2(256);
    begin
    select *
    into r_bekendmaking
    from ipm40_bekendmakingen
    where id = p_bdmg_id;
    select *
    into r_gemeente
    from ipm40_gemeenten
    where gmte_code = r_bekendmaking.gmte_code;
    l_url := httpuritype.createuri('http://zwolle.stadsbeheer.com:82/apex/ipm40bekendmaking?p_bdmg_id='||r_bekendmaking.id);
    t_request_body := l_url.getClob();
    /* request that exceptions are raised for error Status Codes */
    --Utl_Http.Set_Response_Error_Check ( enable => true );
    /* allow testing for exceptions like Utl_Http.Http_Server_Error */
    --Utl_Http.Set_Detailed_Excp_Support ( enable => true );
    utl_http.set_transfer_timeout(300);
    t_http_req:= utl_http.begin_request( r_gemeente.url_webservice_bekendmakingen
    , 'POST'
    , 'HTTP/1.1');
    utl_http.set_body_charset(t_http_req, 'UTF-8');
    utl_http.get_body_charset(t_charset);
    utl_http.set_authentication(t_http_req,r_gemeente.user_webservice_bekendmakingen,r_gemeente.pw_webservice_bekendmakingen);
    t_length := length(t_request_body);
    utl_http.set_header(t_http_req, 'Content-Type', 'application/xml charset=UTF-8');
    utl_http.set_header(t_http_req, 'Content-Length', t_length);
    utl_http.set_header(t_http_req, 'Transfer-Encoding', 'chunked' ); --
    t_body_lengte := dbms_lob.getlength(t_request_body);
    loop
    t_chunkdata := dbms_lob.substr(t_request_body, 2000, t_start);
    utl_http.write_text ( t_http_req, t_chunkdata );
    t_start := t_start + 2000;
    if t_start > t_body_lengte
    then
    exit;
    end if;
    end loop;
    t_http_resp:= utl_http.get_response(t_http_req);
    utl_http.read_text(t_http_resp, t_respond);
    utl_http.end_response(t_http_resp);
    if instr(t_respond,'Successfully document processed') != 0
    then
    update ipm40_bekendmakingen
    set ind_status = 'S'
    , datum_verzonden = sysdate
    , response = t_respond
    where id = r_bekendmaking.id;
    else
    update ipm40_bekendmakingen
    set ind_status = 'F'
    , datum_verzonden = null
    , response = t_respond
    where id = r_bekendmaking.id ;
    end if;
    commit;
    exception
    when others
    then
    t_tijd_2 := to_char(sysdate,'HH24:MI:SS');
    t_respond := substr(sqlerrm,1,2000);
    update ipm40_bekendmakingen
    set ind_status = 'F'
    , datum_verzonden = null
    , response = t_respond
    where id = r_bekendmaking.id ;
    commit;
    end;
    ===THE RESPOND=============
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <HTML><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
    <TITLE>ERROR: The requested URL could not be retrieved</TITLE>
    <STYLE type="text/css"><!--BODY{background-color:#ffffff;font-family:verdana,sans-serif}PRE{font-family:sans-serif}--></STYLE>
    </HEAD><BODY>
    <H1>ERROR</H1>
    <H2>The requested URL could not be retrieved</H2>
    <HR noshade size="1px">
    <P>
    While trying to process the request:
    <PRE>
    POST /pushxml/pushxml-bm HTTP/1.0
    Authorization: Basic Ymtfc21hcnRob2xkaW5nOllyZXMzdlFR
    Content-Type: application/xml charset=UTF-8
    Content-Length: 2096
    Transfer-Encoding: chunked
    Connection: close
    </PRE>
    <P>
    The following error was encountered:
    <UL>
    <LI>
    <STRONG>
    Invalid Request
    </STRONG>
    </UL>
    <P>
    Some aspect of the HTTP Request is invalid. Possible problems:
    <UL>
    <LI>Missing or unknown request method
    <LI>Missing URL
    <LI>Missing HTTP Identifier (HTTP/1.0)
    <LI>Request is too large
    <LI>Content-Length missing for POST or PUT requests
    <LI>Illegal character in hostname; underscores are not allowed
    </UL>
    <P>Your cache administrator is [email protected].
    <BR clear="all">
    <HR noshade size="1px">
    <ADDRESS>
    Generated Fri, 12 Aug 2011 17:33:24 GMT by asd2cc001.asp4all.nl (squid)
    </ADDRESS>
    </BODY></HTML>

    Always check the access_log and error_log files of the Apache web server in such a case. This will identify whether the error comes from Apache itself, mod_plsql, the Apex run-time engine, or the Oracle database.
    I see that you're creating a HTTP/1.1 in PL/SQL - however, the web server response indicates a HTTP/1.0 call was received. Unusual. And could be part of the problem.

  • Restful webservice Internal Server Error PUT POST DELETE

    Hi ,
    When I make a RESTful webservice on the Oracle Cloud with a PUT,POST or DELETE method, the test results is always the same error: "500 - Internal Server Error".
    The GET method causes no problems and gives me the value in JSON format.
    Can anyone help me because I can't find an Oracle example with one of these methods?

    Java Cloud Service does support RESTful WebServices based on JAX-RS 1.1 specification & Jersey 1.9 implementation.
    Please follow the documentation for http://docs.oracle.com/cd/E23943_01/web.1111/e13734/rest.htm#CHDCGFCH (Section Using the Jersey JAX-RS Reference Implementation)
    The required Jersey 1.9 shared library is pre-deployed in all the Java Cloud Service instances , you only need to add the reference of this shared lib in your weblogic.xml.
    The following example shows how to update the weblogic.xml file to use the Jersey JAX-RS RI Version 1.9.
    <library-ref>
    <library-name>jax-rs</library-name>
    <specification-version>1.1</specification-version>
    <implementation-version>1.9</implementation-version>
    <exact-match>false</exact-match>
    </library-ref>

  • Create Document in RESTful webservice

    Hi,
    Anyone help me in java code
    how to create a webi document using restful webservice?
    My Code:
    HttpPost httpRequest_create_doc = new HttpPost( "http://localhost:6405/biprws/raylight/v1/documents");
      httpRequest_create_doc.setHeader("Accept","application/xml");
      httpRequest_create_doc.setHeader("Content-Type","application/xml");
      httpRequest_create_doc.setHeader("X-SAP-LogonToken", sLogonToken);
    I am getting this response
    HTTP/1.1 400 Bad Request [Server: Apache-Coyote/1.1, Date: Thu, 25 Sep 2014 12:12:19 GMT, Content-Type: application/xml, Content-Length: 135, Connection: close]
    Regards,
    kavitha S

    Hi Bhushan,
    Thanks for your information.I have added body.i am getting same response as
    HTTP/1.1 400 Bad Request .
    Help me if i done any wrong in my coding.
    String docname="Sampledocument.xml";
    String folder_id="1001";
    String create_doc = "<documents><name>"+docname+"</name><folderId>"+folder_id+"</folderId></documents>";
    HttpPost httpRequest_create_doc = new HttpPost( "http://localhost:6405/biprws/raylight/v1/documents");
      httpRequest_create_doc.setHeader("Accept","application/xml");
      httpRequest_create_doc.setHeader("Content-Type","application/xml");
      httpRequest_create_doc.setHeader("X-SAP-LogonToken", sLogonToken);
      httpRequest_create_doc.setEntity(new StringEntity(create_doc));
    HttpClient httpclient = new DefaultHttpClient();
    HttpResponse httpResponse= httpclient.execute(httpRequest_create_doc);
    Regards,
    kavitha S

  • How to pass XML payload to HTTP POST Service.

    Hi All,
    I am calling a RestFul service using Http Post method.
    If the payload type is "url-encoded" then my directly assignment of values using assign activity is working fine.
    But when i change the payload type to "xml" , It's erroring out saying the value is not provided for the parameters..
    You can also try this using below details to reproduce the issue.
    Details:
    =====
    URL : http://api.geonames.org/postalCodeSearch
    Used HttpBinding as reference in composite.
    XSD :
    <?xml version= '1.0' encoding= 'UTF-8' ?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.example.org" targetNamespace="http://www.example.org"
    elementFormDefault="qualified">
    <xsd:element name="geonames">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="totalResultsCount" type="xsd:integer"/>
    <xsd:element name="code" maxOccurs="unbounded">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="postalcode" type="xsd:string"/>
    <xsd:element name="name" type="xsd:string"/>
    <xsd:element name="countryCode" type="xsd:string"/>
    <xsd:element name="lat" type="xsd:float"/>
    <xsd:element name="lng" type="xsd:float"/>
    <xsd:element name="adminCode1" type="xsd:string"/>
    <xsd:element name="adminName1" type="xsd:string"/>
    <xsd:element name="adminCode2" type="xsd:integer"/>
    <xsd:element name="adminName2" type="xsd:string"/>
    <xsd:element name="adminCode3" type="xsd:integer"/>
    <xsd:element name="adminName3" type="xsd:string"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    <xsd:element name="Input">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="postalcode" type="xsd:string"/>
    <xsd:element name="username" type="xsd:string"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>
    We need to send following input values to the service.
    postalcode = 90110
    username =siddhardha
    Can someone let me know how to make it work with XML payload.Looks like i am not constructing the XML payload correctly in assign.
    Please send me the sample to [email protected].
    Thanks in advance,
    Siddhardha.

    Sid,
    I am still trying the same, here we need to change the input type to mimeXml
    have a look at this link....
    https://blogs.oracle.com/reynolds/entry/oracle_http_adapter
    I am trying multiple ways, everytime i get the same below error...
    <messages>
    <Invoke1_Request-Response_InputVariable_2>
    <part name="Input">
    <Input>
    <postalcode>90110</postalcode>
    <username>siddhardha</username>
    </Input>
    </part>
    </Invoke1_Request-Response_InputVariable_2>
    <Invoke1_Request-Response_OutputVariable>
    <part name="geonames">
    <geonames>
    <status message="Please add a username to each call in order for geonames to be able to identify the calling application and count the credits usage." value="10"/>
    </geonames>
    </part>
    </Invoke1_Request-Response_OutputVariable>
    </messages>
    Thanks,
    N

  • Soap xml payload

    hi iam working on soap to rfc and i am using sap soap test client.
    can any one send me the xml payload to test the sap test client using the data .
    tahnks and regards
    viju

    vijendar ,
    r u telling that u need some sample WSDL file to test ur soap client??
    if so here is one WSDL....
      <?xml version="1.0" encoding="UTF-8" ?>
    <wsdl:definitions targetNamespace="http://webservices.imacination.com/distance/Distance.jws" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:intf="http://webservices.imacination.com/distance/Distance.jws" xmlns:impl="http://webservices.imacination.com/distance/Distance.jws">
    <wsdl:message name="getLongitudeResponse">
      <wsdl:part name="getLongitudeReturn" type="xsd:double" />
      </wsdl:message>
    <wsdl:message name="getLongitudeRequest">
      <wsdl:part name="zip" type="xsd:string" />
      </wsdl:message>
    <wsdl:message name="getLatitudeRequest">
      <wsdl:part name="zip" type="xsd:string" />
      </wsdl:message>
    <wsdl:message name="getLatitudeResponse">
      <wsdl:part name="getLatitudeReturn" type="xsd:double" />
      </wsdl:message>
    <wsdl:message name="getCityResponse">
      <wsdl:part name="getCityReturn" type="xsd:string" />
      </wsdl:message>
    <wsdl:message name="getCityRequest">
      <wsdl:part name="zip" type="xsd:string" />
      </wsdl:message>
    <wsdl:message name="getLocationResponse">
      <wsdl:part name="getLocationReturn" type="xsd:string" />
      </wsdl:message>
    <wsdl:message name="getStateResponse">
      <wsdl:part name="getStateReturn" type="xsd:string" />
      </wsdl:message>
    <wsdl:message name="getStateRequest">
      <wsdl:part name="zip" type="xsd:string" />
      </wsdl:message>
    <wsdl:message name="getLocationRequest">
      <wsdl:part name="zip" type="xsd:string" />
      </wsdl:message>
    <wsdl:message name="getDistanceResponse">
      <wsdl:part name="getDistanceReturn" type="xsd:double" />
      </wsdl:message>
    <wsdl:message name="getDistanceRequest">
      <wsdl:part name="fromZip" type="xsd:string" />
      <wsdl:part name="toZip" type="xsd:string" />
      </wsdl:message>
    <wsdl:portType name="Distance">
    <wsdl:operation name="getState" parameterOrder="zip">
      <wsdl:input name="getStateRequest" message="impl:getStateRequest" />
      <wsdl:output name="getStateResponse" message="impl:getStateResponse" />
      </wsdl:operation>
    <wsdl:operation name="getLocation" parameterOrder="zip">
      <wsdl:input name="getLocationRequest" message="impl:getLocationRequest" />
      <wsdl:output name="getLocationResponse" message="impl:getLocationResponse" />
      </wsdl:operation>
    <wsdl:operation name="getCity" parameterOrder="zip">
      <wsdl:input name="getCityRequest" message="impl:getCityRequest" />
      <wsdl:output name="getCityResponse" message="impl:getCityResponse" />
      </wsdl:operation>
    <wsdl:operation name="getDistance" parameterOrder="fromZip toZip">
      <wsdl:input name="getDistanceRequest" message="impl:getDistanceRequest" />
      <wsdl:output name="getDistanceResponse" message="impl:getDistanceResponse" />
      </wsdl:operation>
    <wsdl:operation name="getLatitude" parameterOrder="zip">
      <wsdl:input name="getLatitudeRequest" message="impl:getLatitudeRequest" />
      <wsdl:output name="getLatitudeResponse" message="impl:getLatitudeResponse" />
      </wsdl:operation>
    <wsdl:operation name="getLongitude" parameterOrder="zip">
      <wsdl:input name="getLongitudeRequest" message="impl:getLongitudeRequest" />
      <wsdl:output name="getLongitudeResponse" message="impl:getLongitudeResponse" />
      </wsdl:operation>
      </wsdl:portType>
    <wsdl:binding name="DistanceSoapBinding" type="impl:Distance">
      <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
    <wsdl:operation name="getState">
      <wsdlsoap:operation soapAction="" />
    <wsdl:input name="getStateRequest">
      <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://DefaultNamespace" />
      </wsdl:input>
    <wsdl:output name="getStateResponse">
      <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://webservices.imacination.com/distance/Distance.jws" />
      </wsdl:output>
      </wsdl:operation>
    <wsdl:operation name="getLocation">
      <wsdlsoap:operation soapAction="" />
    <wsdl:input name="getLocationRequest">
      <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://DefaultNamespace" />
      </wsdl:input>
    <wsdl:output name="getLocationResponse">
      <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://webservices.imacination.com/distance/Distance.jws" />
      </wsdl:output>
      </wsdl:operation>
    <wsdl:operation name="getCity">
      <wsdlsoap:operation soapAction="" />
    <wsdl:input name="getCityRequest">
      <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://DefaultNamespace" />
      </wsdl:input>
    <wsdl:output name="getCityResponse">
      <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://webservices.imacination.com/distance/Distance.jws" />
      </wsdl:output>
      </wsdl:operation>
    <wsdl:operation name="getDistance">
      <wsdlsoap:operation soapAction="" />
    <wsdl:input name="getDistanceRequest">
      <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://DefaultNamespace" />
      </wsdl:input>
    <wsdl:output name="getDistanceResponse">
      <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://webservices.imacination.com/distance/Distance.jws" />
      </wsdl:output>
      </wsdl:operation>
    <wsdl:operation name="getLatitude">
      <wsdlsoap:operation soapAction="" />
    <wsdl:input name="getLatitudeRequest">
      <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://DefaultNamespace" />
      </wsdl:input>
    <wsdl:output name="getLatitudeResponse">
      <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://webservices.imacination.com/distance/Distance.jws" />
      </wsdl:output>
      </wsdl:operation>
    <wsdl:operation name="getLongitude">
      <wsdlsoap:operation soapAction="" />
    <wsdl:input name="getLongitudeRequest">
      <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://DefaultNamespace" />
      </wsdl:input>
    <wsdl:output name="getLongitudeResponse">
      <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://webservices.imacination.com/distance/Distance.jws" />
      </wsdl:output>
      </wsdl:operation>
      </wsdl:binding>
    <wsdl:service name="DistanceService">
    <wsdl:port name="Distance" binding="impl:DistanceSoapBinding">
      <wsdlsoap:address location="http://webservices.imacination.com/distance/Distance.jws" />
      </wsdl:port>
      </wsdl:service>
      </wsdl:definitions>
    regards
    BILL

  • OSB: Retrieve non XML Payload from a service that returns status code 500

    Hello,
    I'm using OSB 11g.
    I have a Business Service that invokes a REST based service (AnyXML). The service I'm calling may return a 500 status code and some JSON-encoded information in the response body containing the remote service error information.
    From a Proxy Service, I invoke the Biz Service using a standard Service Call Out. The Call Out works fine if the service doesn't return any error (status code 200).
    The problem starts when the service returns a 500 status error: it seems that there is no way to to get hold of the error information (string) that are in the response body. The $fault variable contains some info, but not the actual payload.
    I have also tried to "resume" the flow (using a resume action) but no luck.
    Is there a way to retrieve a NON-XML payload of a service even if the service returns a 500 status code?
    Thanks
    Luciano

    Hi,
    I have same problem, any idea?
    I created several Proxy Services between SOA (BPEL) and JDE. Proxy Service works correct, but if interface response has an error (fault) from JDE side, we get high level error message from OSB and we lost error information from endpoints. I want to get following error information from response body, which containing the remote service error information.
    e.g. <SOAP-ENV:Fault>:
    <SOAP-ENV:Body>
    <SOAP-ENV:Fault>
    <faultcode>SOAP-ENV:Client</faultcode>
    <faultstring>[ISS.0088.9134] Exception occurred while processing the body of the message</faultstring>
    <faultactor>http://HOST/soap/default</faultactor>
    <detail xmlns:webM="http://www.webMethods.com/2001/10/soap/encoding">
    <webM:exception> </webM:exception>
    </detail>
    </SOAP-ENV:Fault>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    Until now, I solved errorhandling for Proxy Service with single route node, but if I use Proxy Service for “Failover” and OSB connect to Endpoint 2, BPEL-instances with "fault" state get OSB error message and WSG-Response will be lost from $body of messages.--> error-propagation to client is NOT OK.
    Regards,
    Moh

  • Report data ( value ... tag) missing in the Webi report retrieved through RestFul Webservice

    I am trying the below URL to get the WEBi report from SAP BO using the Rest Webservice support that is now available.
    http://{serverIP:serverPort}/biprws/raylight/v1/documents/{documentId}
    I am able to get the report but as I compare the same report response when using SAOP Webservice, there seems to be a mismatch in the response. Here is what I see in the SOAP response:
    </td><td c="1" ><cell  ref="1.E.4t" bid="14" h="26" w="231" pad="6,7" sid="-10"><ct >Some arbitrary value</ct><value type="xs:string">Some arbitrary value</value></cell>
    But when I run it through REST, I am missing the <value ..> tag:
    </td><td c="1" ><cell  ref="1.E.4t" bid="14" h="26" w="231" pad="6,7" bt="1" sid="-10"><ct >Some arbitrary value</ct></cell>
    Apart from this right at the start of the xml response, I see some property mismatch as well.
    SOAP has this property extra:
    <property name="output.format.xml.valuemode">yes</property>
    While REST has these property extra:
    <property name="output.format.xml.option.style">1</property>
    <property name="output.format.xml.styledict.fontplatform">html</property>
    <property name="output.format.xml.td.bandinfo">yes</property>
    <property name="source.selected">data</property>
    <property name="xelement.xml.object">yes</property>
    <property name="xelement.xml.object.usemap">yes</property>
    <property name="xelement.xml.object.usersupportedformat">image/png</property>
    I am not sure if:
    the <value ...> tag miss is because of these missing/extra properties or
    current REST support has some issues
    For my application the value tag is a must and I can't do without this, but with REST it seems no way to obtain that.
    Any help or pointer(s) in this regard is appreciated!

    Hello Milind,
    According to our Product Owner Sam Polichouk, the solution should be available for you in 4.1 SP3, which is currently scheduled for release by the end of March 2014 (subject to change).  The product team recommends that you get the raw, unformatted data values from within the Dataset specific call.  This data contains a type to tell the end user what kind of data it is, so you can format it or use it properly.
    The updated documentation for the SDK will be available at SAP BusinessObjects Business Intelligence platform 4.1 – SAP Help Portal Page once the Support Pack is publicly released.

  • Making a REST webservice call. Error code: 401 Access to the requested resource is not allowed

    Hi All,
    I’m having a hard time figuring out how to make Rest WebService calls.
    I tried executing this directly through browser and I get an error.
    http:localhost:8080/rest/bean/atg/userprofiling/ProfileServices/loginUser?arg1=[email protected]&arg2=Password
    13:18:20,613 ERROR [RestSecurityServlet] Error code: 401
    Access to the requested resource is not allowed: /atg/userprofiling/ProfileServices
    atg.rest.RestException: Access to the requested resource is not allowed: /atg/userprofiling/ProfileServices
    at atg.rest.processor.RestSecurityProcessor.checkAccess(RestSecurityProcessor.java:546)
    at atg.rest.processor.RestSecurityProcessor.handleGetRequest(RestSecurityProcessor.java:313)
    at atg.rest.processor.RestSecurityProcessor.doRESTGet(RestSecurityProcessor.java:199)
    at atg.rest.servlet.RestPipelineServlet.serviceRESTRequest(RestPipelineServlet.java:417)
    at atg.rest.servlet.RestPipelineServlet.service(RestPipelineServlet.java:260)
    at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:157)
    at atg.servlet.pipeline.PipelineableServletImpl.service(PipelineableServletImpl.java:320)
    at atg.rest.servlet.RestPipelineServlet.service(RestPipelineServlet.java:264)
    at atg.rest.servlet.HeadRestServlet.service(HeadRestServlet.java:130)
    at atg.servlet.pipeline.PipelineableServletImpl.service(PipelineableServletImpl.java:267)
    From the documentation I understand that I need to create a session, is the session only necessary to access secured components since this
    particular method “ProfileServices.loginUser “ has been declared as not secure in restSecurityConfiguration.xml
    Also, are there two different ways in which I can log in
    1.       Using RestSession.createSession providing the username and password.
    2.       Or using ProfileServices.loginUser or ProfileFormHandler
      Can someone please clarify

    If you are invoking the REST web-service from a Java client then you can create a RestSession object using the createSession method. But in your case you seem to be invoking it with a HTTP request which by default would be treated as a GET request by ATG's REST implementation. Therefore being a GET, it would try to fetch a property "loginUser" from /atg/userprofiling/ProfileServices component (based on your URL) which would always fail.
    To invoke loginUser() method of ProfileServices with your passed argument you need to tell ATG's REST system to treat your incoming request not as GET but as a POST request which you can do using  atg-rest-http-method control parameter in your request like this
    http:localhost:8080/rest/bean/atg/userprofiling/ProfileServices/loginUser?arg1=[email protected]&arg2=Password&atg-rest-http-method=POST
    It should work this way provided your restSecurityConfiguration.xml is proper.

  • Brief explaination of REST,Webservices,CSON and JSON

    brief explaination of REST,Webservices,CSON and JSON

    http://www.simplecodestuffs.com/what-is-the-difference-between-http-and-rest-and-soap-in-web-services/
    SOAP uses WSDL for communication between consumer and provider, whereas REST just uses XML or JSON to send and receive data
    WSDL Defines contract between client and service and is static by its nature. In case of REST contract is somewhat complicated and is defined by HTTP, URI, Media Formats and Application Specific Coordination
    Protocol. It’s highly dynamic unlike WSDL.
    SOAP doesn’t return human readable result, while REST result is readable with is just plain XML or JSON
    This is not true. Plain XML or JSON are not RESTful at all. None of them define any controls(i.e. links and link relations, method information, encoding information etc…) which is against REST as far as messages must be self contained and coordinate interaction
    between agent/client and service.
    With links + semantic link relations clients should be able to determine what is next interaction step and follow these links and continue communication with service.
    It is not necessary that messages be human readable, it’s possible to use cryptic format and build perfectly valid REST applications. It doesn’t matter whether message is human readable or not.
    Thus, plain XML(application/xml) or JSON(application/json) are not sufficient formats for building REST applications. It’s always reasonable to use subset of these generic media types which have strong semantic meaning and offer enough control information(links
    etc…) to coordinate interactions between client and server.
    REST is over only HTTP. HTTP is most widely used and when we talk about REST web services we just assume HTTP. HTTP defines interface with it’s methods(GET, POST, PUT, DELETE, PATCH etc) and various headers
    which can be used uniformly for interacting with resources. This uniformity can be achieved with other protocols as well.
    REST permits many different data formats where as SOAP only permits XML.
    While this may seem like it adds complexity to REST because you need to handle multiple formats, in my experience it has actually been quite beneficial. JSON usually is a better fit for data and parses much faster. REST allows better support for browser clients
    due to it’€™s support for JSON.
    If this helped you resolve your issue, please mark it Answered

Maybe you are looking for

  • Creation of reservation

    Hi guru When I am creating a reservation through TC MB21, it picks up the GL code assigned to the material but the commitment item is not changing but remains the same as is in the first line item. Kindly suggest what additional changes needs to be d

  • Why does photoshop cs6 show two camera raw plugins?

    I'm running CS6 on a Mac Pro 1,1 version 10.6.8. I installed the most recent update from adobe (8.4). I did the full install and apparently it's only meant for version 10.7 and higher, but my CS6 still works. I did remove that camera raw file and ins

  • Import files, sub folders Into Azure Storage

    Hi, Since Azure storage can have containers and blobs within those containers, I like to understand how Microsoft will upload the files / folders to Azure Storage if I start an import job. The situation is, I have a main folder say "c-amazingelephant

  • XML/XSQL Usage

    Hi Can anybody guide me how to install and use XML parsers along with sample code running on Oracle 8i ? Also installed is IIS 4.0, Oracle JDeveloper Suite, and Web-DB. What is the steps to follow and different tools that i will need to fetch data fr

  • Color mismatch between Lightroom when edits done in Photoshop

    I am having a lot of problems since I upgraded to Photoshop 5 and Lightroom 3.  When I go to edit a particular photo in Photoshop from LIghtroom the photo changes once I have saved it back into Lightroom (despite making no alterations whatsoever in P