简体   繁体   English

PHP网站将数据发布到ASP.net Webservice

[英]PHP site to post data to ASP.net Webservice

I've got a site running on php and I need my form to post data to an ASP.Net web service. 我有一个在php上运行的网站,我需要我的表格将数据发布到ASP.Net Web服务。 All I have from the ASP.Net web service is a url ending in .svc and then I open up the url I get another link that I can click on which ends in .svc?wdsl 我从ASP.Net Web服务中获得的只是一个以.svc结尾的URL,然后打开该URL,然后得到另一个链接,我可以单击该链接以.svc结尾的那个?

This is all pretty new to me so I'm not sure where to begin, any pointers? 这对我来说都是很新的,所以我不确定从哪里开始,有没有指针?

Thanks 谢谢

The ASP.NET site is exposing a WCF service, and the ?wsdl url you're seeing (pronounced wis-dul) is a XML file which describes all of the functionality provided by the service and the input/output parameters. ASP.NET站点正在公开WCF服务,并且您看到的?wsdl url(发音为wis-dul)是一个XML文件,其中描述了该服务提供的所有功能以及输入/输出参数。 See the Wikipedia article on Web Services Description Language for more info. 有关更多信息,请参见Web服务描述语言上的Wikipedia文章。

With the small amount of background info, you can find some examples about consuming a WCF service from PHP (the fact that it's a WCF service shouldn't make any difference btw, so any example of consuming a web service should work): 借助少量的背景信息,您可以找到一些有关使用PHP来使用WCF服务的示例(事实上,它是WCF服务应该不会有任何区别,因此使用Web服务的任何示例都可以使用):

It sounds like you've been given a .NET SOAP Web Service to consume. 听起来您已获得要使用的.NET SOAP Web服务。

Check out the PHP docs for consuming/working with SOAP Services: 查看用于使用/使用SOAP Services的PHP文档:

PHP: SOAP - Manual (Paying close attention to SoapClient which is what you'll use to actually construct and call the service) PHP:SOAP-手册 (密切关注SoapClient,这将是您实际用来构造和调用服务的内容)

The .svc?wsdl link will give you the WSDL for the web service (which describes which methods are available and what their parameters are). .svc?wsdl链接将为您提供Web服务的WSDL(它描述了可用的方法以及它们的参数)。

Once you have the WSDL, you can construct a SoapClient with it and call the methods. 一旦有了WSDL,就可以使用它构建一个SoapClient并调用方法。

steven, 史蒂文

you'll need to do a refresher on wsdl and webservices under .net. 您需要对.net下的wsdl和webservices进行复习。

there are obviously lots of places to look online but certainly if you google: 'asp.net wcf wsdl webservice' you should get plenty of hits to help you along. 显然有很多地方可以在线查看,但是如果您使用google:'asp.net wcf wsdl webservice',无疑可以得到很多帮助。

jim 吉姆

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

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