我在Java和.Net之间有一个SOAP Web服务
在.net中,我们可以指定datacontract的数据库名称 像
这样的东西[DataContract(Name = "Class")]
public class ClassWithASoLongNameThatIWantToRenameIt
{
[DataMember(Name = "Property")]
public string PropertyWithASoLongNameThatIWantToRenameIt { get; set;}
Java中的等效注释知道我正在使用
import javax.jws.*;
import javax.jws.soap.SOAPBinding;
@WebService(targetNamespace = "http://MyNameSpace/")
@SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.BARE)
感谢您的时间:)
答案 0 :(得分:0)
我认为Java中的等价物将类似于
@XmlRootElement(name="Class", namespace="http://MyNameSpace/")
@XmlAccessorType(XmlAccessType.FIELD)
public class ClassWithASoLongNameThatIWantToRenameIt {
@XmlElement(name="Property")
private String propertyWithASoLongNameThatIWantToRenameIt;
public String getPropertyWithASoLongNameThatIWantToRenameIt {
return propertyWithASoLongNameThatIWantToRenameIt;
}