About Question enthuware.ocejws.v6.2.168 :

All the posts and topics that contain only an error report will be moved here after the error is corrected. This is to ensure that when users view a question in ETS Viewer, the "Discuss" button will not indicate the presence of a discussion that adds no value to the question.

Moderators: Site Manager, fjwalraven

Post Reply
ralf_muehle
Posts: 2
Joined: Sat May 03, 2014 6:31 am
Contact:

About Question enthuware.ocejws.v6.2.168 :

Post 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)

fjwalraven
Posts: 429
Joined: Tue Jul 24, 2012 2:43 am
Contact:

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

Post 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

ralf_muehle
Posts: 2
Joined: Sat May 03, 2014 6:31 am
Contact:

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

Post by ralf_muehle »

Hi Frits,

many thanks for the explanation. I didn't see that :(

regards,
Ralf

austinor
Posts: 41
Joined: Mon Oct 27, 2014 11:35 pm
Contact:

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

Post 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?

austinor
Posts: 41
Joined: Mon Oct 27, 2014 11:35 pm
Contact:

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

Post by austinor »

In one of the (correct) choices, I doubt that the method

Code: Select all

"getMathTableServicePort(...)"
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?

fjwalraven
Posts: 429
Joined: Tue Jul 24, 2012 2:43 am
Contact:

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

Post 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

Post Reply

Who is online

Users browsing this forum: No registered users and 146 guests