Forum Stats

  • 3,733,518 Users
  • 2,246,779 Discussions
  • 7,856,750 Comments

Discussions

Hi, i would like to trigger a webservice (purchase Order Service v2) and create a change order

Denrick Jack
Denrick Jack Member Posts: 4
edited April 2018 in Java Cloud Service

I have created a query within fusion to pull the PO and Price information I would need to trigger the webservice. I have also done so successfully using SoapUI, I would love some help in combining the two on Java cloud services. Thanks in advanced for the assistance.

Denrick Jack

Answers

  • SanjeevChauhan
    SanjeevChauhan Member Posts: 1,554 Gold Trophy
    edited April 2018

    I believe you mean that you have created a BI report in fusion and you are able to invoke it using SOAP UI. Now you want to do same thing in JCS.

    SOAP UI is used to test webservice. Yed it provides option to generate java code as well, but we generally don't use that. Instead we use JDev's feature of "Generating web-service proxy".

    You can right click on your project select New. Now select "Web Service Client and Proxy". It will ask for WSDL project. Once wizard is complete you will get java code that can invoke web-service. It will also provide a sample main method in client.java file to show you how to invoke message. You can also select OWSM policy "oracle/wss_username_token_client_policy". This will allow you to set username/password in WS-Security header of web-service.

    https://blogs.oracle.com/practicalbpm/creating-a-web-service-proxy-in-adf-to-consume-a-web-service

    Thanks

    Sanjeev

  • Denrick Jack
    Denrick Jack Member Posts: 4
    edited April 2018

    Actually I am doing two things, I am sorry if I wasn't as clear as I needed to be. I am updating the Price of a PO line in one business unit to the price found in the associated PO in another bu (they are both related and there are flex fields that connect the two).

    Therefore I would need to do two things with the JCS tool.

    A. Get the information from the BI report in fusion

    • I would ideally like the webservice below in B to be fed the information from the report in A and the webservice invoked while Report lines total >0

    B invoke the webservice (purchaseorderservicev2) (ChangePurchaseOrder) to change the price of the purchase order line

    • PO header id, PO Number, PO Line ID and price gotten from the query above in A.

    So the logic would be while PO report lines > 0 then invoke changepurchaseorder.

    thank you for your assistance so far!

  • Denrick Jack
    Denrick Jack Member Posts: 4
    edited April 2018

    hi guys any additional help?

  • Juan S.
    Juan S. Member Posts: 98 Bronze Badge
    edited April 2018

    Hi Djack,

    I can't fully understand your requirement. Is it correct if I state the following?

    - You create a BIP report to fetch a price from one PO, and you need to pass it over to another PO.

    - To achieve the above, you will use the ERP webservice purchaseorderservicev2.

    So you need a trigger mechanism to execute this flow? I mean, you need a way to acknowledge that a PO was changed to refresh the second PO you mentioned. Is this correct?

    If so, you will need to research if there is any way to generate a listener (or trigger) in order to execute a Webservice hosted in your JCS instance (so you will need to create a webservice in your JCS instance). If this is possible the communication sequence between layers would be:

    - From ERP Cloud (or any SaaS service): PO is modified in the ERP and it calls out a webservice hosted in your JCS (request).

    - From your app in JCS: the webservice receives your request and from this point, you will execute the logic you need (such as, execute the BIP report from your app, fetch the value you need and finally call the purchaseorderservicev2 webservice to refresh the values that you wish to refresh).

    I went through the above research a few times, but I couldn't find a mechanism to define a webservice call from SaaS layer to third-party systems. The only thing I could find was this video: https://www.youtube.com/watch?v=zPh8QCCMCzM  . But it's so outdated, that I couldn't follow the procedure in the lastest ERP Cloud versions.

    If all the above it's a dead end, you'll need to go with the poll approach, which is your JCS app calling out your BIP report in a periodic way, let's say every hour, to check if the value that you are "listening", changed or not. From here you will need to follow the flow of your business logic. To do this you have a couple of Java libraries:

    - quartz: it's a java scheduling library (which is the approach I took). If your app is implemented in ADF, think twice before going with this option because ADF and quartz don't get along too well. (DB resources get stuck and eventually, the DB pool limit is reached)

    - Oracle enterprise scheduler: I never tested this approach but in theory the integration between ADF and OES it's solid.

    hope it helps

    Juan

    Denrick Jack
  • Denrick Jack
    Denrick Jack Member Posts: 4
    edited April 2018

    juan,

    the information is filtered because I created the report to only pull the Information for the PO lines that are different in BU1 from that in their associated PO in BU2, so I would simply need to know how to update using the information from the report. The report would not pull anything that does not need updating. You have been a great help, im sorry if im a bit of a noob at this

This discussion has been closed.