Forum Discussion

DW's avatar
DW
Occasional Contributor
9 years ago

Testing via a ESB, adding name space?

I'm trying to do a proof of concept around using SoapUI within our orgnisation. We have a REST service that simply returns a reference number so should be very easy to test.

 

This works in Fiddler, request body below, but how do I get this to work in SoapUI? I've added the blue parts of the body as parameters but I get 'Object reference not set to an instance of an object.' which according to the developer (who's too busy to help at the moment) is because all our services are behind a service bus. Would adding the namespace help - and if so how do I do that?

 

Thanks

D

 

<?xml version="1.0" encoding="utf-8"?><GetWorkReferenceIdRequest xmlns="http://xxxxxxx">
  <MessageHeader xmlns="http://xxxxxxxx">
    <MessageId>1234</MessageId>
    <InitiatorId>122343</InitiatorId>
    <ServerName>12123</ServerName>
    <BusinessProcessName>123</BusinessProcessName>
    <BusinessProcessId>123</BusinessProcessId>
    <DateTimeStamp>0001-01-01T00:00:00</DateTimeStamp>
    <ProcessHeader>
      <MessageStatus>Success</MessageStatus>
      <Details>
      </Details>
    </ProcessHeader>
  </MessageHeader>
</GetWorkReferenceIdRequest>

 

 

7 Replies

  • rupert_anderson's avatar
    rupert_anderson
    Valued Contributor

    Hi,

     

    It sounds like the issue you are facing is likely to be related to the particulars of your service's ESB setup, as the error message doesn't seem like a security issue e.g. authentication or SSL certificate related.

     

    I don't see any reason why SoapUI cannot be used to test this service assuming that you are able to fire a valid request, do you have any way to capture or obtain a valid request the the service from anywahere else e.g. debug from a working client system or possibly a sample request from that busy developer? 

     

    That way you should be able to fire the valid request from SoapUI and hopefully get a succesful response and then maybe understand what is missing from your original request. Aside from providing any namespaces (which you seem to have examples of in your sample), those message header elements could also be wrong / missing e.g. maybe your ESB has issufficient / wrong data and is unable to route your request to the intended service.

     

    Hope this helps,

     

    Cheers,

    Rupert

    • DW's avatar
      DW
      Occasional Contributor

      Thanks for the thoughts Rupert, I have a meeting next week with one of the devs to try and go through some of this.

       

      How do I get the namespaces in to the SoapUI request? I've tried searching but can't find it anywhere.

      D

      • rupert_anderson's avatar
        rupert_anderson
        Valued Contributor

        Hi,

         

        No problem.

         

        Well, again this is not really a SoapUI thing, as SoapUI will dispatch any request XML content you want.

         

        In terms of namespaces, I can see that some of your elements already have namespaces defined e.g.

         

        <MessageHeader xmlns="http://xxxxxxxx">

         

        If you mean how to you define a namespace prefix, then you can do things like:

         

        <h:table xmlns:h="http://www.w3.org/TR/html4/">
          <h:tr>
            <h:td>Apples</h:td>
            <h:td>Bananas</h:td>
          </h:tr>
        </h:table>

         

        (Example taken from http://www.w3schools.com/xml/xml_namespaces.asp)

         

        So basically, you are already using namespaces and namespaces of any standard type can be used in the REST request body as you seem to have done already. Does that make sense and is what you were asking?

         

        Cheers,

        Rupert