Note that there are some explanatory texts on larger screens.

plurals
  1. POJaxb2Marshaller and primitive types
    primarykey
    data
    text
    <p>Is it possible to create a web service operation using primitive or basic Java types when using the Jaxb2Marschaller in spring-ws? For example a method looking like this:</p> <pre><code>@Override @PayloadRoot(localPart = "AddTaskRequest", namespace = "http://example.com/examplews/") public long addTask(final Task task) throws AddTaskFault { // do something return 0; } </code></pre> <p>I am using the maven jaxws plugin to generate the interface and model classes from my WSDL. When I try to call the webservice I get the following error:</p> <p><em>java.lang.IllegalStateException: No adapter for endpoint [...]: Does your endpoint implement a supported interface like MessageHandler or PayloadEndpoint</em></p> <p>I found out that if I change the method to that:</p> <pre><code>@Override @PayloadRoot(localPart = "AddTaskRequest", namespace = "http://example.com/examplews/") public JAXBElement&lt;Long&gt; addTask(final JAXBElement&lt;Task&gt; task) throws AddTaskFault { final ObjectFactory objectFactory = new ObjectFactory(); return objectFactory.createAddTaskResponse(0L); } </code></pre> <p>I am able to call it - but this signature is not compatible with the interface generated by the maven jaxws plugin. </p> <p>What can I do to configure either spring-ws to be able to use the first kind of implementation or to tell maven jaxws plugin to generate the second variant of the interface?</p> <p>UPDATE: My relevant spring-ws config entries look like that:</p> <pre><code>&lt;bean id="marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller"&gt; &lt;property name="contextPath" value="com.example.examplews" /&gt; &lt;/bean&gt; &lt;bean class="org.springframework.ws.server.endpoint.adapter.GenericMarshallingMethodEndpointAdapter"&gt; &lt;constructor-arg ref="marshaller" /&gt; &lt;/bean&gt; &lt;bean class="org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping"&gt; &lt;property name="order" value="1" /&gt; &lt;/bean&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload