In this blog I will create a web service which is exposed via Genil model PROD in CRM web client UI and consume it via a simple ABAP program.
Create web service in CRM Webclient UI
(1) log on CRM Web UI with business role SERVICEPRO, work center Service Operation, Create a new Web service: Choose Material as Business Object, choose Product/Individual Product as Component, Product as Root object. Mark check box Read, Create and Change.
Click the new button to also create a Web service operation which is implemented via the query object of Genil model
Click new button:
(2) in step 2 of the creation wizard, simply click select all to ensure all attributes in Genil model PROD are involved in the web service.
click Confirm Selection to continue.
(3) in step 3, it is allowed to specify certain fields as read only.
(4) In final step of wizard, we can specify the security profile of created web service. The differences of the two can be found in the chapter when we talk about how to consume the web service. In this blog I choose BASIC as security profile.
Click Activate button and then click Productive button in toolbar. Now we have finished the creation and the web service PROD_WS is ready to be consumed.
Create new binding for Service Definition PROD_WS use tcode SOAMANAGER, click Web Service Configuration.
Search by object name = PROD_WS:
Select search result and click Create Service button:
Specify Service name and Binding name:
Select SSL as Transport Level Security
If you select SECURE as security profile in web service creation step, the Authentication Level will be Strong instead of Basic, and the checkbox “User ID/Password” will be disabled, which means in that case, only X.509 SSL Client Certificate or Single Sign On are allowed.
In this blog, since both the creation of web service and service consumption are done in AG3, I mark “Make Local Call” as Local System Call.
Click Finish button, click the icon “Open Binding WSDL Generation”,
write down the WSDL link:
Create the service consumer proxy in ABAP backend
(1) tcode SE80, choose tab “Enterprise Services Browser”, right click on Objects, choose “Create new Object”,
Choose Service Consumer and click continue:
Specify a prefix:
Lots of proxy objects for runtime usage will be created:
Finally the ABAP consumer proxy class ZZCO_PROD_WS has been generated, which would be used in the ABAP program to consume the web service.
Now the consumer proxy class is ready for use. We can find all its available methods and signature in class builder.
In part 2 of this blog, we will discuss how to use this proxy class to consume web service in ABAP program.
In previous blog we have finished the creation for web service PROD_WS, and ABAP consumer proxy class ZZCO_PROD_WS. Before it can be used in ABAP program to consume the web service we created, a logical port is needed.
Create a new Logical Port in SOAMANAGER
(1) Go back to SOAMANAGER and search PROD_WS again, this time the ABAP consumer proxy ZZCO_PROD_WS is also visible in search result list.
(2) Click consumer proxy class and click button Create->WSDL Based Configuration:
(3) Specify Logical Port name:
Specify the WSDL link of new binding for service definition created in previous step. Specify a valid user and password for WSDL access.
Click finish button to finish logical port creation. Click Ping button and ensure it works successfully.
Consume the web service in ABAP program Use the following source code to consume the query and read service operation. Pass the logical port name LP__TEST1 in constructor of consumer class. The data type and method signature could be easily found in class builder for consumer proxy class ZZCO_PROD_WS.
```ABAP DATA: lo TYPE REF TO zzco_prod_ws, input TYPE zzcrmostpro001prodadvsea01, output TYPE zzcrmostpro001prodadvsea00.
CREATE OBJECT lo EXPORTING logical_port_name = 'LP_TEST1'.
input-input-searchforproducts-created_by-sign = 'I'. input-input-searchforproducts-created_by-option = 'EQ'. input-input-searchforproducts-created_by-low = 'WANGJER'.
TRY. lo->crmost__pro001prodadvsea001d( EXPORTING input = input IMPORTING output = output ). CATCH cx_root INTO DATA(lv_text). DATA(ls) = lv_text->get_text( ). WRITE:/ ls. ENDTRY.
DATA: ls_read_input TYPE zzcrmostprod_ws_read, ls_read_result TYPE zzcrmostprod_ws_read_respo.
TRY. ls_read_input-input-prod_ws-product_id = 'ARNO_TEST004'. lo->crmost__prod_ws_read( EXPORTING input = ls_read_input IMPORTING output = ls_read_result ). CATCH cx_root INTO lv_text. ls = lv_text->get_text( ). WRITE:/ ls. ENDTRY. ``` program execution result: 100 results found with CREATED_BY = WANGJER:
The result is exactly the same as when we manually run the advanced search in GENIL_BOL_BROWSER:
And the result for read operation consumption:
要获取更多Jerry的原创文章,请关注公众号"汪子熙":
相关推荐
CRM7.0 WebClient UI config
webui学习者
Result list是model在ICQR里面,如果点service,会navigate到service detail page,这个service detail page是做在PRD02OV上,所以这个navigation是cross component navigation: Cross component navigati
UI Guidelines for CRM WebClient User Interface
Sent: Thursday, May 9, 2013 6:30 PM Subject: ON_NEW_FOCUS的用途 ROOT ———————————— Product ID PRODshortText ———————————— Product Description Genil Model hierarchy
ASP.NET 中使用 C# 调用 Java Web Service ...在 ASP.NET 中使用 C# 调用 Java Web Service 需要了解 Web Service 的基本概念、使用 C# 调用 Java Web Service 和在 ASP.NET 中实现 Web Service 的客户端和服务器端。
使用WebClient实现文件下载,进度条反应下载进度。
WEBCLIENT使用方法
命名空间: System.Net,这是.NET创建者最初开发用于使用HTTP请求的标准类。使用HttpWebRequest可以让开发者控制请求/响应流程的各个方面,如 timeouts, cookies, headers, protocols。另一个好处是HttpWebRequest类...
我们先在IIS网站中建立一个文件夹,此处为"Mp3",并设置此文件夹相关读写权限。 例1:使用WebClient中的UploadFile方法上传文件。代码如下。使用此方法需要将上传的文件夹权限设置为 IIS来宾账户允许读写。 例2:...
C# WebClient 上传文件 WebClient上传文件至服务器
webclient程序源码,有关web中使用socket问题,c语言的。
下载开箱即用:C#使用WebClient获取网页源文件例子:该例子演示了通过WebClient获取百度首页源文件,并进行UTF8解码,存入一个字符串中。
WebClient jar包
yacy_webclient_bootstrap, YaCy搜索客户端使用 bootstrapcss yacy_webclient_bootstrap这是一个YaCy搜索客户端使用 Bootstrap,可以用作你自己的搜索门户的模板 !这可以在github页面上托管。 下面是这里知识库的...
Web Client for SVN by Polarion This enhanced Subversion web client has everything you need to interact with your Subversion repository using a web browser. (Free product)
C# WebClient实现文件下载 示例源码
WebClient的例子,在Eclipse中直接可以运行
基于webClient 的ftp操作,该案例是基于http模式,如果是ftp,直接将http改成ftp即可
基于WebClient类的Ftp文件上传,使用方便,采用异步模式编程,可支持大文件,文件分包上传,可自定义包大小,代码有两种风格的形式:一个是类库版,一个是组件版 都在一起 效果一样!