Skip to content

Instantly share code, notes, and snippets.

@ricston-git
Last active December 12, 2015 10:48
Show Gist options
  • Save ricston-git/4761393 to your computer and use it in GitHub Desktop.
Save ricston-git/4761393 to your computer and use it in GitHub Desktop.
jaxws-service without an implementation
@WebService
public interface AppendDateService {
String appendDate(@WebParam(name="arg") String arg);
}
@WebService(endpointInterface = "com.ricston.sample.AppendDateService",
serviceName = "AppendDateService")
public class AppendDateServiceImpl implements AppendDateService {
public String appendDate(String arg) {
return arg + " " + (new Date());
}
}
<flow name="appender">
<http:inbound-endpoint exchange-pattern="request-response"
address="http://localhost:9090/services" />
<cxf:jaxws-service serviceClass="com.ricston.sample.AppendDateService" />
<logger level="ERROR"
message="#[groovy:message.getInvocationProperty('method')]" />
<logger level="ERROR"
message="#[groovy:message.getInvocationProperty('method').class.name]" />
<message-properties-transformer scope="invocation">
<delete-message-property key="method" />
</message-properties-transformer>
<component class="com.ricston.sample.NotAServiceImpl" />
</flow>
<flow name="appender">
<http:inbound-endpoint exchange-pattern="request-response"
address="http://localhost:9090/services" />
<cxf:jaxws-service serviceClass="com.ricston.sample.AppendDateService" />
<component
class="com.ricston.sample.NotAServiceImpl" />
</flow>
public String appendCurrentDate(String arg) {
return arg + " " + (new Date());
}
<message-properties-transformer scope="invocation">
<add-message-property key="method"
value="#[groovy:def m = ((new java.lang.Class[1]) as java.lang.Class[]); m[0] = java.lang.String.class; (com.ricston.sample.NotAServiceImpl.class).getMethod('appendCurrentDate', m)]" />
</message-properties-transformer>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment