简体   繁体   English

如何使用wsdl.exe处理WebService中的自定义对象

[英]How to handle custom objects in WebService with wsdl.exe

I have a Java webservice that is defined by this Java class: 我有一个由该Java类定义的Java Web服务:

@WebService()
@SOAPBinding(style = SOAPBinding.Style.RPC)
public class ModelSim {
    /* ... */
    public boolean CheckCondition(Condition condition) {
        return condition.check(m_System, null);
    }
}

I deployed the webservice using: 我使用以下方法部署了Web服务:

ModelSim server = new ModelSim(m_Model);
Endpoint endpoint = Endpoint.publish("http://localhost:8181/uppaal", server);

CheckCondition(...) takes an Condition object which has refferences to further objects deriving from Condition . CheckCondition(...)接受一个Condition对象,该对象对来自Condition其他对象具有引用。

I deployed my WebService and generated a C# class using wsdl.exe 我部署了WebService,并使用wsdl.exe生成了C#类
wsdl.exe now created a proxy that can call CheckCondition with an object also defined in the proxy, but empty: wsdl.exe现在创建了一个代理,该代理可以使用也在代理中定义的对象调用CheckCondition ,但该对象为空:

[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://WebService/")]
public abstract partial class condition {
}

Can I implement the Condition object the same way I did in Java (A lot of work so I did not triey yet) or can I somehow auto generate the C# code for the Condition object? 我可以像在Java中一样实现Condition对象(做很多工作,所以我还没做过),还是可以为Condition对象自动生成C#代码?

The WSDL does not give any information about the Condition object beside the name yet. WSDL尚未在名称旁边提供有关Condition对象的任何信息。 So maybe I can tell java to make the WSDL more explicit? 因此,也许我可以告诉Java使WSDL更明确?

Thanks for any hints. 感谢您的任何提示。

Damn, it was just because the condition object on java side had no fields. 该死的,只是因为Java端的条件对象没有字段。 So it works for me. 所以对我有用。 Maybe I need a break ;) 也许我需要休息一下;)

Question can be closed. 问题可以结束。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM