WebCenter Sites : Consume Web Services and apply templates

Hi,
What is the best approach to consume Web Services or REST Service with Sites?
The idea is to consume some eServices personalized for a connected user and apply different presentation templates for those services to add to Sites pages.
Any Best practices here ?
Regards
Jo

For consuming SOAP services inside a delivery template, there used to be the webservices:invoke tag but it was deprecated in version 7.6, and was generally not recommended to use anyway. There are no new tags for consuming SOAP or REST webservices, customers asking to do that are generally advised to reuse the existing libraries and write their client code in java, for example directly in an element/template or custom tag that you use in elements/templates. For performing simple REST queries you could use ics.ReadPage or httpclient.
Sites (was CS) comes with jars for handling SOAP and REST services, such as saaj, xmlbeans, jaxrpc, and jersey. You can use these, but if you run into bugs or limitations with the provided versions be aware that upgrading these jars may break Sites. And similarly, upgrading Sites may change these jars and so break your client code.
Phil

Similar Messages

  • SQL Server 2008 Reporting Project - Invoke/Consume Web Service and Return Dataset in C# Code-Behind

    Hello,
    I have a Visual Studio 2010 C# class with a method that invokes/consumes a web service and returns an XML dataset. I am traversing through the parent/child nodes and parsing out the data then inserting it into a SQL Server 2008 R2 table for a join within
    another stored procedure. 
    Instead of using a 3rd party API to generate the PDF for this data, I am creating an SSRS report. The formatting will be easier and I can do a RenderFormat directly to PDF.
    Can I expect to be able to transfer the code-behind method to this report and have it be able to work with the web service the same way? It is a SOAP-based web service returning parent nodes and two levels of nested child nodes.
    I have also been researching the approach of calling the web service in the same stored procedure that is currently querying the physical tables (which is used to populate a gridview and PDF) but it looks like it may only be possible with a CLR stored procedure.
    Is it possible to implement a CLR stored procedure within an SSRS report? 
    Hope this makes sense. Any help, suggestion or point in the right direction would be greatly appreciated.
    Thanks,
    Buster

    Hi Buster,
    SSRS supports web service data source, we can call the SOAP-based web service in SSRS report directly. Then, we can use custom code in SSRS to parse the XML data. However, we won’t be able to join another data in SQL Server database.
    Reference:http://technet.microsoft.com/en-us/library/aa964129(v=sql.90).aspx#repservxmlds_topic3
    We cannot implement a CLR stored procedure within an SSRS report directly. In order to execute the CLR store procedure in a SSRS report, we have to execute it as text using the following code:
    Exec <stored procedure name>
    Reference:
    http://dotnetslackers.com/Community/blogs/bmains/archive/2009/01/15/executing-a-clr-stored-procedure-in-reporting-services.aspx
    Hope this helps.
    Regards,
    Alisa Tang
    Alisa Tang
    TechNet Community Support

  • Consuming web service in PI 7.3 and creating file

    Hi,
    I need to consume web service in PI 7.3 and create file from response. I have WSDL for the web service. Now confused about datatype/message type. Is there any document/note to follow?
    thanks,
    7Z

    I need to consume web service in PI 7.3 and create file from response. I have WSDL for the web service. Now confused about datatype/message type. Is there any document/note to follow?
    ==>
    Hi,
    There are 2 ways you can do this :-
    If your sender is a file and receiver is a webservice and you want to map the response back to the file then :-
    Sol 1 :- Async-Sync Bridge using RequesResponse Oneway bean
    Sender File channel ---> Soap Receiver Channel
    Soap Receiver Channel brings the response back to the File Receiver Channel.
    Now this File Receiver Channel should be called inside the Sender File Channel using the above bean.
    Data Type :
    Src - File struc to SOAP request (WSDL used as an external definition)(mapping 1)
    SOAP response(WSDL used as an external definition) to Tgt File Struc (mapping 2)
    Sol 2 :- Async Scenario
    Make a Sender File Channel --> use SOAP lookup channel (pass the request payload through the SOAP receiver channel) --> Map the response back to the File using File Receiver Channel.
    Data Type:
    Src - File struc to Tgt File Struc (mapping 1). Since you are passing the request payload through SOAP lookup in the UDF itself.
    ======================================================================

  • Exposing and Consuming web service using NWDS

    Hi all,
    I want to expose and consume a webservice using NWDS.
    My java application will interact with the SAP web service to create materials in r3.
    I just want to know how to create a EJB project that contains the Web service and deploy on the SAP WAS.
    and from the java application how would I access the same.
    do I need to AXIS jar ?
    How would get The WSDL corrosponding java files ?
    I will be very thank ful if you can provide me with the some study materials also.
    Warm regards

    Hi
    Refer these links
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/media/uuid/60dbd7ac-4788-2910-539b-b3599c64be12
    http://help.sap.com/saphelp_nw04s/helpdata/en/d6/f9bc3d52f39d33e10000000a11405a/frameset.htm
    Regards
    Abhishek

  • How to consume web service in jdev 10.1.3 and OAF 12.1.3

    I have a question regarding consuming web service in jdev 10.1.3. I have a WSDL url and want to generate java stub files from the wsdl. How do I do this using jdev?

    This is now contained in the PageDefinition file.
    1. Right-click on the Data Action, and then select Go to Page Definition
    2. Add an attribute to the <pageDefinition> tag called ControllerClass="MyPackage.ShowInfoAction"
    If you have more than 1 Data Action linked to a PageDefinition, then there is more work required.
    Hope this helps

  • Creating and consuming web service

    Hello Everyone,
    Please help me in creating a webservice which can be consumed in a button in Excel sheet i.e. I have to create a button in Excel sheet and on click of that button i have to consume a web service deployed in AS. Also I have to pass the data in Excel sheet to that web service.
    PS: This is just a business logic no other view or UI is required here.
    Thanks in advance.
    Regards
    Pranav

    Hi Pranav
    >2. I know I can download WSDL files from server using the test page. Downloaded zip file has these three wsdl files Config1_document.wsdl, Config1_TestVi_document.wsdl and main.wsdl. But which wsdl to use while consuming.
    Actually all the .wsdl files are part of single WSDL document which describes your Web service. Starting/root point here is main.wsdl which references two other .wsdl. You can access any time the root WSDL part by URL like
    "http://<host>:<port>/BcfRemoteCheck/Config1?wsdl&style=document&mode=standard".
    Hope you know where to see the WSDL URL (in Webservice Navigator or in Single Service Administration where you downloaded the ZIP).
    When you are consuming web-service you need all the parts. Usually when a Web-service is consumed the remote WSDL is used for generation of WS Client Proxy. But, the WSDL files can be also downloaded and used locally for generation of the WS Client Proxy.
    Sometimes the WSDL is not necessary at all for WS consuming on run-time. In the case it's used only on design-time just to know WS names, ports, operations, etc, for writing the code of WS Client.
    BR, Sergei

  • How to publish and consume web services in WAS 620?

    It appears that Web Service Creation Wizard is only available in WAS 640. We only have WAS 620 installed. Do any of you know what are the steps to publish ABAP function modules as web services, as well as to consume web services?
    Thanks,
    Angela

    Hi Angela,
       If you want to expose function modules as web service, you can generate WSDL by running BSP application 'webservicebrowser'. If you want to consume a web service then it is a bit difficult but possible. Look at sample programs (rsvsoap*).
    Also look at help document http://help.sap.com/saphelp_47x200/helpdata/en/94/f8c8a2e68811d6b2dc00508b5d5211/frameset.htm
    Regards,
    Sanjeev

  • How to connect to external web service and convert XML to a table

    Hi experts,
      I need to connect to external/non-SAP web service and convert XML in that site to a SAP table?
    Is there a function call(SE37) to do this? Is it a must for me to install AS JAVA or PI and configure enterprise service? Please provide a link for me to retrieve relevant infomation, thx.

    No, you don't need PI or the Java stack for this.  You can create an ABAP proxy using the WSDL file for the web service and call the web service using the proxy class in an ABAP program.  You can transform the XML response to internal tables/structures/variables using a transformation template that you create.

  • 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

  • Complete newbie question - Can BI consume web services?

    Post Author: Steve Lamont
    CA Forum: Data Integration
    I am working on a new client site working on integration between a whole slew of systems including CRM, billing, BI etc.  The client is architecting a SOA oriented approach to all integration where it make sense.  As part of the effort, a new BI database is being built and loaded via some ETL tool.  The primary interface to access this new BI data will be business objects (BO).  Now, in the current environments, there are multiple, disparate BI systems containing various data.  The BO knowledge person (and he is not a business object employee) on this site is claiming that to access these other BI databases, he wants to do it by sending out requests via service calls.  I fully understand that BO itself can be set up to be a service provider and provide services for other consumers to take advantage of, but how does BO itself consume services provided by other applications?
    Obviously I don't fully understand BO, but my initial inclination is that this approach is wrong.  If data is required from these other BI source, wouldn't they be configured as data sources within business objects?  This BO guy claims that calling web services is more efficient that direct peer-to-peer calls via the database drivers.
    Can any share some comments on this situation?

    Post Author: bhofmans
    CA Forum: Data Integration
    You posted your question to the wrong forum, please try to post it to one of the subforums in "Enterprise Reporting, Query & Analysis".
    This forum is about Data Integrator, Business Objects ETL tool.
    I'll try to answer your question anyway with my reporting background From what I know, YES we can consume web services in reports (Crystal reports), but for larger volumes of data a direct access to the database would be faster. A webservice approach might make sense if the webservice implements some business logic (semantic layer) which would be easier then to go directly to the tables.
    And just for the record : also Data Integrator can consumer web services...

  • How to integrate deployed Web Services and Portlets

    Hi All,
    I am able to deploy Web Services and Portlets in the Application Server, which is in the network system.Now, I want to know how to integrate the Web Services and Portlets.I dont have any idea about this and i didn't got any good material..
    Please, provide some useful links or material, if anybody has any idea about this.
    Thanks in advance.
    Praphul

    You can consume a Web service from a JSF page for example using the ADF Web service data control:
    http://www.oracle.com/technology/obe/obe11jdev/bulldog/webservices/ws.html
    http://www.oracle.com/technology/obe/obe11jdev/11/wsdc/wsdc.htm
    You can turn these JSF pages into portlets using WebCenter's JSF to Portlet bridge.
    http://www.oracle.com/technology/products/jdev/11/cuecards111/jps_set_62/ccset62_ALL.html

  • Authorization error while consuming web service in SOAP UI

    Hi,
    I am an ABAPer and do not have much knowledge about SOAMANAGER configuration.
    I have created a Web service and configured it using SOAMANAGER. I am trying to consume same web service using SOAP UI.
    But, I am getting an error HTTP-401 unauthorized.
    For authentication, I have selected "Transport level -User ID/Password" checkbox.
    What else, I have to configure, please let me know.
    Error log:
    Login failed
    What happened?
    calling the URL  <URL>.
    The application was running in the system <System> . Here, no credentials were provided.
    What can you do?
    If you still have a user ID , contact your system administrator.
    HTTP 401 - Unauthorized
    Your SAP Internet Communication Framework Team
    Regards,
    Sneha

    Hi Sneha,
    In SOAP UI, after importing WSDL, dig it till Request1, select it and go to Request property.
    Set Below things
    1. Authentication Type = Preemptive
    2. give username
    3 give password
    and send message.
    Regards,
    Mastan
    Message was edited by: mastan vali

  • Authentication error while consuming web service published in SR of CE 7.1

    Hi,
    I am having this error while trying to consume a web service published in local services registry. Authentication level is set as Basic in the web service and in end point. I am receiving this error in security log files.
    Message:Authentication for web service ServicesRegistrySiService, configuration ServicesRegistrySiPort using security policy sap.com/tcesiuddisrws~earServicesRegistrySiServiceServicesRegistrySiPort*ws failed: Login failed.. (See SAP Note 880896 for further info).
    Category: /System/Security/WS/Authentication
    Location: com.sap.engine.services.wssec.authentication.authenticate
    Application: sap.com/tcesiuddisrws~ear
    Thread: HTTP Worker [1]
    Data Source: j2ee\cluster\server0\log\system\security_00.log
    Correlator ID: 33747500000034965
    Argument Objects: 
    Arguments: 
    DSR Component: 
    DSR Transaction: 72b226c009ed11dd9a3e000c29c818ce
    DSR User: 
    Message Code: 
    Session: 4196
    Transaction: 
    User: Guest
    Host: ########
    System: ###
    Instance: J00
    Node: server0
    following is the code in a C# .Net 2.0 from where the service is called.
                CnarService srv = new CnarService();
                NetworkCredential ic = new NetworkCredential("user", "password");
                CredentialCache cache = new CredentialCache();
                srv.UseDefaultCredentials = false;
                srv.PreAuthenticate = true;
                srv.Credentials = ic;
                try
                    srv.Timeout = 600;
                    cnarobject cnObj = srv.GetObject("1");
                    fnameTextBox.Text = cnObj.firstname;
                    lnameTextBox.Text = cnObj.lastname;
                    mnameTextBox.Text = cnObj.middlename;
                catch (WebException wex)
                    MessageBox.Show(wex.Message + wex.Response + wex.StackTrace);
    I tried to find the SAP Note 880896 but note doesn't exists. I am receiving similar error while trying to connect Enterprise Services explorer for .Net
    Please help.
    Regards
    Monty

    Hi,
    maybe you should see the settings for the ServicesRegistrySiService too. Under nwa->SOA.
    I am not sure, but the error seems like not able to use the ServicesRegistrySiPort, which is to be authenticated against.
    It is then used for retrieval of web services and publishing to the registry... i suppose.
    I am not sure though.
    Best regards,
    Vera

  • Consuming Web service in Visual Composer

    Hi All,
    I  have impoerted a z bapi in caf service .I create a web service out of this and try to consume this in Visual Composer .When i do Test data service by right clicking onthe web service and try to execute the web service i get an error saying that , web service could not be executed.
    But if i do the same thing for the standard bapi , i get the results .
    Could any one help me out.
    As well as for some of the webservice (on exposing core services as web services),i try to execute in the wsnavigator ,i get error sayin that ,internal operation not mapped with the external service ,even though i have done the mapping in the caf.

    divya,
    You have to map your web service to the rfc in your destination systems
    goto http://servername:50000/caf
    Choose your Web Service from the External Services list,
    on the right side choose your remote function calls and select the service then click map.
    Regards,
    Ahmed Salah

  • Consuming web service in portal

    Hi all,
    I had a web service now i want to use it in my portal.
    Can anyone help me in this regard.

    Hi Lokesh,
    To consume a Web service, you can create a deployable or a standalone proxy for the Web service in the SAP NetWeaver Developer Studio using a WSDL document as a basis. This can be done with just a few mouse clicks.
    The difference between a deployable and a standalone proxy is that, for a deployable proxy, the application of the Web service client must be deployed on the J2EE engine. A standalone proxy can be executed without the J2EE engine.
    The role of the Web service client developer has been created so that Web services can be consumed.
    The Web service client developer has the task of integrating a Web service in an application. He or she knows the specific requirements for the Web service and creates the Web service client proxy definition. Afterwards, the developer programs the client application using the service endpoint interface.
    Please read through this Step by Step approach for same:-
    [Consume WebServices in Portal|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/c2188ae5-0601-0010-dd93-c23e381ef41e]
    Hope this helps,
    Regards,
    Shailesh

Maybe you are looking for

  • Sending mail automatically on date

    Hi, I am new to JavaMail. I am having a doubt that is there any method in JAVA that automatically send the mail on a particular day. For e-x, if i set the sentDate as tomorrow, it has to send the mail on tomorrow itself, not the day, when i composed

  • Group texts from same contact in Notification Center?

    Is there a way to group together texts from the same contact in the Notification Center?  For example, if I get 3 texts from the same person, they will all appear as 1 notification under Messages on my home screen from that 1 contact instead of 3 dif

  • Which Adobe Flash Player do I need for my Kindle Fire?

    Which Adobe Flash Player di I need for my Kindle Fire?

  • ITunes changes my song titles why???

    When I enter my song titles many times I will add some descriptive word to the title for my own information - only maximum 6 letters . I also include the artists name with the song title.. iTune changes the title sometimes it just enters the song tit

  • HELP ... TROUBLE WITH 4GB NANO

    Hi, I got an ipod nano 4 xmas and has worked fine till recently. It didn't work, and when I tried to reset it (menu+select) it comes up with the apple logo and then it fades out with lots of white, fuzzy lines ... and now, it doesn't even do that any