Page 1 of 1
About Question enthuware.ocejws.v6.2.168 :
Posted: Mon Jun 16, 2014 2:56 am
by ralf_muehle
can you explain me why
Code: Select all
MathTableService port = service.getMathTableServicePort(new AddressingFeature(true));
is wrong?
AddressingFeature has a constructor with a boolean-value for enabling Addressing (see
http://docs.oracle.com/javaee/6/api/jav ... ature.html)
Re: About Question enthuware.ocejws.v6.2.168 :
Posted: Mon Jun 16, 2014 3:24 am
by fjwalraven
Hi Ralf!
can you explain me why
Code:
MathTableService port = service.getMathTableServicePort(new AddressingFeature(true));
is wrong?
The problem is with the injection of the WebService (@WebServiceRef), not with the code that you quoted.
The @WebServiceRef annotation is used on a SEI, in that case the
value element (
value=MathTableImplService.class) has to be present:
From the specs:
To define a reference whose type is a SEI. In this case, the type element MAY be present with its default value if the type of the reference can be inferred from the annotated field/method declaration, but the value element MUST always be present and refer to a generated service class type (a subtype of javax.xml.ws.Service).
Regards,
Frits
Re: About Question enthuware.ocejws.v6.2.168 :
Posted: Mon Jun 16, 2014 3:29 am
by ralf_muehle
Hi Frits,
many thanks for the explanation. I didn't see that
regards,
Ralf
Re: About Question enthuware.ocejws.v6.2.168 :
Posted: Tue Oct 28, 2014 8:17 am
by austinor
In one of the (correct) choices, I doubt that the method "getMathTableServicePort(...)" is valid:
MathTableService port = service.getMathTableServicePort( new AddressingFeature() );
Based on the naming convention of wsimport-generated Java classes, I think it should be:
MathTableImpl port = service.getMathTableImplPort( new AddressingFeature() );
===================================
In the other (correct) choice, this looks iffy as well:
@WebServiceRef( MathTableImplService.class )
private MathTableService service;
I think either of these should be valid:
@WebServiceRef( MathTableImplService.class )
private MathTableImpl proxy;
OR
@WebServiceRef
private MathTableImpleService service;
I really can't say for sure, but is this correct?
Re: About Question enthuware.ocejws.v6.2.168 :
Posted: Tue Oct 28, 2014 8:22 am
by austinor
In one of the (correct) choices, I doubt that the method
is valid:
Code: Select all
MathTableService port = service.getMathTableServicePort( new AddressingFeature() );
Based on the naming convention of wsimport-generated Java classes, I think it should be:
Code: Select all
MathTableImpl port = service.getMathTableImplPort( new AddressingFeature() );
===================================
In the other (correct) choice, this looks iffy as well:
Code: Select all
@WebServiceRef( MathTableImplService.class )
private MathTableService service;
I think either of these should be valid:
Code: Select all
@WebServiceRef( MathTableImplService.class )
private MathTableImpl proxy;
OR
Code: Select all
@WebServiceRef
private MathTableImpleService service;
I really can't say for sure, but is this correct?
Re: About Question enthuware.ocejws.v6.2.168 :
Posted: Tue Oct 28, 2014 3:44 pm
by fjwalraven
Hi !
MathTableImpl port = service.getMathTableImplPort( new AddressingFeature() );
Yes, you are correct: I have corrected the option!
@WebServiceRef( MathTableImplService.class )
private MathTableService service;
Good catch! there is a small error in the Problem statement:
Code: Select all
@Addressing(required=true)
@WebService
public class MathTableImpl implements MathTableService {
...
should be (you have to assume that the @WebService annotation is present on the MathTableService interface):
Code: Select all
@Addressing(required=true)
@WebService (endpointInterface="package.MathTableService")
public class MathTableImpl implements MathTableService {
...
Implementing the interface which is also annotated as a WebService is not enough, you have to refer to it by using the
endpointInterface attribute!
I have fixed the problem statement. Thanks for your feedback!
Regards,
Frits