简体   繁体   English

Java客户端使用的WCF服务和WCF客户端使用的Java服务

[英]WCF Service used by Java client and Java Service used by WCF client

I am working on a web service interface, where my WCF application works both as a Client and a Service. 我正在使用Web服务界面,在这里我的WCF应用程序既可以作为客户端也可以作为服务。 There are multiple Java clients that need to connect to my web service. 有多个Java客户端需要连接到我的Web服务。 I will need to accept stream of images and documents and send back stream of converted images. 我将需要接受图像和文档流,并发送回转换后的图像流。

I would also need to connect to other Java services to send the image streams as a payload to be stored in a database. 我还需要连接到其他Java服务,以将图像流作为有效载荷发送来存储在数据库中。 I am new to web services, is there good documentation on how to enable streaming contracts between WCF and Java clients and vice verse. 我是Web服务的新手,是否有很好的文档说明如何在WCF和Java客户端之间启用流协定,反之亦然。

If I want to return other information along with the stream of (group) images to the client, how would I do that? 如果我想将其他信息以及(组)图像流返回给客户端,我该怎么做? Like the size of each image, the offset in the stream, so they can separate images. 像每个图像的大小一样,流中的偏移量也是如此,因此它们可以分离图像。

Thanks 谢谢

In order to return additional information with your images you will need to define a DataContract which contains the metadata elements as well as a collection to contain your images. 为了与图像一起返回附加信息,您将需要定义一个DataContract,其中包含元数据元素以及一个包含图像的集合。 Perhaps representing your image collection as a byte array rather than just returning a raw stream of images? 也许将您的图像集合表示为字节数组,而不只是返回原始图像流? There are several ways to address the issue, however the best solution depends on your design requirements. 有多种方法可以解决此问题,但是最佳的解决方案取决于您的设计要求。

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

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