I am creating a web service to create Tickets and I have problems with the key/value mapping.
I have this webservice (key mapping: Petitioner:CustomerUser):
Code: Select all
---
Debugger:
DebugThreshold: debug
TestMode: 0
Description: For testing
Provider:
Operation:
createTicket:
Description: To create a new ticket
MappingInbound:
Config:
KeyMapDefault:
MapTo: ''
MapType: Keep
KeyMapExact:
Petitioner: CustomerUser
ValueMapDefault:
MapTo: ''
MapType: Keep
Type: Simple
MappingOutbound:
Config:
KeyMapDefault:
MapTo: ''
MapType: Keep
ValueMapDefault:
MapTo: ''
MapType: Keep
Type: Simple
Type: Ticket::TicketCreate
Transport:
Config:
Authentication: {}
MaxLength: 1000000000
NameSpace: http://xxxxxx/otrs/mynamespace
Type: HTTP::SOAP
RemoteSystem: One system
Requester:
Transport:
Config:
Authentication: {}
Type: ''
Incoming data before mapping and Incoming data after mapping are the same in the debugger.
Note: I put "Petitioner" key inside "Ticket" structure.
Code: Select all
$VAR1 = {
'Article' => {
'Body' => 'This is an article test',
'ContentType' => 'text/plain; charset=utf8',
'Subject' => 'Open of the test incident'
},
'Password' => 'passs',
'Ticket' => {
'Petitioner' => 'customer',
'Priority' => 'Medium',
'Queue' => 'Projects',
'SLA' => '8x5 Medium Priority Request',
'Service' => 'Cloud',
'State' => 'new',
'Title' => 'Incident',
'Type' => 'Service Request'
},
'UserLogin' => 'user'
};
But If I put the "petitioner" field at root level, outside the "Ticket" structure, the mapping works, but I still having the same problem:
Incoming data before mapping:
Code: Select all
$VAR1 = {
'Article' => {
'Body' => 'This is an article test',
'ContentType' => 'text/plain; charset=utf8',
'Subject' => 'Open of the test incident'
},
'Password' => 'passs',
'Petitioner' => 'customer',
'Ticket' => {
'Priority' => 'Medium',
'Queue' => 'Projects',
'SLA' => '8x5 Medium Priority Request',
'Service' => 'Cloud',
'State' => 'new',
'Title' => 'Incident',
'Type' => 'Service Request'
},
'UserLogin' => 'user'
};
Code: Select all
$VAR1 = {
'Article' => {
'Body' => 'This is an article test',
'ContentType' => 'text/plain; charset=utf8',
'Subject' => 'Open of the test incident'
},
'Password' => 'passs',
'CustomerUser' => 'customer',
'Ticket' => {
'Priority' => 'Medium',
'Queue' => 'Projects',
'SLA' => '8x5 Medium Priority Request',
'Service' => 'Cloud',
'State' => 'new',
'Title' => 'Incident',
'Type' => 'Service Request'
},
'UserLogin' => 'user'
};
How Can I define that?
Thanks a lot!
NOTE: The solution is at my last response.