Page 1 of 1

About Question enthuware.ocejws.v6.2.167 :

Posted: Tue Nov 04, 2014 2:06 am
by austinor
For the question:

Code: Select all

We have a Web Service that requires Addressing headers to be present in all requests. 

@Addressing(required=true) 
@WebService 
public class MathTableImpl implements MathTableService {

   @Override
    public SimpleMathTable getTable(Integer number) throws NegativeNumberException {
       if (number < 0) {
          throw new NegativeNumberException("Number cannot be negative");
       }
       SimpleMathTable table = new SimpleMathTable(number);
       return table;
    }
} 

The Web Service is injected in a client. What is the correct code to enable Addressing?
Correct answer:

Code: Select all

@Stateless 
public class MyClient {

    @Addressing
    @WebServiceRef( MathTableImplService.class )
    private MathTableService service;
    ... 
}
The proxy type (or portType class) should be "MathTableImpl" and not "MathTableService"? =)

Re: About Question enthuware.ocejws.v6.2.167 :

Posted: Tue Nov 04, 2014 1:42 pm
by fjwalraven
Yes, you are right.

I solved this question when you reported the other question. (it will come in the next update)

Thank you for your feedback!
Frits