SAP Adapter v6.5 - how to use RFC-XML with HTTP Post

We are using wM6.5 with SAP Adapter 6.5. In an automated scenario, webMethods SAP Adapter Users Guide recommends to invoke an RFC adapter service using RFC-XML with HTTP Post method. This works fine and the function module gets invoked (as can be verified from the SAP system). However, the example does not suggest how to obtain the response from the call. When using the pub.client.http service to simulate an http post, I get an RFC-XML response without any content as below:

<?xml version="1.0"?>

<sap:Envelope xmlns:sap=“urn:sap-com:document:sap” version=“1.0”>
sap:Body
<rfc:YJA_TEST_RFC.Response xmlns:rfc=“urn:sap-com:document:sap:rfc:functions”>
</rfc:YJA_TEST_RFC.Response>
</sap:Body>
</sap:Envelope>

What am I missing? Are there any better examples of using RFC-XML with HTTP Post and receiving a full response?

-Jose

Hello,

Here are more details of the situation, hoping this will help someone to suggest a resolution :slight_smile:

webMethods SAP Adapter User’s Guide, Chapter 5 has a section “Posting an RFC-XML Document from an HTTP Client” [page 77]. In this section, it explains how to invoke a SAP adapter service “in a fully automated scenario”. There is a tip to simulate a raw post, you can use the service pub.client:http. We are trying to follow this example. We are able to invoke the service alright, (I can verify this from SAP) but don’t understand how to get the response from the call. The tables are not optional.

We used pub.string:bytesToString to convert the byte array from the response to a string. We are getting just the following:

<sap:Envelope xmlns:sap="urn:sap-com:document:sap" version="1.0">
  <sap:Body>
    <rfc:YJA_TEST_RFC.Response xmlns:rfc="urn:sap-com:document:sap:rfc:functions">
    </rfc:YJA_TEST_RFC.Response>
  </sap:Body>
</sap:Envelope>

========================
As you can easily see, there is no content for tag rfc:YJA_TEST_RFC.Response.

However, when we invoke the SAP RFC from SAP adapter Lookup menu from admin page using the following input RFC-XML,

<sap:Envelope xmlns:sap="urn:sap-com:document:sap" version="1.0">
  <sap:Header xmlns:rfcprop="urn:sap-com:document:sap:rfc:properties">
    <saptr:From xmlns:saptr="urn:sap-com:document:sap:transport">BC1</saptr:From>
    <saptr:To xmlns:saptr="urn:sap-com:document:sap:transport">BC2</saptr:To>
  </sap:Header>
  <sap:Body>
    <rfc:YJA_TEST_RFC xmlns:rfc="urn:sap-com:document:sap:rfc:functions">
      <INVALUE>some string</INVALUE>
    </rfc:YJA_TEST_RFC>
  </sap:Body>
</sap:Envelope>

========================

we get a proper response as follows:

<sap:Envelope xmlns:sap="urn:sap-com:document:sap" version="1.0">
  <sap:Body>
    <rfc:YJA_TEST_RFC.Response xmlns:rfc="urn:sap-com:document:sap:rfc:functions">
      <OUTVALUE>Successful</OUTVALUE>
      <TABLE20>
        <item>
          <PATNR>some string</PATNR>
          <EINRI/>
          <GSCHL/>
          <NNAME/>
          <VNAME/>
          <NAMZU/>
          <GBDAT>0000-00-00</GBDAT>
          <ZZREL/>
          <ZZFLO/>
          <CANSELECT/>
          <SELCOMMENT/>
          <GBNAM>Middle name place holder</GBNAM>
        </item>
        <item>
          <PATNR>00-00-00</PATNR>
          <EINRI/>
          <GSCHL/>
          <NNAME/>
          <VNAME/>
          <NAMZU/>
          <GBDAT>0000-00-00</GBDAT>
          <ZZREL/>
          <ZZFLO/>
          <CANSELECT/>
          <SELCOMMENT/>
          <GBNAM>Second name place holder</GBNAM>
        </item>
      </TABLE20>
      <T_RETURN/>
    </rfc:YJA_TEST_RFC.Response>
  </sap:Body>
</sap:Envelope>

========================

We want to get similar response from WM Developer invocation, for example, using “pub.client:http”. Currently, we get the empty response as described above.

-Jose