Search code examples
soapwsdlmaximo

Maximo Web Service Data Filter


I've created an enterprise web service in maximo that uses extsys1. In extsys1 I've created a duplicate of MXPERSONInterface and managed to create a query from it (sync was default). Now when I finished my web service I can succesfully query maximo from soap ui client and get all the person data but what I'd like to know is, can I select which data I want to export in my response ? Like...ignoring everything except name/lastname/email or anything like that.

If anyone did that / knows how with any other mbo any help would be very much appriciated. The thing is I don't want all the raw data being in my response, want to make it as much user-friendly as I can.


Solution

  • There is a way to do import/export of data via Web Services that are dynamically accessed from external applications.

    Another thing to note when you're accessing pre-defined object structures in this way is that the response will always contain every single field that exists in that object structure.

    I will write down a brief tutorial on how to filter that data so that when you query your object structure you only get a partition of the data in the response.

    For the sake of this tutorial I will use MXPERSON and will export Firstname, Lastname, City, Country and Postalcode.

    First go to Integration > Object Structures > Create New Object Structure. Name it My_MXPERSON, set to be consumed by INTEGRATION, set Authorized application PERSON and add new row for Source Objects and select Person from object list. Now you can go to More Actions > Include/Exclude Fields. Here you should un-check everything except Firstname, Lastname, City, Country and Postalcode (only them need to be CHECKED). Click save.

    Now we need to create an enterprise service by going to Inegration > Enterprise Services > New Enterprise Service. Call your service My_MXPERSON_ES, for Operation set QUERY and for Object Structure select your My_MXPERSON you created earlyer. Click save.

    Next thing is to create a publish channel by going Integration > Publish Channels > New Publish Channel. Name it My_MXPERSON_PC and for Object Structure select your My_MXPERSON (If you can't find it on the list go to your Object structure and uncheck "Query Only" box. Click save.

    Now you have everything set up to create your external system. Integration > External Systems > New External System. name it My_MXPERSON_EXTSYS, set End Point to which format you want your response to be in, I use MXXMLFILE. On the left side you have 3 typees of queue you need to set up, I have 1 option for first 2 and 2 for last one (select the upper one - ends with cqin). Check Enabled. Within your External System go to Publish Channels and Select your My_MXPERSON_PC, enable it. Within your External System go to Enterprise Services and Select your My_MXPERSON_ES, enable it it. Click save.

    Last thing you need to do before you're done is to create your web service, go to Integration > Web Services > New Web Service from Enterprise Service. Name it My_MXPERSON_Query, and select from list My_MXPERSON_EXTSYS_My_MXPERSON_ES, select your Web Service from the list and go to more actions > deploy.

    Once your Web Service is deployed you can access the wsdl file from servername/meaweb/wsdl/webservicename.wsdl .

    For test here we will use SoapUI to test the wsdl file. Create a new Soap project and copy / paste the url of the wsdl file. If it loads succesfully paste this in the xml request field.

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:max="http://www.ibm.com/maximo">
       <soapenv:Header/>
       <soapenv:Body>
          <max:QueryMy_MXPERSON baseLanguage="EN" transLanguage="EN">
             <max:My_MXPERSONQuery>
                <max:PERSON>
                   <max:Firstname> Name you want to query </max:Firstname>
                </max:PERSON>
             </max:My_MXPERSONQuery>
          </max:QueryMy_MXPERSON>
       </soapenv:Body>
    </soapenv:Envelope>
    

    Remember to swap "Name you want to query" with the actual name in your table. Hope this guide helped.