Results 1 to 3 of 3

Thread: No exception?

Hybrid View

  1. #1
    Join Date
    Nov 2004
    Posts
    9

    Default 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. #2
    Join Date
    Nov 2004
    Posts
    9

    Default

    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.

  3. #3
    Join Date
    Jan 2011
    Location
    India
    Posts
    1

    Default No exception?

    Quote 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..
    Mart Grazer
    Gurgaon

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •