on 01-12-2011 8:40 AM
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?
The solution was to change rpc-literal to document-literal....
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.