Add custom authentication header to SOAP Webservice

<p style="font-size:15px;color:rgb(34,36,38);font-family:Arial, 'Helvetica Neue', Helvetica, sans-serif;">I'm using BIRT 4.3.1 and my datasource is a Webservice. Authentication is done by Josso and JOSSOID is available at my report.</p>
<p style="font-size:15px;color:rgb(34,36,38);font-family:Arial, 'Helvetica Neue', Helvetica, sans-serif;">I've tried to call this Webservice by SoapUi adding JOSSOID in the header. But I need to know how to do it by BIRT. I use a BIRTEclipse to edit/view the report itself.</p>
<p style="font-size:15px;color:rgb(34,36,38);font-family:Arial, 'Helvetica Neue', Helvetica, sans-serif;">I've searched something about WSSE but this protocol needs the username and password and I have just JOSSOID.</p>
<p style="font-size:15px;color:rgb(34,36,38);font-family:Arial, 'Helvetica Neue', Helvetica, sans-serif;">How could I add a custom header to this HTTP Request?</p>

Comments

  • <p>Since you have not included your report design or a sample design, I'm assuming that you are using the "Web Services Data Source".</p>
    <p> </p>
    <p>When you define your Data Set, in the step where you define the "SOAP Request", you'll have the opportunity to change the SOAP request and add a header, for example.  Then, you can select "Edit Parameter..." from the same dialog box to bind these to the appropriate parameter variables.</p>
    <p> </p>
    <p>For example, here I'm using the Actuate IDAPI getFolderItems SOAP (reference @ <a data-ipb='nomediaparse' href='http://developer.actuate.com/be/documentation/ihub2-web/iHub/serverapi/using-encyc.06.31.html).'>http://developer.actuate.com/be/documentation/ihub2-web/iHub/serverapi/using-encyc.06.31.html).</a></p&gt;
    <p> </p>
    <p>I have added a <SOAP-ENV:Header> section to the SOAP Request, where I have included two dynamic parameters.</p>
    <pre class="_prettyXprint">
    <?xml version="1.0"?>
    <SOAP-ENV:Envelope
    xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
        <SOAP-ENV:Header>
            <AuthId>&?authId?&</AuthId>
            <TargetVolume>&?TargetVolume?&</TargetVolume>
            <Locale>en_US</Locale>
        </SOAP-ENV:Header>    
        <SOAP-ENV:Body>
            <m:GetFolderItems xmlns:m="http://schemas.actuate.com/actuate11">
                <m:FolderName>&?Folder?&</m:FolderName>
                    <m:ResultDef>
                        <m:String>Name</m:String>
                        <m:String>TimeStamp</m:String>
                        <m:String>Description</m:String>
                        <m:String>FileType</m:String>
                 </m:ResultDef>
            </m:GetFolderItems>
        </SOAP-ENV:Body>
    </SOAP-ENV:Envelope></pre>
    Warning No formatter is installed for the format ipb
  • <p>Dear Clement,</p>
    <p> </p>
    <p>  I have made it work with web service to get the data and populating in reports. But I am hardcoding the webservice address in report, which is wrong because every time i have change for UAT and Production separately.</p>
    <p> </p>
    <p> Please provide me any example or way how to externalize in webserive address from property file and read it in report.</p>
    <p> </p>
    <p>:Thanks in Advance</p>
  • <p>What Data Source type are you using?  Scripted Data Source, or Web Services Data Source?</p>
    <p> </p>
    <p>How about use it as a parameter so that when it's in production, you won't need the extra step of reading a file before each execution?  It is possible to read a file, but it will require scripting.</p>
    <p> </p>
    <p>For Web Services Data Source, first create a parameter, and give it a default value for now of 'UAT'.</p>
    <p> </p>
    <p>Then, in the Edit Data Source dialog, click on <strong>Property Binding</strong> in the left pane.</p>
    <p> </p>
    <p>Next, for the SOAP Endpoint, create a new expression like this:</p>
    <pre class="_prettyXprint _lang-">
    if (params["env"].value == '') 'http://production-endpoint';
    else 'http://uat-endpoint';
    </pre>
    Warning No formatter is installed for the format ipb
  • gangadhar15
    edited June 7, 2017 #5
    <p>Dear Clement,</p>
    <p> </p>
    <p>  Sorry for the late reply.</p>
    <p> </p>
    <p>  I am using Webserive data source and made it work with Profiling. I have first exported the datasource and have that as a base file for property. And copied that property file in the server and made it work.</p>
    <p> </p>
    <p>And also the above solution will be not accepted by many customers for security reasons. Because customer while checking the xml of the rptdeisgn they dont want to expose the webserive address in the rptdesign.</p>
    <p> </p>
    <p> </p>
    <p> </p>
    <p>Thank you for the help.</p>