使用URL为消费客户端动态选择Web服务 [英] Dynamically selecting a Web Service using a URL for a consuming client

查看:63
本文介绍了使用URL为消费客户端动态选择Web服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对Web服务开发非常陌生,因此,如果我的问题很琐碎,请原谅我,但是我尝试在许多论坛上进行搜索,但找不到任何信息.

我用Java开发了一个Web服务,作为我必须完成的大学学位作业的一部分,我用C#创建了该Web服务的使用者.现在,当我使用Glassfish服务器在Netbeans中部署Java Web服务时,我可以轻松地从C#应用程序连接到Web服务,因为我导入了Web服务引用并在我的C#代码中对其进行了引用.

但是,我需要通过插入Java Web Service服务器的URL(或IP地址)和端口号(托管在glassfish服务器上)来使C#应用程序远程连接到Java Web Service,从而能够进行连接甚至来自其他机器.

I''m very new to web service development, so forgive me if my question is a trivial one, but I''ve tried searching on many forums and couldn''t find any information anywhere.

I developed a web service in Java, and as part of an assignment I have to complete for my University degree, I created a consumer of this web service in C#. Now when I deploy the Java web service in Netbeans using the Glassfish server, I can easily connect to the webservice from the C# application, since I imported the webservice reference and refer to it in my C# code.

I need to make the C# application connect to the Java Web service remotely however, by inserting the URL (or IP address) and port number of the server of the Java Web Service (being hosted on the glassfish server), thereby being able to connect even from a different machine.

How can this be completed?

推荐答案



如果您的Java Web Service托管在[Glassfish服务器上]服务器计算机上,
您基本上应该获得如下所示的Web服务URL:

http://Mac名称:端口/服务名称

此类URL可用于在设计时添加对C#应用程序的引用.

如果在运行时需要相同的内容,
您只需为地址,绑定和合同创建对象(地址为上述地址)
并连接到服务.
Hi,

If your Java Web Service is hosted [on Glassfish Server] on a server machine.,
you should basically get a get a Web Service URL like so:

http://Mac-name:port/servicename

Such URL could be used to add reference to your C# application at Design Time.

If the same needs to be during runtime,
you can simply create objects for Address, Binding, and Contract (With the address as the above address)
and connect to the service.


这篇关于使用URL为消费客户端动态选择Web服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆