Leser: 2
3 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
sub start_workflow {
my ($self, $wf_task, $wf_user) = @_;
my $userAgent = LWP::UserAgent->new(agent => 'perl post');
my $xml = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
xmlns:xs=\"http://www.w3.org/2001/XMLSchema\">
<SOAP-ENV:Body>
<ns1:SAP_WAPI_START_WORKFLOW xmlns:ns1=\"urn:sap-com:document:sap:rfc:functions\">
<TASK>$wf_task</TASK>
<USER>$wf_user</USER>
</ns1:SAP_WAPI_START_WORKFLOW>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>";
my $response = $userAgent->request( POST $self->{__service},
Content_Type => 'text/xml',
Content => $xml,
Authorization => $self->{__authorization}, );
return $response->content;
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<ns1:SAP_WAPI_START_WORKFLOW.Response xmlns:ns1="urn:sap-com:document:sap:rfc:functions">
<NEW_STATUS>
<STATUS>STARTED</STATUS>
<STATUSTEXT>in Arbeit</STATUSTEXT>
</NEW_STATUS>
<RETURN_CODE>0</RETURN_CODE>
<WORKITEM_ID>000000005061</WORKITEM_ID>
</ns1:SAP_WAPI_START_WORKFLOW.Response>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
use SOAP::Lite; use SOAP::Data qw/name/; my $soap = new SOAP::Lite( uri => 'urn:sap-com:document:sap:rfc:functions', proxy => 'http://wherever.it.lives.example' ); my $som = $soap->SAP_WAPI_START_WORKFLOW( name(TASK => $wf_task), name(USER => $wf_user) ); die $som->faultdetail if ($som->fault); say $som->result;
3 Einträge, 1 Seite |