cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Hvid <>
Subject Java-first SOAP via HTTP GET and enums
Date Mon, 13 Sep 2010 12:43:31 GMT
Hello again list.

I am also having some trouble sending an enum in HTTP GET via a Java-first
SOAP implementation.

import java.util.Date;

public interface MyInterface {
    public MyEnum test3();

    public void test4(@WebParam(name = "myEnum") MyEnum myEnum);

public class MyImplementation implements MyInterface {
    public MyEnum test3() {
        return MyEnum.A;

    public void test4(@WebParam(name = "myEnum") MyEnum myEnum) {

public enum MyEnum {
    A, B, C

public class StartTestDims {
    public static void main(String[] args) {
        MyImplementation implementor = new MyImplementation();
        JaxWsServerFactoryBean svrFactory = new JaxWsServerFactoryBean();
        svrFactory.getInInterceptors().add(new LoggingInInterceptor());
        svrFactory.getOutInterceptors().add(new LoggingOutInterceptor());

When I go:


I get:

<soap:Envelope xmlns:soap="">
<ns2:test3Response xmlns:ns2="http://unknown.namespace/">

But when I go:


I get:

<soap:Envelope xmlns:soap="">
  <faultstring>argument type mismatch while invoking public abstract void
MyInterface.test4(MyEnum) with params [A].</faultstring>

What I am doing wrong?

What is the correct format?

In the WSDL myEnum shows up as:

<xs:simpleType name="myEnum">
<xs:restriction base="xs:string">
  <xs:enumeration value="A" />
  <xs:enumeration value="B" />
  <xs:enumeration value="C" />

That is - an xs:string with a restriction.

(The end-implementation will use SOAP over HTTP POST - I need HTTP GET for
documentation and cross-platform testing.)

-- Christian

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message