03-23-2016 09:04 AM
I am attempting to use PERL to communicate with the PAWS API. As an example, I will be using the getInactiveVersion envelope:
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:namesp2="http://www.w3.org/2005/08/addressing" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header>
<wsa xmlns:wsa="http://www.w3.org/2005/08/addressing">
<wsa:MessageID xsi:type="xsd:string">
uuid:63e5d8ca-dcac-40af-916b-d32ec3382d0f
</wsa:MessageID>
<wsa:ReplyTo>
<wsa:Address xsi:type="xsd:anyURI">
http://www.w3.org/2005/08/addressing/anonymous
</wsa:Address>
</wsa:ReplyTo>
<wsa:Action xsi:type="xsd:string">
getInactiveVersion
</wsa:Action>
</wsa>
</soapenv:Header>
<soapenv:Body>
<getInactiveVersion xmlns="http://services.api.platform.vos.cisco.com" xsi:nil="true" />
</soapenv:Body>
</soapenv:Envelope>
When I use this envelope, I get the following error:
Error: A required header representing a Message Addressing Property is not present
I have attempted using several envelopes. The I found that the following envelope worked in when I used curl in a bash script, but I couldn't get it to work in PERL:
#!/bin/bash
request='<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">
<wsa:Action>getInactiveVersion</wsa:Action>
<wsa:MessageID>uuid:63e5d8ca-dcac-40af-916b-d32ec3382d0f</wsa:MessageID>
<wsa:ReplyTo>
<wsa:Address>http://www.w3.org/2005/08/addressing/anonymous</wsa:Address>
</wsa:ReplyTo>
<wsa:To></wsa:To>
</soapenv:Header>
<soapenv:Body>
<getInactiveVersion xmlns="http://services.api.platform.vos.cisco.com"/>
</soapenv:Body>
</soapenv:Envelope>'
curl --silent -k -u 'xxxxxxx:yyyyyyyy' -H "Content-type: text/xml;" -d "$request" "https://cucm/platform-services/services/VersionService"
Could anyone help me out in identifying the issue with the Error I am seeing when running the request via PERL?
Thanks.
03-23-2016 09:06 AM
One thing I forgot to mention. There are times, after playing around with the envelope a bit, that I can get a response which states:
$VAR1 = {
'getInactiveVersionResponse' => {
'return' => bless( {
'version' => undef,
'remoteMessages' => bless( {
'info' => 'false',
'messageParams' => 'wsa.replyto',
'warning' => 'false',
'messageKey' => 'error.validation.required',
'error' => 'true',
'messageType' => 'internal.message.error'
}, 'RemoteMessage' ),
'result' => 'internal.request.failed'
}, 'VersionResponse' )
}
};
03-23-2016 09:14 AM
I grabbed some of the PAWS trace as well:
2016-03-23 12:12:20,752 INFO [http-bio-443-exec-28] services.VersionService.getInactiveVersion -
2016-03-23 12:12:20,753 INFO [http-bio-443-exec-28] services.VersionService.getInactiveVersion - *** Starting service ***
2016-03-23 12:12:20,753 INFO [http-bio-443-exec-28] services.RemoteService.isValidRequest - replyTo = null
2016-03-23 12:12:20,754 INFO [http-bio-443-exec-28] services.RemoteService.isValidRequest - messageID = null
2016-03-23 12:12:20,754 INFO [http-bio-443-exec-28] api.Message.<init> - Message key = [error.validation.required]
2016-03-23 12:12:20,754 INFO [http-bio-443-exec-28] api.Message.<init> - Message type = [internal.message.error]
2016-03-23 12:12:20,754 INFO [http-bio-443-exec-28] element.RemoteMessage.<init> - Message param[0] = [wsa.replyto]
2016-03-23 12:12:20,755 INFO [http-bio-443-exec-28] services.VersionService.getInactiveVersion - *** Ending service ***
2016-03-23 12:12:20,755 INFO [http-bio-443-exec-28] services.VersionService.getInactiveVersion -
It looks like the replyTo and messageID aren't getting passed.
03-23-2016 09:55 AM
If the XML request as shown is representative of the actual request, I found the following issues:
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:namesp2="http://www.w3.org/2005/08/addressing" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header>
<wsa xmlns:wsa="http://www.w3.org/2005/08/addressing"> <-- invalid sub-element <wsa>
<wsa:MessageID xsi:type="xsd:string"> <-- invalid new lines and whitespace
uuid:63e5d8ca-dcac-40af-916b-d32ec3382d0f <-- invalid new lines and whitespace
</wsa:MessageID>
<wsa:ReplyTo>
<wsa:Address xsi:type="xsd:anyURI"> <-- invalid new lines and whitespace
http://www.w3.org/2005/08/addressing/anonymous<-- invalid new lines and whitespace </wsa:Address>
</wsa:ReplyTo>
<-- Missing <wsa:To></wsa:To> element
<wsa:Action xsi:type="xsd:string"> <-- invalid new lines and whitespace
getInactiveVersion <-- should be 'urn:getInactiveVersion'; invalid new lines and whitespace
</wsa:Action>
</wsa> <-- invalid sub-element <wsa>
</soapenv:Header>
<soapenv:Body>
<getInactiveVersion xmlns="http://services.api.platform.vos.cisco.com" xsi:nil="true" />
</soapenv:Body>
</soapenv:Envelope>
The correct version (tested on CUCM 10.5)
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:namesp2="http://www.w3.org/2005/08/addressing" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">
<wsa:MessageID xsi:type="xsd:string">uuid:63e5d8ca-dcac-40af-916b-d32ec3382d0f</wsa:MessageID>
<wsa:ReplyTo>
<wsa:Address xsi:type="xsd:anyURI">http://www.w3.org/2005/08/addressing/anonymous</wsa:Address>
</wsa:ReplyTo>
<wsa:Action xsi:type="xsd:string">urn:getInactiveVersion</wsa:Action>
<wsa:To></wsa:To>
</soapenv:Header>
<soapenv:Body>
<getInactiveVersion xmlns="http://services.api.platform.vos.cisco.com" xsi:nil="true" />
</soapenv:Body>
</soapenv:Envelope>
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide