VB.net Soap 客户端无法在 PHP Soap 服务器上运行

发布于 2024-12-23 03:05:05 字数 2161 浏览 2 评论 0原文

我使用 nusoap 用 PHP 编写了一个肥皂服务。它与我用 PHP 编写的测试客户端工作得很好,但是,我们的客户用 vb.net 编写了他的客户端,但它不起作用。我没有看到任何错误,但该服务没有正确解析他的请求。

我让 nusoap 生成 WSDL,它看起来不错。如果我将我发送的消息与他的其中一条消息进行比较,我确实发现信封中存在一些差异,但我不确定问题是在我这边还是他那边。

以下是好的和坏的反应。

好:

<?xml version="1.0" encoding="ISO-8859-1"?>
<SOAP-ENV:Envelope 
    SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 
    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">

  <SOAP-ENV:Body>
    <ns6361:uploadDocument xmlns:ns6361="http://tempuri.org">
      <__numeric_0>
        <firmCode xsi:type="xsd:string">999*site1</firmCode>
        <docID xsi:type="xsd:string">id</docID>
        <docType xsi:type="xsd:string">tif</docType>
        <document xsi:type="xsd:string">SUkqAMpDAAAmoFy..lots of data omitted here</document>
        </__numeric_0>
      </ns6361:uploadDocument>
    </SOAP-ENV:Body>
  </SOAP-ENV:Envelope>

坏:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope 
    xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" 
    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" 
    xmlns:tns="http://www.inassist.com/docupload" 
    xmlns:types="http://www.inassist.com/docupload/encodedTypes" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">

  <soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <q1:uploadDocument xmlns:q1="urn:server">
      <firmCode xsi:type="xsd:string">999*site1</firmCode>
      <docID xsi:type="xsd:string">0000007126</docID>
      <docType xsi:type="xsd:string">PDF</docType>
      <document xsi:type="xsd:base64Binary">JVBERi0xLj..data omitted...</document>
    </q1>
  </soap:Body>
</soap:Envelope>

谁能指出我正确的方向吗?谢谢。

I wrote a soap service in PHP using nusoap. It works fine with the test client I wrote in PHP, however, our customer wrote his client in vb.net and it is not working. There are no errors that I see, but the service is not parsing his requests properly.

I am letting nusoap generate the WSDL, and it looks fine. If I compare a message that I send in to one of his messages, I do see a few differences in the envelope, but I'm not sure if the problem is on my end or his.

Here are the good and bad responses.

Good :

<?xml version="1.0" encoding="ISO-8859-1"?>
<SOAP-ENV:Envelope 
    SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 
    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">

  <SOAP-ENV:Body>
    <ns6361:uploadDocument xmlns:ns6361="http://tempuri.org">
      <__numeric_0>
        <firmCode xsi:type="xsd:string">999*site1</firmCode>
        <docID xsi:type="xsd:string">id</docID>
        <docType xsi:type="xsd:string">tif</docType>
        <document xsi:type="xsd:string">SUkqAMpDAAAmoFy..lots of data omitted here</document>
        </__numeric_0>
      </ns6361:uploadDocument>
    </SOAP-ENV:Body>
  </SOAP-ENV:Envelope>

Bad:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope 
    xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" 
    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" 
    xmlns:tns="http://www.inassist.com/docupload" 
    xmlns:types="http://www.inassist.com/docupload/encodedTypes" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">

  <soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <q1:uploadDocument xmlns:q1="urn:server">
      <firmCode xsi:type="xsd:string">999*site1</firmCode>
      <docID xsi:type="xsd:string">0000007126</docID>
      <docType xsi:type="xsd:string">PDF</docType>
      <document xsi:type="xsd:base64Binary">JVBERi0xLj..data omitted...</document>
    </q1>
  </soap:Body>
</soap:Envelope>

Can anyone please point me in the right direction? Thank you.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

﹂绝世的画 2024-12-30 03:05:05

在我看来,最大的问题是良好响应中的 <__numeric_0> 标签。

如果您可以修改您的结尾以消除对此标记的需要,那么唯一可能的问题类似于 uploadDocument 的命名空间,即错误响应中的 q1ns6361 在好的文档中。

It appears to me that the biggest problem is going to be the <__numeric_0> tag in the good response.

If you can modify your end to eliminate the need for this tag, then the only other possible problem looks like the namespace for the uploadDocument, which is q1 in the bad response and ns6361 in the good document.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文