在SOAP消息中指定缺省名称空间的前缀 [英] specify a prefix for the default namespace in a SOAP message

查看:137
本文介绍了在SOAP消息中指定缺省名称空间的前缀的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在与一家供应商合作,该供应商在解析我们根据默认名称空间开发的网络服务的响应时遇到问题。 供应商无法更改其代码,他只是尝试配置解析响应的工具。 
他告诉我他的工具工作正常,如果我们更改返回xml以使用默认命名空间的前缀,即从

I am working with a vendor that is having problems parsing the response from a web service we developed because of the default namespace.  The vendor cannot change his code, he is simply trying to configure a tool to parse the responses.  He is telling me that his tool works fine if we changed the return xml to use a prefix for the default namespace, i.e., change from

<?xml version =& ; 1.0" encoding =" utf-8"?>

< soap:Envelope xmlns:xsi =" http://www.w3.org/2001/XMLSchema-instance " xmlns:xsd =" http://www.w3.org/2001/XMLSchema " xmlns:soap =" http://schemas.xmlsoap.org/soap/envelope/ ">

  < soap:Body>

    < GetPackageStatusResponse xmlns =" http://www.blitzdocs.net/ESignPackage.wsdl ">

      < GetPackageStatusResult> InProcess< / GetPackageStatusResult>

    < / GetPackageStatusResponse>

  < / soap:Body>

< / soap:Envelope>

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <GetPackageStatusResponse xmlns="http://www.blitzdocs.net/ESignPackage.wsdl">
      <GetPackageStatusResult>InProcess</GetPackageStatusResult>
    </GetPackageStatusResponse>
  </soap:Body>
</soap:Envelope>

到此

<?xml版本= QUOT; 1.0" encoding =" utf-8"?>

< soap:Envelope xmlns:xsi =" http://www.w3.org/2001/XMLSchema-instance " xmlns:xsd =" http://www.w3.org/2001/XMLSchema " xmlns:soap =" http://schemas.xmlsoap.org/soap/envelope/ ">

  < soap:Body>

    < r:GetPackageStatusResponse xmlns:r =" http://www.blitzdocs.net/ESignPackage.wsdl " >

      < r:GetPackageStatusResult> InProcess< / GetPackageStatusResult>

    < / r:GetPackageStatusResponse>

  < / soap:Body>

< / soap:Envelope>

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <r:GetPackageStatusResponse xmlns:r="http://www.blitzdocs.net/ESignPackage.wsdl">
      <r:GetPackageStatusResult>InProcess</GetPackageStatusResult>
    </r:GetPackageStatusResponse>
  </soap:Body>
</soap:Envelope>

我似乎无法找到可用于控制此属性的属性,可能是因为如果您的解析器正在执行其工作,这两条消息是相同的。 在任何情况下,有没有人知道自定义ASP.NET SOAP序列化中使用的名称空间前缀的方法?

I can't seem to find an attribute that can be used to control this, probably because the two messages are identical if your parser is doing its job.  In any event, does anyone know of a way to customize the namespace prefixes use in ASP.NET SOAP serialization?

推荐答案

基于一点点的研究,看起来没有一个开箱即用的方式来做到这一点。 请参阅Scott Hanselmans博客文章

here

我做了一些测试,看起来仍然是这样。

I did a bit of testing and it appears this is still the same.


这篇关于在SOAP消息中指定缺省名称空间的前缀的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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