Code: Select all
@WebServlet(urlPatterns="/math")
public class MathTableClient extends HttpServlet { @Addressing
@WebServiceRef(MathTableImplService.class)
private MathTableService service;
...
}
Moderators: Site Manager, fjwalraven
Code: Select all
@WebServlet(urlPatterns="/math")
public class MathTableClient extends HttpServlet { @Addressing
@WebServiceRef(MathTableImplService.class)
private MathTableService service;
...
}
Code: Select all
@WebServlet(urlPatterns="/math")
public class MathTableClient extends HttpServlet {
@Addressing
@WebServiceRef( MathTableImplService.class )
private MathTableService service;
...
}
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 ) {
. . .
}
}
The Web Service is used in a client. What is the correct code to enable the Addressing feature in the client?
Code: Select all
public class MathTableClient {
public static void main( String[] args ) {
MathTableImplService service = new MathTableImplService();
MathTableService port = service.getMathTableImplPort( new AddressingFeature() );
. . .
}
}
I have a couple of questions:If MTOM is enabled on the SERVER-side, then MTOM will also be enabled on the CLIENT-side by JAX-WS, but not the other way around.
Thanks in advance.If WS-Addressing is enabled on the SERVER-side, then WS-Addressing will also be enabled on the CLIENT-side by JAX-WS, but not the other way around.
Explanation:How do we enable the Addressing Web Service feature on the client side?
- When the Addressing feature is active in the server, the feature is automatically switched on in the client.
- With this client code:
...
MathTableImplService service = new MathTableImplService();
MathTableService port = service.getMathTableImplPort(new AddressingFeature());
...
I had fixed this question as well, but thanks for reminding!Here's another that slipped through the cracks =)
Same thing applied -- either: ...
Yes I answered all of them, and I think I I answered correctly for most, if not all, of them.fjwalraven wrote:I had fixed this question as well, but thanks for reminding!Here's another that slipped through the cracks =)
Same thing applied -- either: ...
I have a feeling that you answered the other questions in this thread about Addressing and MTOM. If not please reply.
Regards,
Frits
How can you know for sure that MathTableService was generated with wsimport?Yes, note that this has been done when generating the client's code (deploy the WebService and use wsimport)
How do you know that MathTableImplService is the Service instance?When used with a WebServiceRef annotation, this annotation MUST only be used when a proxy instance is created. Note that MathTableImplService is the Service instance.
How am I suppose to know that ( know that MathTableImplService is the Service instance) on exam, without generating client code?If you deploy the Webservice in the problem statement you can check the WSDL and generate the client code. You will see that those are the classes generated by wsimport.
Could you explain in brief? Another question - how do you know that classes are generated automatically by wsimport?You need to know how this works.
Are you studying from a book? If you code a simple Webservice and publish it, you can see how the mapping is done. Furthermore (JSR-181) gives you the rules of how the mapping changes when you use attributes in the Webservice annotation.Could you explain in brief?
Classes are not generated automatically: you have to generate them by using the wsimport tool.Another question - how do you know that classes are generated automatically by wsimport?
You mean that there is no way to prepare classes manually?Classes are not generated automatically: you have to generate them by using the wsimport tool.
That is possible however not common.You said that classes are generated by using wsimport?
Can't they be written manually by programmer?
This is what they call a SEI proxy.MathTableService is SEI and Proxy at the same time?
Regards,Annotation Type Addressing
This annotation MUST only be used in conjunction with the WebService, WebServiceProvider, and WebServiceRef annotations. When used with a javax.jws.WebService annotation, this annotation MUST only be used on the service endpoint implementation class. When used with a WebServiceRef annotation, this annotation MUST only be used when a proxy instance is created. The injected SEI proxy, and endpoint MUST honor the values of the Addressing annotation.
Code: Select all
@WebServiceRef(type=MathTableService.class)
Code: Select all
@WebServiceRef
private MathTableImplService service;
No, this is wrong because the @Addressing annotation will only work on a proxy instance (so it has nothing to do with the @WebServiceRef annotation). In other words: the type of the instance variable has to be the SEI type.As I understand, according to jaxws-2.2 specification, is incorrect because it has a missing "value" element?
When it comes to the Addressing feature there is no alternative.But had this expression be like so:
Code:
@WebServiceRef
private MathTableImplService service;
Then that would be correct?
Users browsing this forum: No registered users and 9 guests