开发者

WebService with ComplexData type as input

I have the question why when I use the Java Annotation (import javax.jws.*) for WebServices, I don't get an complex java class members with the correct value?

f.e:

[1.] Wit开发者_高级运维h simple type as service input

import javax.jws.WebMethod;

@WebService
public class WebServiceClass{

    @WebMethod
    public void webMethodSample(int inValue){
        int i = inValue;

    }
}

Result: That works fine.

[2.] With Java Class/Object (Complex type) as service input:

import javax.jws.WebMethod;

@WebService
public class WebServiceClass{

    @WebMethod
    public void webMethodSample(SimpleObj inObj){
        int i = inObj.getValue();

    }
}

-> SimpleObj:

public class SimpleObj {
    private int m_Value = 0;

    public void setValue(int inValue){
        this.m_Value = inValue;
    }
    public int getValue(){
        return this.m_Value;            
    }
}

Result: The variable 'i' which comes from the "SimpleObj" inputObject is not the value which I pass from an SOAP Client Program.

Can anybody helps me what I do wrong?

Thanks and Greets

Tommy


What isnt this.Value in your getter/setter?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜