• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Oracle pl/sql ..... soap api question

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    Oracle pl/sql ..... soap api question

    Hi,

    I am trying to extract a value from a soap api request in pl/sql

    variable t_response is an xmltype returned from soap api
    t_response has the following xml value below

    <ns1:wrappedResponse xmlns:ns1 "http://cuk.com/res/cukwebservice/actions/">
    <soapStatus xmlns="http://cuk.com/ccuk/schema" success="true"/>
    </ns1:wrappedResponse>


    I am trying to xtract the value of the attribute success
    I tried something like

    p_value := t_response.extract('/soapStatus@success','xmlns:ns1="http://cuk.com/ccuk/schema"').getStringVal();

    but just kep getting ... ORA-30625: method dispatch on NULL SELF argument is disallowed....

    any clues?

    css_jay99

    #2
    Nothing specific, but I normally just google the error code when I get that sort of gubbins...

    http://www.google.co.uk/search?sourc...=lr%3D&aq=&oq=
    ‎"See, you think I give a tulip. Wrong. In fact, while you talk, I'm thinking; How can I give less of a tulip? That's why I look interested."

    Comment


      #3
      I had already googled but no luck with the issue since the error code is implying that I am passing null/missing xml to the method which I am not



      css_jay99

      Comment


        #4
        Originally posted by css_jay99 View Post
        I am trying to extract a value from a soap api request in pl/sql
        That made me feel a bit
        Originally posted by MaryPoppins
        I'd still not breastfeed a nazi
        Originally posted by vetran
        Urine is quite nourishing

        Comment


          #5
          Originally posted by d000hg View Post
          That made me feel a bit
          Shush, or you'll be locked up again!

          Comment


            #6
            I have absolutely no idea what that even means.
            Originally posted by MaryPoppins
            I'd still not breastfeed a nazi
            Originally posted by vetran
            Urine is quite nourishing

            Comment


              #7
              Shouldn't that be /soapStatus/@success ?

              Comment


                #8
                Originally posted by css_jay99 View Post
                ...

                <ns1:wrappedResponse xmlns:ns1 "http://cuk.com/res/cukwebservice/actions/">
                <soapStatus xmlns="http://cuk.com/ccuk/schema" success="true"/>
                </ns1:wrappedResponse>


                I am trying to xtract the value of the attribute success
                I tried something like

                p_value := t_response.extract('/soapStatus@success','xmlns:ns1="http://cuk.com/ccuk/schema"').getStringVal();

                but just kep getting ... ORA-30625: method dispatch on NULL SELF argument is disallowed....
                ...
                css_jay99
                I think more like

                p_value := t_response.extract('/soapStatus@success','xmlns="http://cuk.com/ccuk/schema"').getStringVal();

                or

                p_value := t_response.extract('/ns1:soapStatus@success','xmlns:ns1="http://cuk.com/ccuk/schema"').getStringVal();

                Isn't the soapStatus element in the "http://cuk.com/ccuk/schema" namespace, so you need to either declare that as the default namespace, or actually use the 'ns1' alias you are defining.

                Also I'd probably be checking that the result of the extract is not null before calling the getStringVal operation (to avoid the error)

                Perhaps...

                Comment


                  #9
                  I''ll give that a try when i get into work

                  cheers

                  css_jay99

                  Comment


                    #10
                    Not sure about any obscure xPath synxtax in PL/SQL, as normally it would be '/soapStatus/@success' so can't comment on the way to access the success attribute.

                    Take a look at http://www.mercatorgeosystems.com/blog/?p=5 which seems to indicate using the '/' before the attribute.

                    Also, as donkey said, don't mess up your namespaces. Use either '/ns1:soapStatus@success' with a namespace declaration of 'xmlns:ns1="http://cuk.com/ccuk/schema' or drop off the namespace declaration altogether.
                    Last edited by Weltchy; 3 November 2009, 07:57. Reason: Because it's early and I don't read other peoples responses to well at 7am

                    Comment

                    Working...
                    X