4 Replies Latest reply on Sep 19, 2007 8:57 AM by thomas.diesler

    how to return an empty http response instead of soapmessage

    kukeltje

      Hi,

      I'm implementing an ebMS 2.0 Message Service Handler with JBossWS 2.0.0 and related frameworks. According to the ebMS 2.0 spec, In all cases a soapmessage is received and in many cases a soapmessage has to be returned. Therefor I choose the 'message' way of communicating. However in some cases an empty response (no soapmessage, just an http 200 ok) has to be returned. First thing I tried was returning 'null' hoping that would do the trick. Unfortunately it didn't.

      I can do several things now
      - do not use the 'message' way but start using the source
      - try something with a soaphandler by e.g. setting the messagecontext to null
      - return a basic soapmessage and write a servletfilter that deletes this if it encounters it


      The first option would result in to much coding (imo), the second might not work and the last one doesn't feel 'right'

      Does anybody have a different suggestion?

        • 1. Re: how to return an empty http response instead of soapmess
          romeufigueira

          I had a similiar problem to the one you're having, but instead of a simple "http 200 ok" message I needed the actual empty SOAPMessage to be returned, like this one:

          <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
           <env:Header/>
           <env:Body>
           <urn:createResponse xmlns:urn="urn:integration"/>
           </env:Body>
          </env:Envelope>


          To make the actual message above, all I had to do was to match a void type of function return with the following WSDL mapping for it's return (in this case a void return):
          <message name="IIntegrationWS_createResponse"/>


          If you should eliminate the above line then a single reply will be sent with the "http 200 ok" will be sent, therefore acting as a return receipt on an async call.

          Last reference to be made about this is that this works at least in the JBossWS 1.0.4

          • 2. Re: how to return an empty http response instead of soapmess
            kukeltje

            thanks, but I do not need or have a wsdl. Besides that, creating and returning an empty soapmessage is not a problem. That is in code also one line. Removing/not sending it is the problem.

            What I forgot to mention is that I need both on the same url and can only use a value in the message to detect what I should return.

            • 3. Re: how to return an empty http response instead of soapmess
              kukeltje

              A handler works for filtering out the soapenvelope. So that is fairly easy.

              Now I have to do it the other way around. Send out a soapmessage and expect just an empty http 200 response without any body. Maybe the dispatch invokeOnWay can do this but I'm not sure. Strange that there is no receiveOneWay.... or an option to direct this.

              If all works, I'll post the example.

              • 4. Re: how to return an empty http response instead of soapmess
                thomas.diesler

                How about a using oneway endpoint