简体   繁体   English

编组/解组Java方法

[英]marshal/unmarshal a java method

I have a java class that contain a method with some logic control . 我有一个Java类,其中包含带有某些逻辑控件的方法。 This class is avaible as output via a webservice method to a java swing client . 此类可通过Webservice方法作为输出输出到java swing客户。

My question sounds crazy but is it possible to marshal/unmarshal the method to make it available to the client when he generate the class from the wsdl file ? 我的问题听起来很疯狂,但是当客户端从wsdl文件生成类时,是否可以封送/取消封送该方法以使其对客户端可用?

Thanks. 谢谢。

ps:I'm using Metro/jax-ws and glassfish 3.1.1. ps:我正在使用Metro / jax-ws和glassfish 3.1.1。

You mean so you can send some logic down to the client to be executed there? 您的意思是说,您可以将一些逻辑发送给客户端以在那里执行?
I'm afraid the answer is no - this is not how web services work. 恐怕答案是否定的-这不是Web服务的工作方式。
All the logic is performed on the server side. 所有逻辑均在服务器端执行。

Why do you wish to do this? 您为什么要这样做?

Why not provide this class (your VO) to the client so both the server and client are marshalling/unmarshalling the same class? 为什么不向客户端提供此类(您的VO),以便服务器和客户端都在编组/解组同一类? Then both can use the your method... 然后两者都可以使用您的方法...

Marshalling" refers to the process of converting the data or the objects into a byte-stream, and "unmarshalling" is the reverse process of converting the byte-stream back into their original data or object. The conversion is achieved through "serialization". “编组”是指将数据或对象转换为字节流的过程,而“解组”是将字节流转换回其原始数据或对象的反向过程。

The purpose of the "marshalling/unmarshalling" process is to transfer data between the RMI systems. “编组/解组”过程的目的是在RMI系统之间传输数据。

For more http://ws.apache.org/old/jaxme/manual/ch02s02.html 有关更多http://ws.apache.org/old/jaxme/manual/ch02s02.html

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

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