Hi Nipuni, +1 on asking to install xmlint as pre-requisites. Please add a check on the shell script and prompt the user to install the package if the xmlint is not present on the OS.
Cheers, Ruwan On Mon, Jan 8, 2018 at 11:50 AM, Nipuni Bhagya <nipu...@wso2.com> wrote: > Adding Sagara and Ruwan. > Can you please share some thoughts on this? > > Thanks, > > On Sun, Jan 7, 2018 at 1:52 PM, Farasath Ahamed <farasa...@wso2.com> > wrote: > >> >> >> On Sunday, January 7, 2018, Rushmin Fernando <rush...@wso2.com> wrote: >> >>> IMO we can ask to install xmllint as a pre-requisite. >>> >> >> I too think its fine to install xmllint as a pre-requisite. Otherwise we >> are overcomplicating our QSG impl by going for complex and error prone >> alternatives rather than doing it in a straight forward manner using >> xmllint. >> >>> >>> >>> Using a regular expression to extract the values from an XML might be >>> error prone since the regular expression is vulnerable to spaces or lines >>> breaks which can be added in future releases. >>> >>> But xmllint is a proper XML parser. So it will work as long the schema >>> is the same. >>> >>> >>> >> >>> On Sat, Jan 6, 2018 at 8:48 PM, Gayan Gunawardana <ga...@wso2.com> >>> wrote: >>> >>>> Please check below approach if it works for your requirement. >>>> >>>> cmd=$(curl -k -H "Authorization: Basic YWRtaW46YWRtaW4=" -H >>>> "Content-Type: text/xml;charset=UTF-8" -H "SOAPAction:urn:getApplication" >>>> -d @get_sp.xml "https://$IP_ADDRESS:$HTTPS_PO >>>> RT_IS/services/IdentityApplicationManagementService?wsdl") >>>> cp /dev/null get_sp_reponse.xml >>>> echo $cmd >> get_sp_reponse.xml >>>> applicationID=$(grep -oP '(?<=ax2199:applicationID>)[^<]+' >>>> "get_sp_reponse.xml") >>>> echo "Service Provider Application ID: $applicationID" >>>> >>>> *get_sp.xml* >>>> >>>> <soapenv:Envelope xmlns:soapenv="http://schemas. >>>> xmlsoap.org/soap/envelope/" xmlns:xsd="http://org.apache.axis2/xsd"> >>>> <soapenv:Header/> >>>> <soapenv:Body> >>>> <xsd:getApplication> >>>> <!--Optional:--> >>>> <xsd:applicationName>SERVICE_PROVIDER_NAME</xsd:application >>>> Name> >>>> </xsd:getApplication> >>>> </soapenv:Body> >>>> </soapenv:Envelope> >>>> >>>> On Fri, Jan 5, 2018 at 5:08 PM, Nipuni Bhagya <nipu...@wso2.com> wrote: >>>> >>>>> Hi all, >>>>> >>>>> I'm writing shell scripts for the IAM Quick Start Guide and currently, >>>>> I'm working on the shell script which automates the configuration of SSO >>>>> with SAML2. I have encountered a problem while trying to get the >>>>> application Id of a service provider in order to perform an update >>>>> operation. >>>>> >>>>> The method I'm using to overcome this at the moment is, >>>>> >>>>> 1. I call the getApplication function in the Identity Application >>>>> Management API >>>>> 2. Write the response to a text file. >>>>> 3. Convert that text file into an XML file. >>>>> 4. grep the value of <ax2140:applicationID> >>>>> >>>>> But the problem with this approach is that I'm using a tool called >>>>> xmllint to >>>>> convert the text to XML format. Since xmllint is not a default Unix >>>>> command >>>>> the users will have to install it on their machines first. As it is not >>>>> appropriate to ask for the user's password while running a script, I can't >>>>> use xmllint and also most of the other approaches available. >>>>> >>>>> So I would really appreciate if someone of you could help me to find a >>>>> better way to achieve this task. >>>>> >>>>> Thank you in advance, >>>>> -- >>>>> >>>>> >>>>> >>>>> *Kind Regards,Nipuni Bhagya* >>>>> >>>>> *Software Engineering Intern* >>>>> *WSO2* >>>>> >>>>> >>>>> >>>>> *Mobile : +94 0779028904 <+94%2077%20767%201807>* >>>>> >>>> >>>> >>>> >>>> -- >>>> Gayan Gunawardana >>>> Senior Software Engineer; WSO2 Inc.; http://wso2.com/ >>>> Email: ga...@wso2.com >>>> Mobile: +94 (71) 8020933 >>>> >>> >>> >>> >>> -- >>> *Best Regards* >>> >>> *Rushmin Fernando* >>> *Technical Lead* >>> >>> WSO2 Inc. <http://wso2.com/> - Lean . Enterprise . Middleware >>> >>> mobile : +94775615183 >>> >>> >>> >> >> -- >> Farasath Ahamed >> Senior Software Engineer, WSO2 Inc.; http://wso2.com >> Mobile: +94777603866 >> Blog: blog.farazath.com >> Twitter: @farazath619 <https://twitter.com/farazath619> >> <http://wso2.com/signature> >> >> >> >> >> > > > -- > > > > *Kind Regards,Nipuni Bhagya* > > *Software Engineering Intern* > *WSO2* > > > > *Mobile : +94 0779028904 <+94%2077%20767%201807>* > > *WSO2Con EU 2017 <https://eu17.wso2con.com/> / WSO2 New York Summit 2017 > <http://wso2.com/summit/newyork-2017>* > -- *Ruwan Abeykoon* *Associate Director/Architect**,* *WSO2, Inc. http://wso2.com <https://wso2.com/signature> * *lean.enterprise.middleware.*
_______________________________________________ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev