Announcement Announcement Module
Collapse
No announcement yet.
No exception? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • No exception?

    Hi,

    We have an object which contains a Date property: java.util.Date myDate.

    Using soap-ui, an invalid date is injected: <myDate>BAD-DATE</myDate>

    During unmarshaling, an exception was thrown when the unmarshaller tries to parse the bad date string. However, this exception never "bubble" up and back to the client. I only "saw" the exception in the debugger.

    Any one knows how to "unhide" this exception?

    Please let me know if you need more details.

    Thank you.

  • #2
    A simple example:

    Code:
    @WebService
    public interface MyService {
        public void foo(java.util.Date d);
    }
    
    @WebService(...snip...)
    public class MyServiceImpl implements MyService {
        public void foo(java.util.Date d) {
            System.out.println("d=" + d);
        }
    }
    Using soapUI

    Code:
    <soapenv:Envelope ...snip...>
       <soapenv:Header/>
       <soapenv:Body>
          <apis:foo>
             <arg0>2009-06-12T12:40:30.767-04:00</arg0>
          </apis:foo>
       </soapenv:Body>
    </soapenv:Envelope>
    will print d=Fri Jun 12 12:40:30 EDT 2009

    and

    Code:
    <soapenv:Envelope ...snip...>
       <soapenv:Header/>
       <soapenv:Body>
          <apis:foo>
             <arg0>BAD-DATE</arg0>
          </apis:foo>
       </soapenv:Body>
    </soapenv:Envelope>
    will print d=null

    instead of throwing an unmarshalling exception.

    My quest is to make it throw exception.

    Any help? Thanks.

    Comment


    • #3
      No exception?

      Originally posted by chacs View Post
      A simple example:

      Code:
      @WebService
      public interface MyService {
          public void foo(java.util.Date d);
      }
      
      @WebService(...snip...)
      public class MyServiceImpl implements MyService {
          public void foo(java.util.Date d) {
              System.out.println("d=" + d);
          }
      }
      Using soapUI

      Code:
      <soapenv:Envelope ...snip...>
         <soapenv:Header/>
         <soapenv:Body>
            <apis:foo>
               <arg0>2009-06-12T12:40:30.767-04:00</arg0>
            </apis:foo>
         </soapenv:Body>
      </soapenv:Envelope>
      will print d=Fri Jun 12 12:40:30 EDT 2009

      and

      Code:
      <soapenv:Envelope ...snip...>
         <soapenv:Header/>
         <soapenv:Body>
            <apis:foo>
               <arg0>BAD-DATE</arg0>
            </apis:foo>
         </soapenv:Body>
      </soapenv:Envelope>
      will print d=null

      instead of throwing an unmarshalling exception.

      My quest is to make it throw exception.

      Any help? Thanks.
      You should take help of google..

      Comment

      Working...
      X