cancel
Showing results for 
Search instead for 
Did you mean: 

Consuming a Web Service in Perl - Import parameter

Former Member
0 Kudos

Hey,

i tried to consume a SAP Web Service with perl... Just calling the Web Service works fine, but I am not able to transfer a parameter.

Here is the perl code:

my $sapsoap = SOAP::Lite
    -> uri('urn:sap-com:document:sap:soap:functions:mc-style')
    -> on_action(sub { return '""' })
    -> proxy("http://USER:PW\@SERVER:PORT/sap/bc/srt/rfc/sap/z_read_eem_scenario_exe/110/z_read_eem_scenario_exe/z_read_eem_scenario_exe");

my $method = SOAP::Data->name('ZReadEemScenarioExe')
    ->attr({xmlns => 'urn:sap-com:document:sap:soap:functions:mc-style'});

my $params = SOAP::Data->value(
    SOAP::Data->name(Input => $input));

my $result = $sapsoap->call($method => $params);
my $output = $result->result;

In the RFC-Function I declared the variable "INPUT" as Type String and importing parameter.

Part of WSDL:

- <wsdl:types>
- <xsd:schema attributeFormDefault="qualified" targetNamespace="urn:sap-com:document:sap:soap:functions:mc-style">
- <xsd:element name="ZReadEemScenarioExe">
- <xsd:complexType>
- <xsd:sequence>
  <xsd:element name="PInput" type="xsd:string" minOccurs="0" /> 
  </xsd:sequence>
  </xsd:complexType>
  </xsd:element>
- <xsd:element name="ZReadEemScenarioExeResponse">
- <xsd:complexType>
- <xsd:sequence>
  <xsd:element name="POutput" type="xsd:string" /> 
  </xsd:sequence>
  </xsd:complexType>
  </xsd:element>
  </xsd:schema>
  </wsdl:types>

Any suggestions?

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

The solution was to change rpc-literal to document-literal....

Former Member
0 Kudos

Glad you were able to solve it!

Cheers,

David.

Former Member
0 Kudos

Here's how I send an input parameter in one of the scripts I've written:


    my $rcc = $rfc->function_lookup("SXMI_XMB_SYSLOG_READ");
    my $slr = $rcc->create_function_call;
    $slr->SERVER_NAME($server[$x]);
    $slr->EXTERNAL_USER_NAME('GOOFY');
    $slr->invoke;