Forum Discussion

JorgeGrille's avatar
JorgeGrille
Occasional Contributor
6 years ago
Solved

Receive data with query from Webservice

Hi,

In the WebService I load the general data consulted to a monitoring platform, but then I wanted to receive the data of 
a specific team giving it a label.
For example, this is a piece of code that brings me the general query.
 <xs:complexType name="ipAddress">
<xs:sequence>
<xs:element minOccurs="0" name="created" type="xs:dateTime"/>
<xs:element minOccurs="0" name="hostedOnId" type="xs:string"/>
<xs:element minOccurs="0" name="id" type="xs:string"/>
<xs:element minOccurs="0" name="inInterfaceId" type="xs:string"/>
<xs:element minOccurs="0" name="ipSubnetId" type="xs:string"/>
<xs:element minOccurs="0" name="ipValue" type="xs:string"/>
<xs:element minOccurs="0" name="managementMode" type="ns1:managementMode"/>
<xs:element minOccurs="0" name="modified" type="xs:dateTime"/>
<xs:element minOccurs="0" name="notes" type="xs:string"/>
<xs:element name="prefixLength" type="xs:int"/>
<xs:element minOccurs="0" name="uuid" type="xs:string"/>
</xs:sequence>
</xs:complexType>

Then I would like to give it a value, for example an ip, and to return the data related to that device.
I do not know if i would open for example the field "IpValue" = "value of the IP" , but i do not know how to do it.
For example, I do this search (which I do not know if it is really like that) and it gives me the result of the capture.

A greeting and thanks in advance.
  • richie's avatar
    richie
    6 years ago

    Hey JorgeGrille 

     

    Ok - the xml1.txt file you attached is a .wsdl file - this defines the attributes of a listening SOAP web service (which I always find a bit of a misnomer - SOAP isn't typically used in the web - but anyway....)

     

    I created a new project using this file and it wasn't just get requests in there - you have add/delete/get/update SOAP requests available via the .wsdl -  you mention you're doing a GET - but there are 26/27 different SOAP request types defined in your .wsdl.

     

    you state in your last message the following:

    "From the webservice (SoapUI) I make a query for the Nodes that I have in a monitoring platform. (attachment "capture 1")  

    When making the query, gives me the following information. (attachment doc "xml1").

    I believe that I have to make the following query to take for example the devices of the "Cisco7200" family.

     

    you need to abstract out the info we need to try and explain what you need without the fluff - I still don't know what 'query for the Nodes that I have in a monitoring platform" or "devices of the "Cisco7200" family" actually means

     

    you state "when making the query, gives me the following information (attachment doc "xml1")." - but the image is just the .wsdl that you are viewing - you haven't done a query at this point - the .wsdl file in the screenshot doesn't EVER get submitted to a listening webservice.....that .wsdl IS the listening web service.

     

    Is there anyone where you work to actually assist you at all?  there's a fair portion of theory to API testing that it changes how you use ReadyAPI! or SoapUI and I just don't know if we can explain everything you need.

     

    We can try and help you - but I just don't know if we can explain everything you need via forum.

     

    For example - you've provided the .wsdl but you've given it the wrong extension and your SoapUI instance isn't recognising the file as a .wsdl (if you've loaded in the .wsdl correctly you'd see the 26/27 different SOAP requests defined - it doesn't just have a single GET)

     

    Also - it looks like you are using the trial version of SoapUI.  This means that some of the functionality that really helps make things a lot easier for a beginner won't be available, making the job even harder for you to use SoapUI.

     

    Thanks man,

     

    richie

4 Replies

  • richie's avatar
    richie
    Community Hero

    Hi,

     

    erm.....your post is really confusing so I'll try and help, but you're going to have to provide a little more clarity.

     

    I'll try and describe what I DO understand then hopefully we can work out how to help you

     

    Firstly you say you "load the general data consulted to a monitoring platform" - I don't know what this means.

     

    Then you mention that you want to "receive the data of a specific team giving it a label" - I dont know what this means either.

     

    The 'code' you gave is an excerpt of an XML schema and this bit has a container tag <ipAddress> and within this there are a number of tags - one of them being <ipValue>

     

    From the screenshot you attached I can  see you're submitting a GET request and you have an ipValue Query Parameter on  the request's string.   

     

    BUT the screenshot is kindof confusing - your URI includes a .wsdl reference - but that's SOAP, not REST - and furthermore you don't typically have query parameters for SOAP requests - all the content of the request is typically contained within the URI or body of a SOAP request.

     

    The partial payload I can see in the screenshot - is that the response?  I'm guessing "yes" as this is a GET - but I've seen all sorts recently (POSTs actually doing data retrieval, etc. so I have to ask - also the use of a .wsdl which is atypical for a REST request, so I'm assuming nothing!)

     

    As I say above - in your post you provide an excerpt of the schema that I'm assuming is validating your request - then you follow this with the following text -->"Then I would like to give it a value, for example an ip, and to return the data related to that device. I do not know if i would open for example the field "IpValue" = "value of the IP" , but i do not know how to do it. For example, I do this search (which I do not know if it is really like that) and it gives me the result of the capture."

     

    I don't understand what you mean by any of the sentences above - so can you provide a bit more info as to WHAT you are actually asking please?

     

    In your posts final paragraph - you seem to reference the schema excerpt above it - but you don't alter the schema at all.....the schema is validating your request - if your request doesn't conform to the rules of the schema, you'd expect your request to fail.

     

    Some questions to answer:

     

    1.  Is it SOAP or REST?

    2.  Is it definitely a GET request?

    3.  Can you confirm there is no payload to the request?

    4.  Can you confirm your URI string format/pattern - should it actually have an ipValue Query Parameter? What about all the other parameters described in the schema excerpt?

     

    If you can clarify, we can then try and steer you in the correct direction - but I'm just not sure what you're actually asking!?!?!!

     

    Cheers! :)

     

    richie




    • JorgeGrille's avatar
      JorgeGrille
      Occasional Contributor

      First thank your help.
      Now I have something advanced, but since I have not used WebService I do not know how to work with it.
        From the webservice (SoapUI) I make a query for the Nodes that I have in a monitoring platform. (attachment "capture 1")
        When making the query, gives me the following information. (attachment doc "xml1").

       

      I believe that I have to make the following query to take for example the devices of the "Cisco7200" family.

      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:node="http://node.sdk.nms.ov.hp.com/">
      <soapenv:Header/>
      <soapenv:Body>
      <node:getNodes xmlns:ns1="http://node.sdk.nms.ov.hp.com/">
      <arg0 xsi:type="ns3:expression" xmlns:ns3="http://filter.sdk.nms.ov.hp.com/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <subFilters xsi:type="ns3:condition">
      <name>deviceFamily</name>
      <operator>EQ</operator>
      <value>com.hp.ov.nms.devices.cisco7200seriesrouters</value>
      </subFilters>
      </arg0>
      </node:getNodes>
      </soapenv:Body>
      </soapenv:Envelope>space>

       

      But what I know is where I have to put that data, or how to create that query in the SoapUI.

        Then, what I do not know if I have to do is SOAP or REST (I think it would be REST but I do not know).
        What I do want is to do it with GET.

        Thank you very much for the help.

        Greetings.

      • richie's avatar
        richie
        Community Hero

        Hey JorgeGrille 

         

        Ok - the xml1.txt file you attached is a .wsdl file - this defines the attributes of a listening SOAP web service (which I always find a bit of a misnomer - SOAP isn't typically used in the web - but anyway....)

         

        I created a new project using this file and it wasn't just get requests in there - you have add/delete/get/update SOAP requests available via the .wsdl -  you mention you're doing a GET - but there are 26/27 different SOAP request types defined in your .wsdl.

         

        you state in your last message the following:

        "From the webservice (SoapUI) I make a query for the Nodes that I have in a monitoring platform. (attachment "capture 1")  

        When making the query, gives me the following information. (attachment doc "xml1").

        I believe that I have to make the following query to take for example the devices of the "Cisco7200" family.

         

        you need to abstract out the info we need to try and explain what you need without the fluff - I still don't know what 'query for the Nodes that I have in a monitoring platform" or "devices of the "Cisco7200" family" actually means

         

        you state "when making the query, gives me the following information (attachment doc "xml1")." - but the image is just the .wsdl that you are viewing - you haven't done a query at this point - the .wsdl file in the screenshot doesn't EVER get submitted to a listening webservice.....that .wsdl IS the listening web service.

         

        Is there anyone where you work to actually assist you at all?  there's a fair portion of theory to API testing that it changes how you use ReadyAPI! or SoapUI and I just don't know if we can explain everything you need.

         

        We can try and help you - but I just don't know if we can explain everything you need via forum.

         

        For example - you've provided the .wsdl but you've given it the wrong extension and your SoapUI instance isn't recognising the file as a .wsdl (if you've loaded in the .wsdl correctly you'd see the 26/27 different SOAP requests defined - it doesn't just have a single GET)

         

        Also - it looks like you are using the trial version of SoapUI.  This means that some of the functionality that really helps make things a lot easier for a beginner won't be available, making the job even harder for you to use SoapUI.

         

        Thanks man,

         

        richie