zoukankan      html  css  js  c++  java
  • 使用soapUI消费SAP Cloud for Customer的web service

    Hello all,
    I am really a newbie to Cloud for Customer world and this is my first blog, very simple but I hope it can help some other newbies just the same as me.

    I have been working as an application developer in SAP CRM for 5 years, and in CRM we have dedicated work center to create web service based on CRM standard business object.

    Just a quick glance at the modeling UI in CRM.

    and now I have to do the same in C4C, let’s say I would like to query C4C Opportunity transaction data in my custom application using standard web service provided in C4C. In order to test this consumption, I choose SoapUI.

    Here below is detailed step by step screenshot.

    (1) Go to workcenter Administrator, then Input and Output management->Service Explorer, you can get a list of all standard inbound services here.

    Download the WSDL for later use.
    If you are working in 1605, you can find a list of all standard web services from SAP help:

    Since I would like to query Opportunity data, I choose QueryOpportunityIn, and click “Show full documentation”:

    The documentation tells me how to fill the request detail in SoapUI.

    (2) Download and install SoapUI. Create a new SOAP project by loading the WSDL downloaded from previous step.

    Suppose I would like to retrieve this opportunity data in my C4C system by querying its id:

    Of source this example might not make much sense from business perspective as in real world we tend to use other criteria like customer name to query Opportunity.
    Paste the following xml source code in request view to query on Opportunity 15360.

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:glob="http://sap.com/xi/SAPGlobal20/Global" xmlns:zzz="http://sap.com/xi/AP/CustomerExtension/BYD/ZZZZZ">
       <soapenv:Header/>
       <soapenv:Body>
          <glob:OpportunityByElementsQuery_sync_V1>
             <!--Optional:-->
             <OpportunitySelectionByElements>
                <!--Zero or more repetitions:-->
                <SelectionByIdentifier>
                   <!--Optional:-->
                   <InclusionExclusionCode>I</InclusionExclusionCode>
                   <IntervalBoundaryTypeCode>1</IntervalBoundaryTypeCode>
                   <!--Optional:-->
                   <LowerBoundaryIdentifier>15360</LowerBoundaryIdentifier>
                </SelectionByIdentifier>
             </OpportunitySelectionByElements>
          </glob:OpportunityByElementsQuery_sync_V1>
       </soapenv:Body>
    </soapenv:Envelope>
    

    Execute this request, I meet with error message: 401 Unauthorized.

    Then I manually maintained my business user and password in request property view:

    You might also need to maintain proxy setting for SoapUI according to your network landscape.

    Once you have finished all such settings, execute request again and now you can see response as expected:

    Update 2017-11-29

    In case you meet with error message “Authorization role missing” when consuming web service, you might refer to this blog for help: How to resolve error message when calling Web Service in SoapUI – Authorization role missing

    要获取更多Jerry的原创文章,请关注公众号"汪子熙":

  • 相关阅读:
    有关于CSS的面试题和练习
    Yslow&PageSpeed– 诊断各种缓慢症状
    使用Plant Simulation连接SQL Server
    利用Microsoft Sql Server Management studio 创建数据库的示例
    SQL2008配置管理工具服务显示远程过程调用失败
    用C语言的rand()和srand()产生伪随机数的方法总结
    Fisher–Yates shuffle 洗牌算法(zz)
    Unity3D导入MAX文件的一些问题(zz)
    UG中STP203和STP214的区别
    生产线工序基础知识
  • 原文地址:https://www.cnblogs.com/sap-jerry/p/13598812.html
Copyright © 2011-2022 走看看