Skip to Content

Notes: This is thanks to Andreass, Judson and Billy ^^

Objective: The finality of this is to show a way to interact with a Web Service created in By Design Studio and how to consume this web service with an external client. This will be with an object that gets two numbers, then adds them together, and multiply together.

Steps:

  1. Create the BO
  2. Create the script to this BO
  3. Create the screens
  4. Modify the screens (if necessary)
  5. Create the Web Service of this BO
    1. Agregate the new view and assign to a Work Center.
  6. Define the authorizations in ByDesign.
  7. Download WSDL
  8. Test with an external client.

PROCEDURE

1. Create the BO, this has two elements. In Solution Explorer right clic > Agregate > New element > Business Object with name “AddMult”

Code for BO AddMult:

import AP.Common.GDT as apCommonGDT;


     businessobject AddMult {

       [AlternativeKey]element OperationID: ID;

       element Value1 : IntegerValue;

       element Value2 :IntegerValue;

       element Result1 :IntegerValue;

       element Result2 :IntegerValue;

     }

After creation, you must to activate the BO.

2.Create script, for this, right click to the BO and Create ScriptFiles and select “Event-AfterModify.absl”

Use this code:

import ABSL;

this.Result1 = this.Value1 + this.Value2;

this.Result2 = this.Value1 * this.Value2;

Activate the script (right click and Activate)

3. Create the screens for this BO, right click to the BO and select Create Screens > Floorplan with Navigation > OK.

This will create the screens and the work center that we will need.

/wp-content/uploads/2012/08/4_125500.jpg

4. You can modify the screens, in this case QA Screen (Quick Activity), OWL Screen (Object Work List), the elements are in disorder.

     a. For QA select “SectionGroup” and in Properties Tab > Contents > Collection, with the arrows you can give the adecuate order, then OK.

/wp-content/uploads/2012/08/6_125585.jpg


     b.For OWL select “List” in Properties Tab > Child Elements > ListColumns, then if asks if you want to replace the name, select No, then with the arrows you can modify the order, then OK.

/wp-content/uploads/2012/08/7_125586.jpg


     c. Save the screens and Activate.

     d. Assign the authorizations for this user in ByDesign.

          1. You need to enter in your corresponding tenant

          2. In “Application and User Management” Work Center search for the user will have the authorizations.

          3. Select the new work center and its view.

     e. Then you can do operations in the new Work Center “AddMult”

          1. You need to write the OperationID, Value1, Value2 and Save, the script will activate and write the corresponding resuts

          2. You can see the results in ByDesign

5. Create the Web Service from the BO created. Right click to the BO > Create Web Service

     a. Give a name for this web service

     b. Select the elements would be involved in this web service (in this case, all of them)

     c. For the option “Create”, only mark the OperationID, Value1, Value2.

     d. For the option “Read”, mark all of them, so you can see all the fields.

     e. Query and Action not necessary for this example.

     f. Create a new authorized view you will use to add it a to a Work Center, give it a name. (Maybe you can use an existing view)

/wp-content/uploads/2012/08/17_125588.jpg     g. Then you can select the operations for this view.

/wp-content/uploads/2012/08/18_125589.jpg     h. The field “External UI Application” is empty in wsauth.

/wp-content/uploads/2012/08/19_125590.jpg

     i. Open the Work Center in UI Designer (is that called WCF).

     j. In Configuration Explorer you use the created view for this web service, add it to the view.

        (use Test View, there would be two)

/wp-content/uploads/2012/08/20_125594.jpg


     k. Now you can see the view has the name of the Web Service View (maybe you need close and re-open the WCF).

/wp-content/uploads/2012/08/21_125595.jpg

     l. If there is no view where to assign, you can add it in Properties of Work Center > View Switches (Selecting AddMult Folder).

/wp-content/uploads/2012/08/22_125596.jpg

     m. Activate Web Service in Solution Explorer.

     n. Again in By Design you need to assign the view for this User (4.d from this Tutorial).

     o. Download WSDL (Right click to the created web service and Download WSDL)

6. Use the download WSDL to tests.

     a. Open SOAP UI

     b. New soapUI Project

     c. Browse the downloaded WSDL

     d. Now with XML you can do the corresponding calls.

        Use Authentication Type: Preemptive.

        Try with the user and password you assigned in By Design

/wp-content/uploads/2012/08/27_125600.jpg


     e. You can do the calls

          Read (need to use a valid ID, this case, only created operations)

          Create(use all the fields, OperationID, Value1, Value2)

/wp-content/uploads/2012/08/28_125601.jpg


          f. You can see the change in ByDesign

That’s all, any doubts, tell me =)

Angel.

    

To report this post you need to login first.

23 Comments

You must be Logged on to comment or reply to a post.

  1. wenlei Peng

    I done a step by step in accordance with the your method , but finally display the

    following error:

    “Tue Oct 09 23:53:08 CST 2012:INFO:my*****5.sapbydesign.com:443 requires authentication with the realm ‘SAP NetWeaver Application Server [H7M/007][alias]'”.

    Why? How can i fix it ?

    My mail adress is: eric.peng@avatech.com.cn

    (0) 
    1. Charles PAULET

      Hi Eric,

      I have tried to create a web service with Byd too.

      I get the same issue in visual studio 2010.

      “Tue Oct 09 23:53:08 CST 2012:INFO:my*****5.sapbydesign.com:443 requires authentication with the realm ‘SAP NetWeaver Application Server ][alias]'”.

      Did you solve it ?

      Many thanks and best regards

      (0) 
  2. Angel Perez Post author

    With this issue, I would say that you need to check three things:

    1. Step 5.h -> In ByD Studio -> External UI should not be empty…

    2. In the ByDesign page, the user should have assigned the view for the WoC. Step 4.d

    3. The WoC (Step 5.k) should have the view assigned too.

    After that, you should right click the solution and ” Update Authorizations and Access Rights”, and then download again the WSDL …. =)

    (0) 
  3. Mohamed ELBEQQAL

    I tried to use soapui for consuming the service “querycustomerin1” but i have this error message :

    <faultstring xml:lang=”en”>Web service processing error; more details in the web service error log on provider side (UTC timestamp 20130117151106; Transaction ID 00163E0340311EE2989703BE827D06D1)</faultstring>

    And in BYD i have : Combination of interval boundary type code and upper and lower boundaries in not allowed.

    Thanks for your help.

    (0) 
    1. wenlei Peng

      Hi Mohamend,

      I hope this is useful to you!

      Step1:Login corresponding BYD system.

      Step2: In the Application and User Management ->Input and Output Management->Business Communication Monitoring view, show Message-Independent Errors.

      Step3:Click Go button.You can see detailed error messages in the Details label about your web service.

      Regards

      Eric

      (0) 
  4. Mohamed ELBEQQAL

    Hello,

    @ Arnulfo this my code in SoapUi of the web service Querycustomerin1:

    <soapenv:Envelope xmlns:soapenv=”http://schemas.xmlsoap.org/soap/envelope/” xmlns:glob=”http://sap.com/xi/SAPGlobal20/Global“>

       <soapenv:Header/>

       <soapenv:Body>

          <glob:CustomerByIdentificationQuery_sync>

             <!–Optional:–>

             <CustomerSelectionByIdentification>

                <!–Zero or more repetitions:–>

                <SelectionByInternalID>

                   <!–Optional:–>

                   <InclusionExclusionCode>I</InclusionExclusionCode>

                   <!–Optional:–>

                   <IntervalBoundaryTypeCode>1</IntervalBoundaryTypeCode>

                   <!–Optional:–>

                   <UpperBoundaryInternalID>Z0001</UpperBoundaryInternalID>

                </SelectionByInternalID>

             </CustomerSelectionByIdentification>

                <!–Zero or more repetitions:–>

          </glob:CustomerByIdentificationQuery_sync>

       </soapenv:Body>

    </soapenv:Envelope>

    In the right i have as result :

    <soap-env:Envelope xmlns:soap-env=”http://schemas.xmlsoap.org/soap/envelope/“>

       <soap-env:Header/>

       <soap-env:Body>

          <soap-env:Fault>

             <faultcode>soap-env:Server</faultcode>

             <faultstring xml:lang=”en”>Web service processing error; more details in the web service error log on provider side (UTC timestamp 20130118090311; Transaction ID 00163E0340311ED298A9BC4969E51553)</faultstring>

             <detail/>

          </soap-env:Fault>

       </soap-env:Body>

    </soap-env:Envelope>

    In the http log i have after lignes processing this result :

    Fri Jan 18 09:03:11 GMT 2013:DEBUG:<< “HTTP/1.1 500 Internal Server Error[\r][\n]”

    Fri Jan 18 09:03:11 GMT 2013:DEBUG:<< “set-cookie: sap-usercontext=sap-client=085; path=/[\r][\n]”

    Fri Jan 18 09:03:11 GMT 2013:DEBUG:<< “content-type: text/xml; charset=utf-8[\r][\n]”

    Fri Jan 18 09:03:11 GMT 2013:DEBUG:<< “content-length: 436[\r][\n]”

    Fri Jan 18 09:03:11 GMT 2013:DEBUG:<< “accept: text/xml[\r][\n]”

    Fri Jan 18 09:03:11 GMT 2013:DEBUG:<< “sap-srt_id: 20130118/090311/v1.00_final_6.40/00163E0340311ED298A9BC4969E5B553[\r][\n]”

    Fri Jan 18 09:13:54 GMT 2013:DEBUG:>> “Content-Length: 903[\r][\n]”

    Fri Jan 18 09:03:11 GMT 2013:DEBUG:<< “<soap-env:Envelope xmlns:soap-env=”http://schemas.xmlsoap.org/soap/envelope/“><soap-env:Header/><soap-env:Body><soap-env:Fault><faultcode>soap-env:Server</faultcode><faultstring xml:lang=”en”>Web service processing error; more details in the web service error log on provider side (UTC timestamp 20130118090311; Transaction ID 00163E0340311ED298A9BC4969E51553)</faultstring><detail/></soap-env:Fault></soap-env:Body></soap-env:Envelope>”

    @ wenlei in BYD i have this msg error :

    Exception raised by Web Service application  : Combination of interval boundary type code and upper and lower boundaries in not allowed.

    Thanks for your help

    (0) 
    1. wenlei Peng

      Hi Mohamend,

      If there is only one condition , then it can only Lower.

      <UpperBoundaryInternalID>Z0001</UpperBoundaryInternalID>

      =>

      <LowerBoundaryInternalID>Z0001</LowerBoundaryInternalID>

      I hope this is useful to you!

      (0) 
  5. Carlès Totap Timadji

    Hi, I’m new to ByDesign development. I’ve tried to create a web service to access  extended saleorder field that I’ve created. But I can not consume the service from an external client. I get the following error  : Authorization role missing for service ServiceInterface …” . Can anyone please help me solve that issue.

    Thank,

    (0) 
    1. Arnulfo Díaz Ruiz

      Hi Carles, well, I think this error is because you have no authorization to use the WS, when you create the WS you need to create a view or use an existed one to be able of give to your user access to it, then you just need use your user and pass to consume this web service without get that error, you can do it in a web services test tool, I use Soap UI, there you must do something like this:

      /wp-content/uploads/2013/01/wsauth_180328.png

      I really hope this helps.

      Regards.

      (0) 
        1. Arnulfo Díaz Ruiz

          Well, I think your problem is that, you need to create a WCF Screen for your BO, and then asign your WCView  to your new WCF, once you do this you just have to save and activate and you must be able to see your view in the Application and User Managment

          (0) 
          1. Carlès Totap Timadji

            I’m using SAP salesOrder BO extention. And when I “enhance screen” the WCF view does not show. If I add the WCF from “Add New Item” contextual menu on the project, I can’t find that WCF in the “Application and managment”. So I do not understand.

            Any Ideas ?

            (0) 
            1. Carlès Totap Timadji

              Hi Arnulfo Díaz Ruiz,

              Your solution work for me. I just

              create a view for my web service, and give my test user access to that view from the “Application and Managmenent work center”, then I consume my web service from Visual Studio C# console application. it work fine.

              thank again.

              (0) 
  6. Olena KUSHAKOVSKA

    Hi Angel,

    We have followed all steps – but when calling the Create operation of the service from SoapUI – nothing happens on ByD side.

    We get an answer in SoapUI  that operation was successful. Reading the same instance – returns an error that instance does not exist and the instance does not appear in ByD WorkCenter.That everything was fine .

    Any idea? Thank you very much for your help.

    Regards,

    Helen

    (0) 

Leave a Reply