无法在.NET中使用WSDL [英] Unable to make use of WSDL in .NET

查看:59
本文介绍了无法在.NET中使用WSDL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在VB.net中使用WSDL文件的帮助

I need help using my WSDL file in VB.net

由于不使用.NET,软件开发人员无法提供帮助,并指出该软件在Perl& amp;中工作正常. PHP.

The software developers were unable to help as they do not use .NET, and state that it works fine in Perl & PHP.

 

这是我尝试过的步骤

1.在服务器软件上运行命令以生成wsdl文件

1. Run command on server software to generate the wsdl file

2. Cretae新的Visual Studio项目

2. Cretae new visual studio project

3.添加服务参考,高级,添加Web参考

3. Add Service Reference, Advanced, Add Web Reference

4.输入网址,然后点击Go

4. type in url, click Go

5.列出所有功能,并在其中找到找到1个服务".消息显示在右侧.

5. All fuinctions are listed, and "1 Service Found" message shows on the right.

6.输入参考的名称&点击添加.

6. Type in a name for the reference & click Add.

 

打开ObjectBrowser,看不到新添加的引用或函数的任何提及.

Open ObjectBrowser and cannot see any mentions of the newly added reference or the functions.

 

为了进一步测试,我尝试使用WSDL.exe创建代理文件.

To test this further, I attempted to use WSDL.exe to create a proxy file. 

wsdl.exe/语言:VB/out:myProxyClass.vb http://xx.xx.xx.xx/original.wsdl

wsdl.exe /language:VB /out:myProxyClass.vb http://xx.xx.xx.xx/original.wsdl

 

...

 


Error: Unable to import binding 'zzzzzzzzzzAPISoapBinding' from namespace 'http://xx.xx.xx.xx/zzzzzz/zzzzzzzz/API'.

  - The operation 'delete_access' on portType 'zzzzzzzAPIHandler' from namespace 'http://xx.xx.xx.xx/zzzzzz/zzzzzzzz/API' had the following syntax error:  The operation has no matching binding. Check if the operation, input and output names in the Binding section match with the corresponding names in the PortType section.

推荐答案

听起来像WSDL文件有问题.要确定这不是某种通信问题,您是否尝试过将WSDL下载到本地文件并在该本地文件上运行wsdl.exe?我很确定您需要下载的所有内容 WSDL是在Web浏览器中键入其完整URL.  取决于浏览器和设置,它可能会询问您将其保存在哪里,或者只是在XML查看器中显示文件.  如果确实显示,请查看页面资源,然后复制&粘贴源 进入本地纯文本文件.

Sounds like a problem with the WSDL file.  To be certain it's not some sort of communication problem, have you tried downloading the WSDL to a local file and running wsdl.exe on that local file?  I'm pretty sure all you'd need to do to download the WSDL is type the full URL to it into a web browser.  Depending on the browser and settings, it might ask you where to save it, or just display the file in a XML viewer.  If it does display it, VIEW THE PAGE SOURCE, then copy & paste the source into a local plain-text file.

当我第一次为我的一个客户创建WSDL合同时,是使用自动化的在线工具完成的.以下是该Web服务的WSDL的子集.  在线工具未在WSDL中创建一个关键标签;它要么是"soap:binding",要么是"soap:binding". 标签在绑定"标签中结构或"soap:operation"在操作"中嵌套在绑定"标签中的标签标签.在任何情况下,无论使用哪种工具创建WSDL,都不会添加.NET所需的所有标签.   Perl和PHP可能更多 在这种情况下原谅...

When I first created the WSDL contract for one of my clients, I did so with an automated online tool.  Below is a subset of the WSDL for that web service.  The online tool didn't create one critical tag in the WSDL; it was either the "soap:binding" tag in the "binding" structure, or the "soap:operation" in the "operation" tag nested in the "binding" tag.  In any case, it looks like whatever tool is creating your WSDL isn't adding all the tags required by .NET.  Perhaps Perl and PHP are more forgiving in this case...


<?xml version="1.0" encoding="UTF-8"?>
<definitions 
  xmlns="http://schemas.xmlsoap.org/wsdl/" 
  xmlns:veris="https://secure.veris.net/" 
  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
  name="VerisServices" 
  targetNamespace="https://secure.veris.net/">
  <types>
    <xsd:schema 
      xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
      xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
      xmlns:veris="https://secure.veris.net/" 
      xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
      targetNamespace="https://secure.veris.net/">
      
      <xsd:include schemaLocation="VerisServices.xsd"/>
    </xsd:schema>
  </types>
  <message name="SocialSearchRequest">
    <part element="veris:SocialSearchRequest" name="SocialSearchRequest" />
  </message>
  <message name="SocialSearchResponse">
    <part element="veris:SocialSearchResponse" name="SocialSearchResponse" />
  </message>
  <portType name="SocialSearch">
    <operation name="SocialSearch">
      <input message="veris:SocialSearchRequest" />
      <output message="veris:SocialSearchResponse" />
    </operation>
  </portType>
  <binding name="SocialSearchServiceSOAP" type="veris:SocialSearch">
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
    <operation name="SocialSearch">
      <soap:operation soapAction="cgi-bin/VerisSocialSearchServer" style="document"/>
      <input>
        <soap:body use="literal" parts="SocialSearchRequest" />
      </input>
      <output>
        <soap:body use="literal" parts="SocialSearchResponse" />
      </output>
    </operation>
  </binding>
  <service name="SocialSearch">
    <port binding="veris:SocialSearchServiceSOAP" name="SocialSearchServiceSOAP">
      <soap:address location="https://secure.veris.net/cgi-bin/VerisSocialSearchServer" />
    </port>
  </service>
</definitions>


这篇关于无法在.NET中使用WSDL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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