веб-сервисы
Добавлено: 15 мар 2012, 13:48
А кто-нибудь пробовал пользоваться веб-сервисами в версии 3.1 ?
Код: Выделить всё
# to convert the data into a hash, use the JSON module
my $Result = $JSONObject->Decode(
Data => $ResponseContent,
);
if ( !$Result ) {
my $ResponseError = $ErrorMessage . ' Error while parsing JSON data.';
# log to debugger
$Self->{DebuggerObject}->Error(
Summary => $ResponseError,
);
return {
Success => 0,
ErrorMessage => $ResponseError,
};
}
Код: Выделить всё
if ( !$Result ) {
my $ResponseError = $ErrorMessage . ' Error while parsing JSON data.';
# log to debugger
$Self->{DebuggerObject}->Error(
Summary => $ResponseError,
);
return {
Success => 0,
ErrorMessage => $ResponseError,
};
}
Код: Выделить всё
if ( !$Result && $ResponseContent != 'ok' ) {
my $ResponseError = $ErrorMessage . ' Error while parsing JSON data.';
# log to debugger
$Self->{DebuggerObject}->Error(
Summary => $ResponseError,
);
return {
Success => 0,
ErrorMessage => $ResponseError,
};
}
Код: Выделить всё
if ($ResponseContent eq 'ok' )
{
$ResponseContent = '{"text": "ok"}';
}
# to convert the data into a hash, use the JSON module
my $Result = $JSONObject->Decode(
Data => $ResponseContent,
);
Код: Выделить всё
{
"attachments": [
{
"text": "text"
}
]
}
Код: Выделить всё
$SlackText{Data}->{attachments}->{text}= "text";
Код: Выделить всё
{
"attachments":
{
"text":"text"
}
}
Код: Выделить всё
# to convert the data into a hash, use the JSON module
my $Result = $JSONObject->Decode(
Data => $ResponseContent,
);
Код: Выделить всё
if ($ResponseContent eq 'ok' )
{
$ResponseContent = '{"text": "ok"}';
}
Код: Выделить всё
<ConfigItem Name="GenericInterface::Invoker::Module###Slack::Slack" Required="0" Valid="0">
<Description Translatable="1">GenericInterface module registration for the invoker layer.</Description>
<Group>GenericInterface</Group>
<SubGroup>GenericInterface::Invoker::ModuleRegistration</SubGroup>
<Setting>
<Hash>
<Item Key="Name">Slack</Item>
<Item Key="Controller">Slack</Item>
<Item Key="ConfigDialog">AdminGenericInterfaceInvokerDefault</Item>
</Hash>
</Setting>
</ConfigItem>