创建与Python客户端(以及.net)兼容的.net Web服务 [英] Creating a .net Web Service that is compatible with a Python Client (as well as .net)

查看:112
本文介绍了创建与Python客户端(以及.net)兼容的.net Web服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一个基于网络的应用程序,它通过Web服务向我们的用户公开了许多服务。

一切顺利,直到我们终于遇到一个用户/尝试使用Python脚本访问我们的服务的客户端。现在突然我们的网络服务似乎"不兼容"。

我一直在寻找网络 - 并尝试了很多东西,所有这些都使我的WS对我开发的.net测试客户端无用。

我的代码(简化)看起来像这样:
----------

Hi,
 
I have a web-based application that exposes a number of services to our users through web services.

Everything has been going smoothly until we finally came across a user/client that is trying to access our services using Python Script. Now suddenly our web service seems "incompatible".

I have been looking all over the web - and have tried a number of things, all of which rendered my WS useless to the .net test client I developed.

My code (reduced) looks something like this:
----------




































< td style ="background-color:#f7f7f7">


















































































< td> 38
























1 Imports System.Web.Services
2
3 Imports System.Web.Services。协议
4
5 Imports System.Web.Services.Description
6
7 Imports System.Xml.Serialization
8
9 Imports System.ComponentModel
10
11
12
13 < System.Web .Services.WebService( 命名空间 := " http://tempuri.org/" )> _
14
15 < System .Web.Services.WebServiceBinding(ConformsTo:= WsiProfiles.BasicProfile1_1)GT; _
16
17 < ToolboxItem( False )> _
18
19 公共 ClassnameWebService
20
21 继承 System.Web.Services.WebService
22
23
24
25
26
27 < ;的WebMethod()> _
28
29 公共 功能 WebFunctionName( ByVal PrmOne As String ,_
30
31 ByVal PrmTwo As 字符串 ,_
32
33 ByVal PrmThree As String ,_
34
35 ByVal PrmFour As String ,_
36
37 ByVal P rm5 As String As < font style ="color:blue">布尔
39 ***我的代码在这里
40
41
42
43 结束 功能
44
45 ...
46
1 Imports System.Web.Services  
2  
3 Imports System.Web.Services.Protocols  
4  
5 Imports System.Web.Services.Description  
6  
7 Imports System.Xml.Serialization  
8  
9 Imports System.ComponentModel  
10  
11  
12  
13 <System.Web.Services.WebService(Namespace:="http://tempuri.org/")> _  
14  
15 <System.Web.Services.WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _  
16  
17 <ToolboxItem(False)> _  
18  
19 Public Class ClassnameWebService  
20  
21 Inherits System.Web.Services.WebService  
22  
23  
24  
25  
26  
27 <WebMethod()> _  
28  
29 Public Function WebFunctionName(ByVal PrmOne As String, _  
30  
31 ByVal PrmTwo As String, _  
32  
33 ByVal PrmThree As String, _  
34  
35 ByVal PrmFour As String, _  
36  
37 ByVal Prm5 As StringAs Boolean 
38  
39 ***MY CODE HERE  
40  
41  
42  
43 End Function 
44  
45 ...  
46  

推荐答案

嗯,只是因为你正在使用一个Web服务,这意味着你已经使你的代码技术独立于其消费。

ASP.NET Web服务技术基于行业标准,因此消费独立于编程语言和平台。

您能查找Python脚本与您的交互方式吗?我怀疑问题来自于此,因为您的服务之前运行顺利。

"不兼容"的可能因素:
客户端没有使用正确的绑定来连接到您?
您使用的标准还不是python实现的一部分吗?

请提供有关此交互的更多详细信息,以便我了解更多信息。如果你有一些python代码,那也会有所帮助。

-Chris
Well, just by the fact that you are using a web service, this means you already are making your code technology independent for its consumption.

ASP.NET web service technology is based on industry standard, so consumption is independent of the programming language and platform.

Could you lookup how is the Python Script interacting with you? I would suspect the problem coming from that end, since your service was running smoothly before.

Possible factor of "incompatibility":
Client is not using the proper binding to connect to you?
You use a standard that is not yet part of the python implementation?

Please provide further details about this interaction so I can understand more. If you have some python code, that would also help.

-Chris


这篇关于创建与Python客户端(以及.net)兼容的.net Web服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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