java - JAXB cannot handle an interface - what am I missing? -


I'm becoming familiar with web services in Java, jacks-ys (or jacab, certainly not, anyway ..).

I have created a small project with a single webservice, WS has the only closing point that is called transfer and returns the returns to the objects receiving the ITRsffer interface.

Web service agreement

  // service endpoint interface @ webserver @ soap binding (style = style .pc) public interface iBacab WebServ { @ WebMathItransferrent Transfer (String account number, double amount); } web service implementation   
  // service implementation @WebService (endpointInterface = "Contracts.IBankWebSrv") Public class BankWebSrv IBankWebSrv {@Override} implements Public ITRansferResult Transfer (String Account Number, Double Amount) {ITransferResult Results = New Transfer Result (); // TODO logic here result.setSuccessful (true); Return result; }}   

Transfer Result Agreement

  @ XmlJavaTypeAdapter (Transfer Result.class) is the public interface ITransferResult {boolean isSuccessful (); Zero set successful (boolean successful); }    Transfer Roustlets, Iteraters Resolve & gt; ITRansferResult {@XmlElement boolean succeeded; Applies; Public Boolean is successful () {back to this. Successful; } Public Zero Set Successful (Boolean Successful) {This. Successful = successful; } @ Override Public Transfers Marshal (Metrology Result V) throws an exception {Return (Transfer Result) V; } @ Override Public I.T.R. Response Apart (Transphor Result V) throws exceptions {Returns (Fetaters Resolve) V. }}   

When I publish my web service, I get the following error:

"main" javax.xml.ws.WebServiceException thread Exception in: Unable to create JAXBContext ...

By: java.security.PrivilegedActionException: com.sun.xml.internal.bind.v2.runtime.Illegal Annotation Exception: 1 count invalid assertion exception ITransferResult is an interface, and can not control the JAXB interface. This problem is related to the following location: On ITRansferResult

I have looked at the SO for more repetitive tips, but none of them does not work for me yet is.

What am I missing?

It seems that this transfer result class is a bindable element As it does not process on annotation, this means that you probably have to add the @ XmlSeeAlso (TransferResult.class) to the interface ( ITransferResult ). You must be put the @ XmlRootElement on the serialization-implementation ( TransferResult ) in order to produce an actual XML document, and not just one type that you use in another Do the document The reason for this is that when the JAX-WS implementation is creating JAXB references that use it internally, it uses only logic and result types that you define on the service interface, because JAXB .newInstance (รข ?? |) ; There is nothing really listed (or searchable via simple on the basis of type), and it is entirely possible that the process for adapter annotation to be used is not processed (Finally, they

(Yes, a soap reaction is an attached document, but it is suggested to use an element within SOAP body , and its Meaning that you have the na of the element Me , which means a @xmlRootElement annotation.)


Warning: I do not believe 100% that it will work If this does not happen, then you have to switch to use the concrete type (possibly POJO) directly as a result. This is not a particularly delicious thing, but it is easy to minimize it ?? |

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -