Example, How to run WebServices from C#, the easy way

Hi,
Anyone who visited the ByD PDI workshops may remember the WebService examples with SoapUI.
Additionally, I want to explain another way of testing WebServices for ByD, which is IMHO way more easy
and closer to reality.
First of all, you need access to a ByD Studio and be able to create Solutions in there.
Second, if you don't have a Visual Studio C# 2010 installed already, go to Microsoft's homepage and grab a free Express version there. Of course, you also have to install it
For this example, I assume, that you want to do a 'Read' on a specific instance of your own BO.
In this case, we call our BO MasterDataWanneBe .
Quick guide for creating a WebService 'Read'
1.  Create new WebService
1.1.     Name: ReadAll
1.1.a.  Namespace -> your soltion's namespace
1.1.b.  Business object
1.2.  Business Object View Name
1.2.a.  Name = ReadAll
1.2.b.  Select all Nodes + subnodes
1.3.  Create u201AReadu2018 Service Operation
1.3.a.  Name = Read
1.3.b.  Select all nodes + subnodes
2.  Activate WS
3.  Create WS authentication file (.wsauth)
4.  Add WS to authentication
5.  Activate WSAuth (will create a view in background)
6.  Assign created WS View + WS Workcenter
7.  Authorize your user for this WorkCenter + View (in ByD, User Management)
8.  Download WSDL, to for example: c:\ZAYQSY0Y_ReadAll.wsdl
Now you have a valid WSDL, pointing your solution and we go next to the more interesting part.
1. Start Visual Studio
2. Create a new Solution, Type = C# Console Application; project name = BydTest
3. Within the project explorer, right click on References, choose 'add service reference'
4. Click 'advanced' (bottom left)
5. Click 'Web reference' (bottom left)
6. Enter the downloaded WSDL file as URL, example: c:\ZAYQSY0Y_ReadAll.wsdl
7. It may happen, that there will be a security warning, just ignore it and the WSDL source should be displayed
8. Type in name 'ReadAll' as reference name
9. Press OK (the service 'ReadAll' will appear in the web reference list, within project explorer)
10. Type in the following C# code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BydTest.ReadAll;
using System.Net;
namespace BydTest
    class Program
        static void Main(string[] args)
            new Program().run();
        private void run()
            BydTest.ReadAll.service service = new BydTest.ReadAll.service();
            service.Credentials = new SuperSecretCredentials();
            MasterDataWanneBeReadAllByIDQueryMessage_sync request = new MasterDataWanneBeReadAllByIDQueryMessage_sync();
            request.MasterDataWanneBe = new MasterDataWanneBeReadAllByIDQuery();
            request.MasterDataWanneBe.ID = "MYTESTID"; // assuming, one instance with this ID exists!
            MasterDataWanneBeReadAllByIDResponseMessage_sync response;
            response = service.Read(request);
            if (response.Log.Item != null) foreach (BydTest.ReadAll.LogItem log in response.Log.Item)
                Console.WriteLine("Log: " + log.Note);
            Console.WriteLine("-------------------------------------------------------");
            if (response.MasterDataWanneBe != null)
                // This BO has to elements: 'ID' and 'RunStartDate'
                Console.WriteLine("My BO's ID:" + response.MasterDataWanneBe.ID);
                Console.WriteLine("My BO's StartDate:" + response.MasterDataWanneBe.RunStartDate.ToString());
    class SuperSecretCredentials : ICredentials
        public NetworkCredential GetCredential(Uri uri, string authType)
            return new NetworkCredential("myuser", "mypassword");
Example output, when selected ID was wrong:
Log: No instance found for specified key
Example output, when ID there is an existing BO instance with given ID:
My BO's ID:E5F42697_MKIRST
My BO's StartDate:18.05.2011 13:18:08
To my experience, this way is rock solid and I've never had any problems.
The two major pitfalls are:
Problem: System.Net.WebException,  Message=Fehler bei der Anforderung mit HTTP-Status 401: Unauthorized
Solution: Check, if you're using the correct user ID. Most likely you're using an user alias and not the real user ID (generated IDs are most often longer than the shorter aliases)
Problem: SRT, RBAM authorization denied
Solution: Check if WorkCenter and WebService (Dummy-)View are assigned to your user. Sometimes it helps, re-activate your complete solution within ByD Studio AND/OR right click on your solution (ByD Studio) and choose 'Update Authorizations and Access Rights'

Really good! Thanks for sharing this!

Similar Messages

  • Switching Computers: How Do I Transfer My Library The Easy Way?

    There are several parts to this question. So I'll try to be as clear as possible. Here's the story, I bought a new laptop over 1 year ago but I'm not able to transfer my library as it is exactly on the old one. So now I think it's high time I switched but I'd like to know if it is possible to:
    - Sync my iPod to the new computer and have playlist and all appear the same as the old computer (I tried this but it'll only sync back music I purchased from iTunes not my earlier stuff)? Or
    - Is there a way that I could copy the saved ".itl" file from my current iTunes music folder into the new one and copy my iTunes files physically to the new folder via an external drive and have my PLAYLISTS STAY the same? Or
    - Is there some other way that I can do this that I'm not thinking of?
    My Library is a mess and my PLAYLISTs keep everything organized for me. I'll probably cry if I have to physically recreate them in the new computer because it's going to take YEARS. Besides, it means that everytime I change computers I'll have to go through the same thing over again.
    I don't know if you can tell how much this means to me but I have a computer that's still brand new (and 4x more powerful than my current one) for over a year now just because I can't get my iLife in order.
    SP PLEASE ANY AND ALL HELPFUL INFORMATION WILL BE GREATLY APPRECIATED.
    Ps. I have iPod Classic 5 and latest iTunes 7.??
    *The__MAN (my apologies for being so wordy)

    Digging around a little more, I found this http://docs.info.apple.com/article.html?artnum=300173 and I think I'll answer my question.
    Thanks for looking,
    The__MAN out! (God I hope it works).

  • How to make a simple package the easy way

    i want to make a very simple package that can be installed with pacman.
    i just want to copy a few files from the package to the /usr directory.
    i read the wiki on this but it seems pretty "overkill" for the thing i want to do.
    perhaps someone can give me a little hint how this can be done...

    It's not overkill - that's about all I can say.
    If it doesn't depend on anything and is hugely simple the it can be very short e.g.:
    # Contributor: dibblethewrecker <dibblethewrecker.at.jiwe.org>
    pkgname=ibmonitor
    pkgver=1.3
    pkgrel=1
    pkgdesc="Interactive linux console application which shows bandwidth consumed and total data transferred on all interfaces."
    url="http://ibmonitor.sourceforge.net/"
    license=""
    depends=('perl')
    source=(http://dl.sourceforge.net/sourceforge/ibmonitor/$pkgname-$pkgver.tar.gz)
    md5sums=('6f37ee0b00b62822823cdbabc9d7419e')
    build() {
    cd $startdir/src/$pkgname
    install -D -m755 ibmonitor $startdir/pkg/usr/bin/ibmonitor
    That is a "perfect" PKGBUILD, it doesn't get much simpler than that

  • How to Run scenario from the web using HTTP web page?

    Hi guys
    Please let me know How to Run scenario from the web using HTTP web page?
    Regards
    Janakiram

    Hi Janakiram,
    ODI provides web based UI for running the scenarios using Metadata Navigator (read only of ur ODI components) and Lighweight designer (u can edit the mapping here).
    Please explore how to install metadata navigator in ODI and have a look at ODI Setup document for more information.
    Thanks,
    Guru

  • How to run report from context menu using XML Extensions?

    I have found an example how to run SQL command from context menu:
    <items>
    <folder type="TABLE">
    <name>UserDefined ContextMenus</name>
    <item TYPE="TABLE" reloadparent="true">
    <title>Create SYNONYM</title>
    <prompt type="check">
    <label>PUBLIC</label>
    <value>PUBLIC</value>
    </prompt>
    <prompt>
    <label>NEW SYNONYM NAME</label>
    </prompt>
    <sql>
    <![CDATA[CREATE #0# SYNONYM  #1# for "#OBJECT_OWNER#"."#OBJECT_NAME#"]]>
    </sql>
    <help>
    This action create a SYNONYM (optionally public) for the selected table.</help>
    <confirmation>
    <title>Confirmation</title>
    <prompt>SYNONYM "#1#" for "#OBJECT_NAME#" has been created.</prompt>
    </confirmation>
    </item>
    </folder>
    </items>
    </prompt>
    But instead of executing SQL command I need to show result page of report based on SELECT statement.

    Hi dz_r-
    Not sure exactly what you mean by "result page of report", but extensive documentation on the xml schema defining context menu actions is available at the schema location.
    &lt;items xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://xmlns.oracle.com/sqldeveloper/3_1/dialogs"
      xmlns="http://xmlns.oracle.com/sqldeveloper/3_1/dialogs">
        &lt;!-- your declarations here -->
    &lt;/items>
    Brian Jeffries
    SQL Developer Team

  • How to run report from form using run_object_report

    I AM USNING FORMS9I/REPORTS 9I , HOW TO RUN REPORT FROM FROM USING RUN_REPORT_OBJECT AND HOW
    TO PASS PARAMETER AS WE DID IN RUN_REPORTS PLEASE HELP ME

    here an example !
    I hope this example you can use it
    PROCEDURE pr_reporte IS
    BEGIN
    DECLARE
         repid REPORT_OBJECT;
    v_rep VARCHAR2(100);
    rep_status Varchar2(20);
    d1 DATE;
    d2 DATE;
    BEGIN
         d1 := :GLOBAL.DIA_INI;
         d2 := :GLOBAL.DIA_FIN;
         repid := find_report_object('rep_lab02');
         SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'p_fec_uno='||to_char((add_months(last_day(d1),-1) +1),'DD/MM/YYYY')||' '||
         'p_fec_dos='||to_char(d2,'DD/MM/YYYY'));
         SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESFORMAT,'pdf');
         v_rep := RUN_REPORT_OBJECT(repid);
         rep_status := report_object_status(v_rep);
         WHILE rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED') LOOP
              rep_status := report_object_status(v_rep);
         END LOOP;
         IF rep_status = 'FINISHED' then
              WEB.SHOW_DOCUMENT('/reports/rwservlet/getjobid'||substr(v_rep,instr(v_rep,'_',-1)+1)||'?'||'server=repserver','_blank');
         ELSE
              ventana('E','error reporte no encontrado','S');
         END IF;
    END;
    END;
    The 'rep_lab02' is the name of the report that you give in the node reports
    p_fec_uno and p_fec_dos they are the parameters in the report
    repserver is the name of server created with rwserver
    Greetings

  • How to run expdp from client ?

    Hi All,
    I tried searching google and forums for my issue but to no avail > How to run expdp from client side ....like in my laptop.
    Because currently our PROD database server has no space for expdp dump file. So I want it directed to my laptop which has an extenal USB of 1TB harddisk...via client EXPDP
    import data using impdp command
    Posted on: 08-May-2012 11:36, by user: 841731 -- Relevance: 53% -- Show all results within this thread
    below command is correct or not? if it is not correct could you please send me the correct command. impdp user/pass@databasename schemas=sourceschemaname remap_schema=sourceschemaname:destinationschemaname ...
    System generated Index names different on target database after expdp/impdp
    Posted on: 30-May-2012 11:58, by user: 895124 -- Relevance: 43% -- Show all results within this thread
    After performing expdp/impdp to move data from one database (A) to another (B), the system name generated indexes has different ...
    [ETL] TTS vs expdp/impdp vs ctas (dblink
    Posted on: 08-May-2012 21:10, by user: 869578 -- Relevance: 39% -- Show all results within this thread
    (table : 500 giga, index : 500 giga), how much faster is TTS (transportable tablespace) over expdp/impdp, and over ctas (dblink) ? As you know, the speed of etl depends on the hardware capacity. (io ...
    Oracle Client
    Posted on: 21-Jun-2012 22:47, by user: Sh**** -- Relevance: 32% -- Show all results within this thread
    Hi Guys, Please can you guys elaborate the difference between Oracle Client and Oracle Instant Client. Also, please can you advise from where I can download the Oracle normal ...
    Oracle 10g Client
    Posted on: 05-Jun-2012 10:11, by user: dzm -- Relevance: 26% -- Show all results within this thread
    to search at oracle site and this forum, but i wasn't able to find a link to download the oracle 10g client. I really need especificaly the 10g version. Anybody know the link or another way to download ...
    9i client to access 11g database
    Posted on: 22-Jun-2012 07:31, by user: kkrm333 -- Relevance: 24% -- Show all results within this thread
    Hi, Can i access a 11g database using 9i client? Thanks,
    SQLplus in Oracle Client
    Posted on: 14-Jun-2012 00:36, by user: Tim B. -- Relevance: 24% -- Show all results within this thread
    Hi, I tried to install an 11g oracle client in linux. As I've compared the files with the files when you install using the oracle instant ...
    Re: Information on Oracle Client 11202-1.1.4-6
    Posted on: 05-Jun-2012 03:33, by user: 898763 -- Relevance: 23% -- Show all results within this thread
    Actually thats the client requirement
    Analysing the performance of a single client
    Posted on: 28-Mar-2012 02:05, by user: 880172 -- Relevance: 23% -- Show all results within this thread
    timeouts even on some of the simplest queries. I want to try and get some data about how just this one client is performing and what it’s doing, but everything Google has thrown up so far is orientated around ...
    to make client connection as sys
    Posted on: 12-Jun-2012 22:04, by user: user11221081 -- Relevance: 23% -- Show all results within this thread
    Dear gurus can i connect to my server from my client machine with sysdba without giving sys password i have connected in different ways as sys@abc ...Thanks a lot.

    Though you can initiate the binary from your client side but for the file creation, there is no other way but to store it on the server side. So your best bet would be to get some space free on the server side of yours.
    Aman....

  • How to run two query  in the same preparedStatement

    Hi all,
    Please tell me how to run two queries in the same preparedStatement object ?
    In my module I have to run two queries and I don't want to make two methods for running two different queries.
    I just want to call this method for both of my queries.
    methodName(long param)
    Connection conn=null;
    PreparedStatement pstmt=null;
    //////////////// some coding
    Please Help !
    Thanks in advance
    amitindia

        public void foo()
            Connection connection = null;
            PreparedStatement stmt = null;
            try {
                connection = ...get from pool...;
                stmt = connection.prepareStatement("...");
                ...fetch results...;
                stmt.close();
                stmt = null; // So the finally statement works if there is an exception
                stmt = connection.prepareStatement("...");
                ...fetch results...;
            } finally {
                if (stmt != null) ..close it...;
                if (connection != null) ..return it to pool...;
        }

  • Related documents or links on how to call webservices from WDJ

    Hi all
    i need documents & links on how to call webservices from Webdynpro for Java.
    if anybody send the documents on sample scenarios on the same then it is the great help to me...
    Thanks
    Sunil

    Hi Sunil,
    May these links help you.
    http://help.sap.com/saphelp_nw04/helpdata/en/f7/f289c67c759a41b570890c62a03519/frameset.htm
    http://help.sap.com/saphelp_nwce10/helpdata/en/64/0e0ffd314e44a593ec8b885a753d30/frameset.htm
    http://help.sap.com/saphelp_nw04s/helpdata/en/d2/0357425e060d53e10000000a155106/frameset.htm
    and  the below thread to call weservices in java.
    Re: How to call a web service from Java
    Regards,
    Supraja

  • How to run workflow from Developer studio ?

    Hi Guys,
    I searched for a work item type in the developer studio and it showed the results, but could not find out how to run it from there.. I know we can run it from there.. There is no run button or options available.
    Do i need to setup some profile options ?
    Any help in this is highly appreciated !!
    Thanks,
    Sathish

    Hi,
    Are you logged in as the Workflow Administrator or a user who has been assigned that responsibility?
    Have a look on the Administration tab and it will show you who is configured as the admin.
    HTH,
    Matt
    WorkflowFAQ.com - the ONLY independent resource for Oracle Workflow development
    Alpha review chapters from my book "Developing With Oracle Workflow" are available via my website http://www.workflowfaq.com
    Have you read the blog at http://www.workflowfaq.com/blog ?
    WorkflowFAQ support forum: http://forum.workflowfaq.com

  • How to run notepad from a web application

    hi
    can any body know,how to run notepad from a web application under tomcat

    You already asked this question:
    http://forum.java.sun.com/thread.jspa?threadID=5150005&messageID=9561597
    Obviously running notepad on the clients PC is not possible (ignoring active x)

  • How to run import from Unix Oracle 8.0.5 database with Windows Oracle client?

    How to run import from Unix Oracle 8.0.5 database via network with Windows Oracle client? Is it possible? When I try to do it Oracle client just hangs... If not which ones are compatible Aix or Solaris to Unix or it must be a Unix client to connect to Unix Oracle database. Thank's for any help.

    Hi,
    In our project we are using this type. Since in this project server in UNIX(DEC) and client is running on windows. We have created a listener which always listen requests from client and doing the according to the request.
    Step1. create a request table, where u are inserting ur request.
    step2. create PRO*C proram, which is listening request on the table. If there is any request, call the imp (executable). This is happening on server side.
    Benifit. U can make a request from cleint and ftp the file client sit.
    Are u interested in more details and code, pls send a mail to me
    ---- Boby Jose Thekkanath
    [email protected]
    Dharma Computers(p) Ltd. Bangalore.
    null

  • How to stop mail from recovering the same message over and over again to the extent that it has wiped out all start up disk memory?

    How to stop mail from recovering the same message over and over again to the extent that it has wiped out all start up disk memory?

    You need to find and delete (move to the Trash) the offline mail cache (.offline cache.) It's a hidden folder (files and folders with a preceding dot are hidden) inside the Mail folder (inside IMAP) in your user library. Since it's hidden, in order to see it run the following command in Terminal in Applications>Utilities. Hit return/enter once you have pasted in the command.
    defaults write com.apple.finder AppleShowAllFiles -bool true ; killall Finder
    To reverse this and hide all those hidden files and folders again
    defaults write com.apple.finder AppleShowAllFiles -bool false ; killall Finder
    Leave hidden files/folders enabled until you finish emptying the Trash so you know it's gone.

  • Please help: Example how to peploy application from jar file step by step

    Please help: Example how to peploy application from jar file step by step.
    All help appreciated
    Mike

    Thanks I will try these links
    Mike
    "Slava Imeshev" <[email protected]> wrote:
    Hi Mike,
    These links could be useful:
    http://e-docs.bea.com/wls/docs61////adminguide/appman.html
    http://e-docs.bea.com/wls/docs61////quickstart/quick_start.html
    http://e-docs.bea.com/wls/docs61//////ConsoleHelp/application.html
    http://e-docs.bea.com/wls/docs61///programming/environment.html
    Regards,
    Slava Imeshev
    "Mike" <[email protected]> wrote in message
    news:3ca0e94c$[email protected]..
    Please help: Example how to peploy application from jar file step bystep.
    All help appreciated
    Mike

  • How to run hardware diagnostic with the help of terminal?

    how to run hardware diagnostic with the help of terminal? any cmds

    Macs newer than 10.7's release just need to boot with the 'D' key.  
    Otherwise you need to find the original installer disk of the Mac, or call AppleCare for it to be able to run the hardware diagnostic.

Maybe you are looking for