I am using the Experian QAS Pro for Address validation and am having a problem getting my calls to work. I used a SOAP plugin (Chrome Wizdler) and did successfully submit a call, but something in Apex land is making things slightly different when I do the callout from Salesforce, which is resulting in an authentication failure. I used FuseIT SFDC Explorer to import the WSDL, along with some manual tweaks I have documented below. Here is the message that does work, generated by Wizdler:
<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/"> <Header> <QAQueryHeader xmlns="http://www.qas.com/OnDemand-2011-03"> <QAAuthentication> <Username>myusername</Username> <Password>mypassword</Password> </QAAuthentication> <Security> </Security> </QAQueryHeader> </Header> <Body> <QACanSearch xmlns="http://www.qas.com/OnDemand-2011-03"> <Country>AUS</Country> <Engine/> <Layout>qaDefault</Layout> </QACanSearch> </Body> </Envelope>
And here's the message generated by the Salesforce Apex code that gets an authentication failure. You can see that instead of having the element name "QAQueryHeader", it has "query_header". I guess that's the problem. Just not sure about the fix.
<?xml version="1.0" encoding="UTF-8"?> <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <env:Header> <query_header xmlns="http://www.qas.com/OnDemand-2011-03"> <QAAuthentication> <Username>myusername</Username> <Password>mypassword</Password> </QAAuthentication> <Security/> </query_header> </env:Header> <env:Body> <QACanSearch xmlns="http://www.qas.com/OnDemand-2011-03"> <Country>AUS</Country> <Engine/> <Layout>QaDefault</Layout> </QACanSearch> </env:Body> </env:Envelope>
I made two changes to the code generated from the WSDL. Firstly, I deleted 10 duplicate instances of the following 4 lines inside the subclass wwwQasComOndemand201103.PortType:
private String information_header_hns = 'information_header=http://www.qas.com/OnDemand-2011-03'; public wwwQasComOndemand201103.QAQueryHeader query_header; private String query_header_hns = 'query_header=http://www.qas.com/OnDemand-2011-03'; public wwwQasComOndemand201103.QAInformation information_header;
Secondly, I changed this declaration inside the wwwQasComOndemand201103.EngineType subclass to be of type String. Given the successful and failing versions of the SOAP message both generate the same empty XML Engine element, I don't think that this is causing a problem.
public wwwQasComOndemand201103.EngineEnumType input;