Product Lifecycle Management Blogs by Members
Get insider knowledge about product lifecycle management software from SAP. Tap into insights and real-world experiences with community member blog posts.
cancel
Showing results for 
Search instead for 
Did you mean: 
anujsuryawanshi
Explorer
1,747
Dear SAP MII Colleagues,

What comes to our mind when we talk about building an application? Optimization, performance, modularity and what not? I was no different and in the process of exploring the options for dynamically calling a web service through a Web Service action block, along with even passing the input request XML dynamically, I came across a few questions on the community website related to this, however there was no definite answer, especially on how to go about dynamically passing the input request XML to the WSDL (Web Services Description Language). So, here is a short blog post detailing about it, which I hope will help you during this type of implementation.

(Note - In this blog post, I will just talk about calling the web services dynamically. For static configuration and call using Configure Object option, please refer MII's help page and other content available on community website.)

As shown in the below screenshot, we need to pass the minimum parameters (CredentialAlias is also optional, depending on your web service’s authorization requirement) through the Link Editor of Web Service action block. For sake of testing, I have hard-coded these parameters in the Expression Editor, but all these can be passed dynamically through a Transaction/Local/Shared property.


Mapping in Link Editor of Web Service action block


Now, our focus is on the Inputs parameter of the action block. This is of datatype Map, so we can pass N number of Key-Value combinations, depending on the number of inputs and their corresponding data type the WSDL is expecting. My WSDL expects just one input of datatype XML, so I map it as below.

Name of the input parameter of WSDL:


So, SAP_PROCESS_ORDER becomes my Key which I have stored in Local.Input property and I want to pass Local.TestXML as the request XML, so this becomes my Value.


Passing Key-Value to Inputs parameter


 

That’s all. Execute the transaction to successfully post the data to the web service.


Web Service Response


Hope this will help eliminate using the Web Service action blocks separately/repeatedly for each web service call and thus allowing to optimize the implementation. Cheers!

Please do leave your comments with your feedback/suggestions.

 

Thank You,

Anuj Suryawanshi
3 Comments
archisman92
Participant
I can see this coming in handy very soon!
anujsuryawanshi
Explorer
0 Kudos
Glad to hear that 🙂
beyhan_meyrali
Active Contributor
0 Kudos
Hi,

Thanks for information. You can call a web service from MII and then you will regret it once you need to debug it :). So call a RFC on SAP and let RFC to do all the business logic. Do not put any biz logic to MII drag drop 4gl screen, instead use it as controller in MVC model.

Regards
Top kudoed authors