cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with consuming an external webservice

former_member611341
Participant
0 Kudos

I’m trying a scenario in SAP PI to consume an external web service :  http://www.webservicex.com/globalweather.asmx?WSDL

SAP ECC <--->PI  <-----> external web service.

Created all the ESR and IB configuration in PI. I'm on PI 7.3 java stack only.

Steps I have followed:

  1) Import  third party WSDL as external definition in the ESR

  2) Created inbound interface based on External message types

  3) Created Data types/Message types and Outbound interface

 

4) Created Message mapping and operation mapping

  5) In Integration builder created Comm channel for  SOAP receiver

  6) created communication component and CC for ECC system for SOAP sender.

  7) created integrated configuration using the interfaces, comm channels and operation mapping

Now when I go to my ECC system, generate the proxy and try to execute, I’m seeing an error “PARSING.GENERAL”.

This is the error in message log in PI.

Even the payload is blank

Please help !!

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

former_member611341
Participant
0 Kudos

Finally ..... I have fixed it.

Changed the "Message Protocol' for SOAP Sender Comm Channel.

Thanks for all you help !!

Answers (5)

Answers (5)

former_member611341
Participant
0 Kudos

What is proxy report?  How do I do that?

Im just regenerating the proxy in my ECC , activating it and then testing.

Thanks.

former_member611341
Participant
0 Kudos

Hi

Manoj,

If I use  "Stateless" I'm getting an Interface determination error so changed it to "-Stateless(XI 3.0 Compatabile)"

Every time I'm regenerating proxy and activating   proxy in ECC system before testing just to make sure all my changes are up to date.

former_member611341
Participant
0 Kudos

I'm sending city and country name from my ECC system.

third party WSDL as external definition in the ESR

Inbound interface:

This is the mapping I have used.

Request and response mapping

Let me know if I'm missing anything?

former_member182412
Active Contributor
0 Kudos

Hi Aday,

As Raghu already suggested you need to handle CDATA section in your response.

  • Create target message type like below and create mapping between web service response and your response message type.

  • Map GetWeatherResult to GetWeatherResponse root node and set return as XML for source field like below.

  • Create operation mapping between web service response and your response service interface, use below order (First message mapping and second XSLT mapping)

  • XSLT mapping code:


<?xml version="1.0" encoding="utf-8"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

   <xsl:output omit-xml-declaration="yes" indent="yes" encoding="utf-8"/>

   <!--Identity template simply copies content forward -->

   <xsl:template match="@*|node()">

      <xsl:copy>

         <xsl:apply-templates select="@*|node()"/>

      </xsl:copy>

   </xsl:template>

   <xsl:template match="*">

      <xsl:copy>

         <xsl:apply-templates select="*"/>

         <xsl:value-of select="substring-after(text(),&apos;?&gt;&apos;)" disable-output-escaping="yes"/>

      </xsl:copy>

   </xsl:template>

</xsl:stylesheet>

  • Test result from soap UI.

Regards,

Praveen.

vadimklimov
Active Contributor
0 Kudos

Hello Aday,

Raghuraman brought to attention a valid point regarding response structure, and Praveen provided extensive example on that, but looking into an error text and screenshots you provided, I'm concerned about error happening already in a request flow (normal response message with CDATA content is not even produced at this step, it only returns an exception).

As you mentioned in one of screenshots, request message in PI is empty and contains no country name and city name - that is a cause of a web service call failure.

Unfortunately, I don't see mapping rules for these two fields in your mapping, but I would assume they are one to one, with no conversion from source value to the one constructed in a target message leaving PI and being sent to a web service. Thus, I would suspect a sender, SAP ECC system, is not providing these values in the produced request message. As it can be seen from your recent screenshots, ECC issues general parsing error - please have a look into it and investigate its root cause (for example, by checking processed messages in ECC in tx. SXMB_MONI or SXI_MONITOR and corresponding error details there, or in log in tx. SPROXY after you attempt to send the generated request message)? Please provide details of the error that is caught in ECC so that we may look into possible causes of its origin.

Regards,

Vadim

former_member611341
Participant
0 Kudos

Thanks for you responses Vadim and Praveen.

Very much appreciated.

This is request and response mapping. these are just one-to-one mapping.

I agree with you Vadim. I feel the issue is on request side. XML is not rightly passed from my ECC system so it giving an mapping error.

this is the error I see in PI message log

Are there any other steps that need to be done in my ECC system? 

In the SXMB_MONI, for that message I see the bellow :

Thanks for you help !!

former_member182412
Active Contributor
0 Kudos

Hi Aday,

Go to transaction SXI_MONITOR in ECC and take the request payload and test your request mapping in PI message mapping test tool.

Regards,

Praveen.

former_member186851
Active Contributor
0 Kudos

Hello Aday,

Might be an issue with the payload.

As Praveen suggested get the payload and test in mapping tool.

former_member611341
Participant
0 Kudos

Hi,

Tested using mapping testing tool using the payload from ECC. It was fine.

former_member186851
Active Contributor
0 Kudos

Hello Aday,

This is weird. Request seems to be fine.

Just check whether you have maintained SOAP action in the soap channel.

manoj_khavatkopp
Active Contributor
0 Kudos

Aday,

Any specific reason why you have inbound interface -Stateless(XI 3.0 Compatabile) ?

Br,

Manoj

vadimklimov
Active Contributor
0 Kudos

Raghuraman, it is unlikely to be an issue with SOAP action - SOAP action is an attribute of a receiver channel, and here the problem occurs already at preceding step, during mapping execution.

Aday, can you please:

  1. Regenerate proxy object for corresponding outbound interface in tx. SPROXY in ECC. This is to ensure ABAP proxy object and underlying objects are consistent to current version in ESR of PI and there are no discrepancies when marshalling ABAP structure to XML document that is sent from ECC to PI;
  2. Perform HTTP trace of outbound calls from ECC and XPI Inspector trace of the sender communication channel in PI (including trace of Module Processor and Messaging System). This is to cross-check XML message that is leaving ECC and is coming to PI and verify if they are identical.

Regards,

Vadim

former_member186851
Active Contributor
0 Kudos

Yeah Vadim,

But I thought if the response mapping is giving an error then might be..Anyways its again invalid.

There is should be something wrong in the structure or might be objects are not up to date.

nitindeshpande
Active Contributor
0 Kudos

Hello Aday,

Can you check if your Proxy Report is active or no? I feel the proxy report used to send this data is not active in your ECC system.

Regards,

Nitin

former_member186851
Active Contributor
0 Kudos

Hello Aday,

Check the data as Vadim suggested.

Also I guess the response is coming in CDATA with XML in it, are you handling the same in mapping?

vadimklimov
Active Contributor
0 Kudos

Hello Aday,

Even though WSDL of the web service defines elements "CityName" and "CountryName" as optional in the request message type for the operation "GetWeather", please ensure they both are contained in the request message:

From the error you get, it looks like "CountryName" is missing in the request message which is sent to the web service.


Regards,

Vadim