Skip to content

XAware Community

Get the Flash Player to see this player.
Flash Image Rotator Module by Joomlashack.
XAware 5.6
Need Help
Webinars and Events
Advanced Tutorials
Webinars and Events

You are here: Home arrow Blogs

Web ServicesData Integration 11 Dec 2007 5:39 PM
avatar
Enterprise grade Mashup's - Dream or Reality? by jpeters

I just posted this comment on an interesting subject over on Keith Fahlgren's blog, http://www.oreillynet.com/xml/blog/2007/12/xml_conf_2007_third_day.html, about Mashups. The details on the presentation can be viewed at http://2007.xmlconference.org/public/schedule/detail/342 , so I thought I'd repost here for our own community to see how XAware enables Mashups.

________________________________________________

Unfortunately, I was stuck in Colorado Springs (not so bad) and was unable to attend XML2007. While reviewing some of the blog posts from the XML2007 Conference and Exposition, I came across one event, Enterprise grade Mashup's - Dream or Reality?, that really caught my eye. I was wondering if anyone attended the presentation and had any comments.

As I read through the article about Mashup's, I kept thinking WOW...we do that and WOW...we do that. I would like to answer the question Dream or Reality? XAware, Inc.'s OSS brings an outstanding Enterprise grade Mashup to the table for anyone looking at creating, deploying, and consuming Web services.

 Not only can XAware create and consume web services, but anyone can take a WSDL and create a SOAP BizComponent in mere minutes. Create a BizDocument and expose it as a WEB Service, yes XAware does that too. The Web Service can access databases, write to files, transport data via JMS, MQ, email, and FTP, the web service data can be transformed with XSL or be mapped to other structures or ....the possibilities for mashing the data are endless.

XAware can execute Javascript, Java programs, or functoids against the data to further mash the data. Once the data is truly mashed and re-mashed, you may display the data to the user through several APIs or simply update a database or write out a file or ....

 I could go on and on about the XAware Mashup, but try it for yourself (http://www.xaware.org/content/view/60/527/) and start mashing. I would say that Enterprise grade Mashup's are a Reality today with XAware.

Again, I'm interested on feedback from the presentation.

_______________________________________________

 

Now for those reviewing this blog, I'll give you some examples. Below is the use case:

 

Hit a web service and retrieve a picture (I chose this since there were some comments about blobs on the Forum) and mash that picture with xml data retrieved from an external source. I chose to pass in the data as input xml to the BizDocument. Then write this data to a database. Query the blob (picture) from the database and write it out to a file.

 

Simple!

 

Note: It took me longer to write this blog than it did to create this mashup example.

Below is the parent BizDocument which calls a SOAP BizComponent to (Get the picture), a SQL BizComponent to insert the picture and input xml data, a  BizDocument (nested) which calls a SQL BizComponent to query the data inserted into the table, and a File BizComponent to write out the picture to a file.

 

<?xml version="1.0" encoding="UTF-8"?>

<Document xmlns:xa="http://xaware.org/xas/ns1" xa:version="5.0" xa:on_error="xa-doc::/Document/Error" xa:visible="yes">

    <Element1 xa:bizcomp="Examples/soap_get_picture.xbc" xa:remove="yes" getMimeImageJPEG="" />

    <Element2 xa:bizcomp="Examples/sql_insert_picture_and_data.xbc" xa:input="xa-input::/EMPS/EMP" xa:remove="yes" picture="%xa-doc::/Document/Element/xa:mime_content%" />

    <Element3 xa:bizdoc="Examples/select_pic_and_data.xbd" xa:remove="yes" />

    <Element4 xa:bizcomp="Examples/write_picture.xbc" xa:remove="yes" content="%xa-doc::/Document/Document/Element/PICTURE%" />

    <Error xa:include="no">

        <detail>$xavar:error_stack$</detail>

    </Error>

</Document>

 

SOAP BizComponent to (Get the picture)

 

<?xml version="1.0" encoding="UTF-8"?>

<SOAP xmlns:xa="http://xaware.org/xas/ns1" xa:bizdriver="Examples/get_picture.xdr" xa:bizcomptype="SOAP" xa:default_name="soap" xa:on_soap_fault="error" xa:response_type="Element">

    <xa:input>

        <xa:param xa:name="getMimeImageJPEG" xa:datatype="anyType" xa:default="" xa:description="" />

    </xa:input>

    <xa:description />

    <xa:request xa:soapAction="" xa:output_type="xml" xa:soapStyle="document" xa:soapUse="literal">

        <SOAPENV:Envelope xmlns:SOAPENV="http://schemas.xmlsoap.org/soap/envelope/">

            <SOAPENV:Body>

                <xsd:getMimeImageJPEG xmlns:xsd="http://SwaTestService.org/xaware/doc_lit/xsd">%getMimeImageJPEG%</xsd:getMimeImageJPEG>

            </SOAPENV:Body>

        </SOAPENV:Envelope>

        <xa:return>

            <xa:mime_multipartRelated>

                <xa:mime_part>

                    <SOAPENV:Envelope xmlns:SOAPENV="http://schemas.xmlsoap.org/soap/envelope/">

                        <SOAPENV:Body />

                    </SOAPENV:Envelope>

                </xa:mime_part>

                <xa:mime_part>

                    <xa:mime_content part="attachment" type="image/jpeg" encoding="hexBinary" />

                </xa:mime_part>

            </xa:mime_multipartRelated>

        </xa:return>

    </xa:request>

    <xa:design>

        <xa:wsdl xa:operation="getMimeImageJPEG" />

    </xa:design>

    <xa:response>

        <Element xa:copy="xa-results::xa:mime_multipartRelated/xa:mime_part/xa:mime_content" />

    </xa:response>

 

SQL BizComponent to insert the picture and input xml data (Note the parameter picture is used to pass in the binary content)

 

<?xml version="1.0" encoding="UTF-8"?>

<sql xmlns:xa="http://xaware.org/xas/ns1" xa:bizcomptype="SQL" xa:bizdriver="Examples/sql.xdr" xa:response_type="Element">

    <xa:description />

    <xa:input>

        <xa:param xa:name="picture" xa:datatype="string" xa:description="content need to be written" />

    </xa:input>

    <xa:request xa:oper="insert" xa:table="QADB.dbo.BLOBTEST">INSERT INTO

  QADB.dbo.BLOBTEST (LNAME, FNAME, MI, CITY, ADDRESS, ZIP, REGION, PICTURE)

VALUES

  (?, ?, ?, ?, ?, ?, ?, ?)</xa:request>

    <xa:where />

    <xa:merge_template>

        <Element />

    </xa:merge_template>

    <xa:column_map>

        <LNAME xa:sql_type="12" xa:sql_type_name="varchar" xa:column_class="java.lang.String">%xa-input::/EMP/Last%</LNAME>

        <FNAME xa:sql_type="12" xa:sql_type_name="varchar" xa:column_class="java.lang.String">%xa-input::/EMP/First%</FNAME>

        <MI xa:sql_type="12" xa:sql_type_name="varchar" xa:column_class="java.lang.String">%xa-input::/EMP/Middle%</MI>

        <CITY xa:sql_type="12" xa:sql_type_name="varchar" xa:column_class="java.lang.String">%xa-input::/EMP/City%</CITY>

        <ADDRESS xa:sql_type="12" xa:sql_type_name="varchar" xa:column_class="java.lang.String">%xa-input::/EMP/Address%</ADDRESS>

        <ZIP xa:sql_type="12" xa:sql_type_name="varchar" xa:column_class="java.lang.String">%xa-input::/EMP/ZIP%</ZIP>

        <REGION xa:sql_type="12" xa:sql_type_name="varchar" xa:column_class="java.lang.String">%xa-input::/EMP/Region%</REGION>

        <PICTURE xa:sql_type="-4" xa:sql_type_name="image" xa:column_class="[B">%picture%</PICTURE>

    </xa:column_map>

 

BizDocument which calls a SQL BizComponent to query the data inserted into the table

<?xml version="1.0" encoding="UTF-8"?>

<Document xmlns:xa="http://xaware.org/xas/ns1" xa:version="5.0" xa:on_error="xa-doc::/Document/Error" xa:visible="yes">

    <xa:input />

    <Element xa:bizcomp="Examples/select.xbc" xa:remove="yes" />

    <Error xa:include="no">

        <detail>$xavar:error_stack$</detail>

    </Error>

</Document>

 

<?xml version="1.0" encoding="UTF-8"?>

<sql xmlns:xa="http://xaware.org/xas/ns1" xa:bizcomptype="SQL" xa:bizdriver="Examples/sql.xdr" xa:response_type="Element">

    <xa:input />

    <xa:description />

    <xa:request xa:oper="select">SELECT

  QADB.dbo.BLOBTEST.LNAME,

  QADB.dbo.BLOBTEST.FNAME,

  QADB.dbo.BLOBTEST.MI,

  QADB.dbo.BLOBTEST.CITY,

  QADB.dbo.BLOBTEST.ADDRESS,

  QADB.dbo.BLOBTEST.ZIP,

  QADB.dbo.BLOBTEST.REGION,

  QADB.dbo.BLOBTEST.PICTURE

FROM

  QADB.dbo.BLOBTEST</xa:request>

    <xa:where />

    <xa:row_template>

        <Element>

            <LNAME>%LNAME%</LNAME>

            <FNAME>%FNAME%</FNAME>

            <MI>%MI%</MI>

            <CITY>%CITY%</CITY>

            <ADDRESS>%ADDRESS%</ADDRESS>

            <ZIP>%ZIP%</ZIP>

            <REGION>%REGION%</REGION>

            <PICTURE>%PICTURE%</PICTURE>

        </Element>

    </xa:row_template>

 

 

File BizComponent to write out the picture to a file.

 

<?xml version="1.0" encoding="UTF-8"?>

<FILETEST xmlns:xa="http://xaware.org/xas/ns1" xa:bizcomptype="FILE" xa:bizdriver="Examples/write.xdr">

    <xa:input>

        <xa:param xa:name="content" xa:datatype="string" xa:description="content need to be written" />

    </xa:input>

    <xa:request>

        <xa:content xa:datatype="binary">%content%</xa:content>

    </xa:request>

</FILETEST>

 

<?xml version="1.0" encoding="UTF-8"?>

<xa:bizDriver xmlns:xa="http://xaware.org/xas/ns1" xa:bizdrivertype="FILE" xa:version="5.0">

    <xa:input />

    <xa:description />

    <xa:file>

        <xa:name>C:\TestCases\Examples\picture.jpg</xa:name>

        <xa:request_type>write</xa:request_type>

    </xa:file>

</xa:bizDriver>

Just another note, I did all of all this work with the free 5.0 OSS BETA version of XAware. I did leave out a couple of drivers since they contain usernames and passwords. If you have any problems with the drivers, let me know.

 

 



Trackback(0)
Comments (0)add comment

Write comment
You must be logged in to a comment. Please register if you do not have an account yet.

busy

Get the Flash Player to see this player.
Flash Image Rotator Module by Joomlashack.
Commercial
Free Training
QuickStart Packages
Image 4 Title
Image 5 Title

Polls

Which data source and BizComponent combinations do you most frequently use?
 

Blogs

Recent Entries

Visit XAware.com