Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Log in to the WSO2 ESB management console using admin/admin credentials.
  2. Click Main, and then click Proxy Service.
  3. Click Pass Throgh Proxy.
  4. Enter the details as shown below.
    • Enter a name for Proxy Service Name (E.g. PredictMediatirTestProxy).
    • Enter  http://localhost:9000/services/SimpleStockQuoteService  for Target URL.
  5.   Click  Create . You view the proxy service created as shown below.
    proxy services list

    Tip

    Follow the steps below to view the source view of the proxy service configuration you added.

    1. Log in to the WSO2 ESB management console using admin/admin credentials.
    2. Click Main, and then click List in the Services menu.
    3. Click the corresponding Source View link of the WSDL based proxy service you added above. You view its configuration in the source view as follows.

      Code Block
      languagexml
      <?xml version="1.0" encoding="UTF-8"?>
      <proxy xmlns="http://ws.apache.org/ns/synapse"
             name="PredictMediatirTestProxy"
             transports="https,http"
             statistics="disable"
             trace="disable"
             startOnLoad="true">
         <target>
            <inSequence>
               <log level="custom">
                  <property name="before-predict-mediator"
                            expression="fn:concat('ML Mediator Prediction : ',get-property('result'))"/>
               </log>
               <predict>
                  <model storage-location="/Users/praneesha/Documents/Product_Packs/ML/wso2ml-1.0.0-SNAPSHOT/samples/ml-model-usage/src/main/resources/downloaded-ml-model"/>
                  <features>
                     <feature name="SI2" expression="$body/features/SI2"/>
                     <feature name="PG2" expression="$body/features/PG2"/>
                     <feature name="Age" expression="$body/features/Age"/>
                     <feature name="DBP" expression="$body/features/DBP"/>
                     <feature name="BMI" expression="$body/features/BMI"/>
                     <feature name="DPF" expression="$body/features/DPF"/>
                     <feature name="TSFT" expression="$body/features/TSFT"/>
                     <feature name="NumPregnancies" expression="$body/features/NumPregnancies"/>
                  </features>
                  <predictionOutput property="result"/>
               </predict>
               <log level="custom">
                  <property name="after-predict-mediator"
                            expression="fn:concat('ML Mediator Prediction : ',get-property('result'))"/>
               </log>
               <drop/>
            </inSequence>
            <outSequence>
               <send/>
            </outSequence>
            <endpoint>
               <address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
            </endpoint>
         </target>
         <description/>
      </proxy>                    

...

  1. Log in to the WSO2 ESB management console using admin/admin credentials.
  2. Click Main, and then click List in the Services menu.
  3. Click the corresponding Try this service link of the proxy service (i.e. PredictMediatorTestProxy) you added as shown below.
    try this proxy service
  4. Enter the following XML message as the Request as shown below.

    Code Block
    languagexml
    <features xmlns:ns="http://ws.apache.org/axis2">
        <NumPregnancies>1</NumPregnancies>
        <TSFT>30</TSFT>
        <DPF>0.529</DPF>
        <BMI>34.6</BMI>
        <DBP>70</DBP>
        <PG2>115</PG2>
        <Age>32</Age>
        <SI2>96</SI2>
    </features>

    add request in the try it
    You view the output of the Log mediators in the CLI in which you ran WSO2 ESB server as shown below.

    output logs in the CLI

Info

If you are using a deep learning model to make predictions without H2O runtime, see Using Deep Learning Models without H2O Runtime.