Tag: Exchange Infrastructure Protocol (XI)

Create Webservice Mock Service with SOAP UI

Create Webservice Mock Service with SOAP UI

Scenario

If you want to see the message which is send by a SOAP, REST, XI or HTTP Receiver Communication Channel, you can use SOAP UI to create a Mock Service to log the headers and payloads of the message.

Create Mock Service with SOAP UI

  1. Create a new Project or open an existing one
  2. Right click on your request and select “New REST/SOAP MockService” (SOAP service will respond with a SOAP envelope, REST service will send back an empty response) and name it
  3. If you like to specify port and path, click on the gearwheel and specify both. Otherwise your endpoint will be listening on https://localhost:8080/

    SOAP UI: Configure Mock Service parameters
    SOAP UI: Configure Mock Service parameters
  4. Open the “OnRequest Script” Tab and paste the following line into the editor
    log.info(mockRequest.getRequestContent())
  5. Open the “Script Log” Tab and start your Mock Service with the green play button

    SOAP UI Mock Service: Log Payload of requests
    SOAP UI Mock Service: Log Payload of requests

Configure Receiver Communication Channel

  1. Find out your local IP Address (for example with this website)
  2. Make sure that your PC is reachable from PI (Firewall)
  3. Add your IP Address with the above configured port and path to the URL of your Receiver Communication Channel
  4. Send a request to your endpoint. The payload will be shown in the “Script Log”

Additional options

You can use the full scope of Groovy to write your scripts. Please find below two useful snippets to log your requests.

To log the headers use:

log.info(mockRequest.getRequestHeaders())

To write the request data into a file use:

def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context)
def projectroot = groovyUtils.projectPath
def inputFile = new File(projectroot + "\\request.txt")

log.info("Writing request to file: " + projectroot + "\\request.txt")
inputFile.setBytes(mockRequest.getRawRequestData())

For more information of the mockRequest class in SOAP UI, check the class documentation.

Also it is possible to send custom responses, please check the SOAP UI Documentation for more information.

Message in status Message recorded (commit missing)

Message in status Message recorded (commit missing)

Scenario

You created a test message with the testing tool in transaction SPROXY to test an asynchronous interface out of your ERP system. Afterwards you checked transaction “SXMB_MONI” or “SXI_MONITOR” for the test message.

Error

The message has a white flag and shows the following error:

Message in status Message recorded (commit missing)

sxi_monitor: Messages in status commit
sxi_monitor: Messages in status commit

Solution

Asynchronous message are recorded until the work is committed. Go back to the “Test Service Consumer” view of transaction “SPROXY” and click on Extras – > Trigger COMMIT WORK.

Trigger Commit Work in Proxy Test Tool
Trigger Commit Work in Proxy Test Tool

The message should be sent to the receiving system now. If you call your proxy out of some ABAP code, make sure you do not forget to add a commit statement.

Forbidden Error in XI Receiver Channel

Forbidden Error in XI Receiver Channel

Scenario

In a configuration with an SAP R3 system as receiver, which is connected via a XI Receiver Channel, the message cannot be delivered to the target system.

Error

The following message is shown in the Message Log of PIMON:

SOAP: Error occurred: com.sap.engine.interfaces.messaging.api.exception.MessagingException: java.io.IOException: HTTP Error response for SOAP request or invalid content-type.; HTTP 403 Forbidden

Exception caught by adapter framework: java.io.IOException: HTTP Error response for SOAP request or invalid content-type.; HTTP 403 Forbidden

Transmitting the message to endpoint <local> using connection JPR failed, due to: com.sap.engine.interfaces.messaging.api.exception.MessagingException: java.io.IOException: HTTP Error response for SOAP request or invalid content-type.; HTTP 403 Forbidden

Solution

Activate the Integration Engine Service on your target system:

  1. Open SAP GUI and connect to your target system
  2. Open transaction “SICF”
  3. Enter “/sap/xi/engine” as “Service Path” and click execute

    Transaction SCIF: Service Path /sap/xi/engine
    Transaction SCIF: Service Path /sap/xi/engine
  4. Right click on “Integration Engine (SAP XI Message Format)” and select “Activate Service”

    Transaction SCIF: Activate Integration Engine Service
    Transaction SCIF: Activate Integration Engine Service
  5. Restart your message
  6. If it still does not work, check that the used user has the role “SAP_XI_APPL_SERV_USER”
Commit fault: ASJ.ejb.005043 (Failed in component: sap.com/com.sap.aii.ad)

Commit fault: ASJ.ejb.005043 (Failed in component: sap.com/com.sap.aii.ad)

Scenario

Simple ERP to PI communication via IDOC.

Error

The IDOC is not send out to PI and the following error message is shown in transaction SM58 on ERP system:

Commit fault: ASJ.ejb.005043 (Failed in component: sap.com/com.sap.aii.ad)

Error in SM58
Error in SM58

Solution

To find out why the IDOC cannot be send to our PO system we will check the channel monitoring of the IDOC sender communication channel first. If there is no error in the channel monitor, we have to do dive deeper into the system, by using the XPI Inspector:

  1. Open the XPI Inspector on your SAP PO system.

    http://po.host.name/xpi_inspector

  2. Select Example “50 (XI Channel)” and add your IDOC sender communication channel by searching for the channel name, checking the checkbox and clicking the “Add selected” button.

    XPI Inspector configuration page
    XPI Inspector configuration page
  3. It is best to stop the XPI inspector as soon as possible. Otherwise, you have to look through thousands of log entries. Therefore, open SM58 and search for you message to be prepared to resend the IDOC (Edit -> Execute LUW (F6)).
  4. Hit the “Start” button in XPI inspector and wait till the start page is loaded.
  5. Resend the IDOC (Edit -> Execute LUW (F6)) in SM58.
  6. Click the “Stop” button in XPI inspector and wait for the result page to show up.
  7. Click on the number in the “Records Count” column of the Server Nodes table. If you have multiple Server Nodes, you have to go through all of them.

    XPI Inspector result page
    XPI Inspector result page
  8. Search for a log entry with your IDOC (you can use the browser search CTRL+F and search for your IDocNumber, MessageType or anything else)
    Client = 001
    CreationDate = 20170615
    CreationTime = 171650
    Direction = 1
    EDIMessage =
    EDIMessageGroup =
    EDIMessageType =
    EDIStandardFlag =
    EDIStandardVersion =
    EDITransmissionFile =
    ExpressFlag =
    IDocNumber = 0000000052812406
    IDocSAPRelease = 750
    IDocCompoundType = null
    IDocType = DELVRY07
    IDocTypeExtension =
    MessageCode =
    MessageFunction =
    MessageType = Z_DELV_IT
    OutputMode = 2
    SenderAddress =
    SenderLogicalAddress =
    SenderPartnerFunction =
    SenderPartnerNumber = A22001
    SenderPartnerType = LS
    SenderPort = SAPA22
    Serialization = 20170615171650
    RecipientAddress =
    RecipientLogicalAddress =
    RecipientPartnerFunction =
    RecipientPartnerNumber = RECPPRN
    RecipientPartnerType = LS
    RecipientPort = A000000003
    Status = 30
    TestFlag =
    ROOT (Type: ROOT)
    !
    +-- E2EDL20004 (Type: E1EDL20)
    !
    +-- E2EDL22001 (Type: E1EDL22)
    !
    +-- E2EDL21 (Type: E1EDL21)
    ! !
    ! +-- E2EDL23 (Type: E1EDL23)
  9. Some lines below you should find a line with a red or yellow background with your error
    Warning in XPI Inspector
    Warning in XPI Inspector
    [EXCEPTION]
    com.sap.aii.af.service.cpa.CPAObjectNotFoundException: Couldn't retrieve inbound binding for the given P/S/A values: FP=;TP=;FS=A22_001;TS=;AN=Z_DELV_IT.DELVRY07;ANS=urn:sap-com:document:sap:idoc:messages;
    at com.sap.aii.af.service.cpa.impl.lookup.CommonLookup.getInboundBinding(CommonLookup.java:211)
    at com.sap.aii.af.service.cpa.impl.lookup.CommonLookup.getInboundBinding(CommonLookup.java:175)
    at com.sap.aii.af.service.cpa.InboundRuntimeLookup.(InboundRuntimeLookup.java:88)
    at com.sap.aii.af.service.cpa.impl.lookup.AbstractLookupManager.getBinding(AbstractLookupManager.java:597)
    at com.sap.aii.af.idoc.inbound.IDocInboundProcessor.findBindingAndChannel(IDocInboundProcessor.java:792)
    at com.sap.aii.af.idoc.inbound.IDocInboundProcessor.initForIDocListProcessing(IDocInboundProcessor.java:998)
    at com.sap.aii.af.idoc.inbound.IDocInboundProcessor.process(IDocInboundProcessor.java:146)
    at com.sap.aii.af.idoc.inbound.IDocReceiverBean.onCommit(IDocReceiverBean.java:127)
    at sun.reflect.GeneratedMethodAccessor1393.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.sap.engine.services.ejb3.runtime.impl.RequestInvocationContext.proceedFinal(RequestInvocationContext.java:47)
    at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:166)
    at com.sap.engine.services.ejb3.runtime.impl.Interceptors_StatesTransition.invoke(Interceptors_StatesTransition.java:19)
    at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)
    at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Resource.invoke(Interceptors_Resource.java:50)
    at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)
    at com.sap.engine.services.ejb3.runtime.impl.Interceptors_MessageListenerType.invoke(Interceptors_MessageListenerType.java:86)
    at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)
    at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:191)
    at com.sap.engine.services.ejb3.runtime.impl.Interceptors_StatelessInstanceGetter.invoke(Interceptors_StatelessInstanceGetter.java:23)
    at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)
    at com.sap.engine.services.ejb3.runtime.impl.Interceptors_SecurityCheck.invoke(Interceptors_SecurityCheck.java:25)
    at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)
    at com.sap.engine.services.ejb3.runtime.impl.Interceptors_ExceptionTracer.invoke(Interceptors_ExceptionTracer.java:17)
    at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)
    at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Lock.invoke(Interceptors_Lock.java:21)
    at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)
    at com.sap.engine.services.ejb3.runtime.impl.DefaultInvocationChainsManager.startChain(DefaultInvocationChainsManager.java:138)
    at com.sap.engine.services.ejb3.runtime.impl.DefaultEJBProxyInvocationHandler.invoke(DefaultEJBProxyInvocationHandler.java:172)
    at com.sap.engine.services.ejb3.runtime.impl.MDBProxyInvocationHandler.invoke(MDBProxyInvocationHandler.java:142)
    at com.sun.proxy.$Proxy3278.onCommit(Unknown Source)
    at com.sap.mw.jco.jra.JRA$ReaderThread.commit(JRA.java:8639)
    at com.sap.conn.jco.rt.DefaultServerWorker.onCommit(DefaultServerWorker.java:209)
    at com.sap.conn.jco.rt.MiddlewareJavaRfc$JavaRfcServer.playbackTRfc(MiddlewareJavaRfc.java:3008)
    at com.sap.conn.jco.rt.MiddlewareJavaRfc$JavaRfcServer.handletRfcRequest(MiddlewareJavaRfc.java:2875)
    at com.sap.conn.jco.rt.MiddlewareJavaRfc$JavaRfcServer.listen(MiddlewareJavaRfc.java:2674)
    at com.sap.conn.jco.rt.DefaultServerWorker.dispatch(DefaultServerWorker.java:275)
    at com.sap.conn.jco.rt.DefaultServerWorker.loop(DefaultServerWorker.java:356)
    at com.sap.conn.jco.rt.DefaultServerWorker.run(DefaultServerWorker.java:232)
    at com.sap.mw.jco.jra.JRA$ReaderThread.run(JRA.java:8947)
    at com.sap.engine.services.connector.jca15.work.TaskImpl.run(TaskImpl.java:245)
    at com.sap.engine.core.thread.execution.Executable.run(Executable.java:122)
    at com.sap.engine.core.thread.execution.Executable.run(Executable.java:101)
    at com.sap.engine.core.thread.execution.CentralExecutor$SingleThread.run(CentralExecutor.java:328)

The error message

Couldn’t retrieve inbound binding for the given P/S/A values:

probably means that your ICO is not configured correctly. Check that you selected the right IDOC and sending system. Maybe you forgot to transport the configuration? Also, it could be a cache refresh problem. You can edit the description, save the configuration and activate it again to refresh the cache.

Generate WSDLs and decoded URLs for webservices

Generate WSDLs and decoded URLs for webservices

When creating an Interface with SAP Process Integration or SAP Process Orchestration which provides a webservice, you need the WSDL file or at least the URL of your webservice. Otherwise, your partner doesn’t know how to connect to your webservice.

Generate WSDL file

SAP PI and PO has a great feature do generate Web Service Description Language (WSDL) files for configurations with HTTP, XI, SOAP or WS Sender Communication Channels.

To generate a WSDL file:

  1. Open an Integrated Configuration (ICO) (or a Sender Agreement) in the Integration Builder, which is in status “Active”
  2. Click on “Integrated Configuration” in the top menu
  3. Click on “Display WSDL”
Detail View of Integrated Configuration

Detail view of Integrated Configuration (ICO) in Integration Directory (DIR)

A popup should open which displays the WSDL file and an URL to the WSDL file. Now, you can either download the file, use the URL to the WSDL file or directly get the information you need.

Get webservice URL

You can provide the whole WSDL file to your partner or just the URL. If you need the URL only, scroll to the end of the WSDL file . There you can find the HTTP and the HTTPS ports with the webservice URL in the location attribute of the address element. It looks like:

https://pisystem:50001/XISOAPAdapter/MessageServlet?senderParty=&senderService=service&receiverParty=&receiverService=&interface=SI_out&interfaceNamespace=urn%3Anamepspace

Shows Display WSDL window with address section highlighted in Integration Directory (DIR)
Display WSDL window – address section highlighted

Depending on you system configuration and your network structure, you maybe have to change domain and port of your URL before you can provide it to your partner. In case there is a Web Application Firewall, a Web Dispatcher, a Reverse Proxy or something similar in place, you should ask your system administrator for the correct domain and port. If you are communicating over an unprotected network, like the internet, you should always use SSL encryption.

Decode webservice URL

Due to different implementations of URL processing it is sometimes necessary to decode the URL, provided in the WSDL file. For example for the Chrome browser extension Boomerang you need to decode the URL before you can successfully connect to your webservice. If you do not know how your application handles URLs you can test the normal and the decoded URL. For one URL you will get an error like this:

com.sap.aii.af.service.cpa.CPAObjectNotFoundException: Couldn’t retrieve inbound binding for the given P/S/A values: FP=;TP=;FS=null;TS=;AN=null;ANS=null;

To get the decoded URL, just paste your URL in the textbox below and click on the “Decode URL” button.


If you are trying to reach the webservice in a browser you should see something like this:

Message Servlet is in Status OK

Status information:

Servlet com.sap.aii.adapter.soap.web.MessageServlet (Version $Id: //tc/xpi.adapters/NW731EXT_15_REL/src/_soap_application_web_module/webm/api/com/sap/aii/adapter/soap/web/MessageServlet.java#1 $) bound to /MessageServlet
Classname ModuleProcessor: null
Lookupname for localModuleProcessorLookupName: localejbs/ModuleProcessorBean
Lookupname for remoteModuleProcessorLookupName: null
ModuleProcessorClass not instantiated
ModuleProcessorLocal is Instance of com.sun.proxy.$Proxy523
ModuleProcessorRemote not instantiated