7 Replies Latest reply: Apr 17, 2012 7:57 AM by 931135 RSS

    calls to soap adapter from transformation xquery in order recongnition rule

    Viktor.Jarolim-Oracle
      Hi experts,
      I am trying to access an external web service from the ORP transformation xquery.
      I am able to do that, however, is there a way to make multiple calls linked to order data?
      E.g. I have n sales order lines in my incoming order and I would like to make a separate call for each, mapping some data from the present order line into the outgoing request.

      I have tried

      for $eachOrderLine in $provisioningOrder/provord:ProvisioningOrderLine
      return
      vf:instance('soap_instance')

      but although there are more occurrences of provord:ProvisioningOrderLine, only one call was made.

      Will appreciate any suggestions.
      regards
      Viktor
        • 1. Re: calls to soap adapter from transformation xquery in order recongnition rule
          user491422 - oracle
          Check your cache settings and input parameters. OSM will by default cache the results of a vf:instance() call - you can disable this in your data provider or data instance if you wish. If the input parameters names/values and adapter name are the same for an existing document instance in cache, then that instance in cache is returned. Otherwise the call to the adapter is made.

          Brian.
          • 2. Re: calls to soap adapter from transformation xquery in order recongnition rule
            Viktor.Jarolim-Oracle
            Hi Brian,
            thanks for your answer; but this is just a part of what I need.

            I am invoking this from the order recognition rule transformation xquery.
            The input for this xquery statement is the incoming order.
            If I have a structure in the incoming order like the following:

            <ITEMS>
            <ITEM>
            <ItemID>123</ItemID>
            <FeatureCode>ABC</FeatureCode>
            </ITEM>
            <ITEM>
            <ItemID>456</ItemID>
            <FeatureCode>DEF</FeatureCode>
            </ITEM>
            </ITEMS>

            Is there a way not just to make a call per each occurrence of ITEM but to map the ItemId from each ITEM into the outgoing call?
            I do not see an abvious way of doing that, the only way I know to access the data from the Xquery input document is by means of { . } in the soap.body instance parameter, but that will always give me the root element of the document..., i.e. one request like


            <GetServiceData>
            <ServiceId>123</ServiceId>
            </GetServiceData>

            and the second request

            <GetServiceData>
            <ServiceId>456</ServiceId>
            </GetServiceData>


            I would appreciate your advise. Thanks for your help.
            Viktor
            • 3. Re: calls to soap adapter from transformation xquery in order recongnition rule
              user491422 - oracle
              Hi Viktor;

              This is available starting with 7.0.3 where the syntax for vf:instance() has been enhanced to allow parameter values to be passed explicitly in on the call to vf:instance().

              For example, if I wanted to invoke an instance called "soap_instance" and pass in a different value for the soap.envelope parameter, I would add an additional argument to the vf:instance call which would be an element named the same as the parameter name (soap.envelope) and whose contents would be the value of that parameter (in this case the soap:Envelope message).

              See below for an example:


              vf:instance('soap_instance',<soap.envelope> <soap:Envelope xmlns:mrns0="http://yahoouserping.webservice.allesta.org" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <mrns0:isUserOnLine> <username xsi:type="soapenc:string">{../user_name/text() }</username> </mrns0:isUserOnLine> </soap:Body> </soap:Envelope> </soap.envelope>)


              Brian.
              • 4. Re: calls to soap adapter from transformation xquery in order recongnition rule
                Viktor.Jarolim-Oracle
                Thanks Brian, this is precisely what I needed.
                I need to look at the new features in 7.0.3 or maybe 7.1.2.
                I appreciate your help.
                Viktor
                • 5. Re: calls to soap adapter from transformation xquery in order recongnition rule
                  user491422 - oracle
                  There is no 7.1.x release of OSM, it's either 7.0.3.x or 7.2 (latest, just released)
                  • 6. Re: calls to soap adapter from transformation xquery in order recongnition rule
                    Viktor.Jarolim-Oracle
                    Hi Brian, sure I meant 7.2, latest & greatest.
                    Viktor
                    • 7. Re: calls to soap adapter from transformation xquery in order recongnition rule
                      931135
                      Hi Brian, I have tested this new capability with 7.0.3b675 which I downloaded from e-delivery.
                      I first wanted to test a simple call not linked to any data, so I used the following syntax:

                      let $dataFromUim := vf:instance(
                      'uim_soap_instance',
                      <soap.body>
                      <soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://xmlns.oracle.com/communications/inventory/webservice/service">
                      <ser:getServiceConfigurationRequest>
                      <expandedResponse>true</expandedResponse>
                      <serviceCriteria>
                      <serviceId>testServiceId</serviceId>
                      </serviceCriteria>
                      </ser:getServiceConfigurationRequest>
                      </soapenv:Body>
                      </soap.body>     
                      )

                      However, I am getting the error below and the web service operation is never called.
                      In order to make sure there was not any syntax error in my expression, I tried the example you gave above as well and had the same error.
                      Also, I checked the delivery notes for both 7.0.3 and 7.2. This enhancement is mentioned in the delivery notes for 7.2, but not mentioned at all in the delivery notes for 7.0.3.
                      Similar with the Developer's Guide, this is only mentioned in the one concerning 7.2, but the syntax given there has one additional parameter without explaining its meaning:

                      log:info($log,local-name(vf:instance($order/oms:GetOrder.Response/oms:_
                      root/oms:data[1],'DataInstance',<oms:url>file://us/catalog.xml</oms:url>)/*[1])),

                      What is the meaning of the first parameter "$order/oms:GetOrder.Response/oms:_root/oms:data[1]"?

                      Thanks for your help.
                      regards
                      Viktor



                      the error:

                      <16-Apr-2012 9:39:57,243 PDT AM> <INFO> <j2ee.c> <[ACTIVE] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)'> <Searching for compatible authentication providers in default security realm - Running>
                      Error
                      Cannot convert from xs:string to org.w3c.dom.Element
                      <16-Apr-2012 9:39:57,418 PDT AM> <ERROR> <rule.XQueryHelper> <[ACTIVE] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)'> <Cannot convert from xs:string to org.w3c.dom.Element. File[null]
                      >
                      net.sf.saxon.trans.XPathException: Cannot convert from xs:string to org.w3c.dom.Element
                           at net.sf.saxon.expr.PJConverter.cannotConvert(PJConverter.java:365)
                           at net.sf.saxon.expr.PJConverter.allocate(PJConverter.java:158)
                           at net.sf.saxon.functions.ExtensionFunctionCall.typeCheck(ExtensionFunctionCall.java:116)
                           at net.sf.saxon.expr.ExpressionVisitor.typeCheck(ExpressionVisitor.java:181)
                           at net.sf.saxon.expr.LetExpression.typeCheck(LetExpression.java:96)
                           at net.sf.saxon.expr.ExpressionVisitor.typeCheck(ExpressionVisitor.java:181)
                           at net.sf.saxon.expr.LetExpression.typeCheck(LetExpression.java:110)
                           at net.sf.saxon.expr.ExpressionVisitor.typeCheck(ExpressionVisitor.java:181)
                           at net.sf.saxon.expr.LetExpression.typeCheck(LetExpression.java:110)
                           at net.sf.saxon.expr.ExpressionVisitor.typeCheck(ExpressionVisitor.java:181)
                           at net.sf.saxon.expr.LetExpression.typeCheck(LetExpression.java:110)
                           at net.sf.saxon.expr.ExpressionVisitor.typeCheck(ExpressionVisitor.java:181)
                           at net.sf.saxon.expr.LetExpression.typeCheck(LetExpression.java:110)
                           at net.sf.saxon.expr.ExpressionVisitor.typeCheck(ExpressionVisitor.java:181)
                           at net.sf.saxon.expr.LetExpression.typeCheck(LetExpression.java:110)
                           at net.sf.saxon.expr.ExpressionVisitor.typeCheck(ExpressionVisitor.java:181)
                           at net.sf.saxon.expr.LetExpression.typeCheck(LetExpression.java:110)
                           at net.sf.saxon.expr.ExpressionVisitor.typeCheck(ExpressionVisitor.java:181)
                           at net.sf.saxon.expr.LetExpression.typeCheck(LetExpression.java:110)
                           at net.sf.saxon.expr.ExpressionVisitor.typeCheck(ExpressionVisitor.java:181)
                           at net.sf.saxon.expr.LetExpression.typeCheck(LetExpression.java:110)
                           at net.sf.saxon.expr.ExpressionVisitor.typeCheck(ExpressionVisitor.java:181)
                           at net.sf.saxon.expr.LetExpression.typeCheck(LetExpression.java:110)
                           at net.sf.saxon.expr.ExpressionVisitor.typeCheck(ExpressionVisitor.java:181)
                           at net.sf.saxon.query.XQueryExpression.<init>(XQueryExpression.java:72)
                           at net.sf.saxon.query.QueryParser.makeXQueryExpression(QueryParser.java:121)
                           at net.sf.saxon.query.StaticQueryContext.compileQuery(StaticQueryContext.java:343)
                           at oracle.communications.ordermanagement.rule.XQueryHelper.compileQuery(Unknown Source)
                           at oracle.communications.ordermanagement.rule.n.a(Unknown Source)
                           at oracle.communications.ordermanagement.rule.v.b(Unknown Source)
                           at oracle.communications.ordermanagement.rule.m.a(Unknown Source)
                           at oracle.communications.ordermanagement.rule.XQueryHelper.transform(Unknown Source)
                           at oracle.communications.ordermanagement.rule.XQueryHelper.transformFromXQuerySource(Unknown Source)
                           at oracle.communications.ordermanagement.rule.XQueryHelper.evaluateXQuery(Unknown Source)
                           at oracle.communications.ordermanagement.rule.XQueryHelper.evaluateXQuery(Unknown Source)
                           at oracle.communications.ordermanagement.rule.XQueryHelper.evaluateXQuery(Unknown Source)
                           at oracle.communications.ordermanagement.rule.a.f(Unknown Source)
                           at oracle.communications.ordermanagement.requestprocessor.d.a(Unknown Source)
                           at oracle.communications.ordermanagement.requestprocessor.d.a(Unknown Source)
                           at oracle.communications.ordermanagement.ws.a.a(Unknown Source)
                           at oracle.communications.ordermanagement.ws.OrderManagementWSPortImpl.createOrder(Unknown Source)
                           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                           at java.lang.reflect.Method.invoke(Method.java:597)
                           at weblogic.wsee.component.pojo.JavaClassComponent.invoke(JavaClassComponent.java:112)
                           at weblogic.wsee.ws.dispatch.server.ComponentHandler.handleRequest(ComponentHandler.java:84)
                           at weblogic.wsee.handler.HandlerIterator.handleRequest(HandlerIterator.java:141)
                           at weblogic.wsee.ws.dispatch.server.ServerDispatcher.dispatch(ServerDispatcher.java:114)
                           at weblogic.wsee.ws.WsSkel.invoke(WsSkel.java:80)
                           at weblogic.wsee.server.servlet.SoapProcessor.handlePost(SoapProcessor.java:66)
                           at weblogic.wsee.server.servlet.SoapProcessor.process(SoapProcessor.java:44)
                           at weblogic.wsee.server.servlet.BaseWSServlet$AuthorizedInvoke.run(BaseWSServlet.java:285)
                           at weblogic.wsee.server.servlet.BaseWSServlet.service(BaseWSServlet.java:169)
                           at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
                           at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
                           at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
                           at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
                           at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
                           at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
                           at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:202)
                           at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
                           at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3588)
                           at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
                           at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
                           at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2200)
                           at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2106)
                           at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1428)
                           at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
                           at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
                      <Apr 16, 2012 9:39:57 AM PDT> <Error> <oms> <BEA-000000> <rule.XQueryHelper: Cannot convert from xs:string to org.w3c.dom.Element. File[null]

                      net.sf.saxon.trans.XPathException: Cannot convert from xs:string to org.w3c.dom.Element
                           at net.sf.saxon.expr.PJConverter.cannotConvert(PJConverter.java:365)
                           at net.sf.saxon.expr.PJConverter.allocate(PJConverter.java:158)
                           at net.sf.saxon.functions.ExtensionFunctionCall.typeCheck(ExtensionFunctionCall.java:116)
                           at net.sf.saxon.expr.ExpressionVisitor.typeCheck(ExpressionVisitor.java:181)
                           at net.sf.saxon.expr.LetExpression.typeCheck(LetExpression.java:96)
                           Truncated. see log file for complete stacktrace
                      >