为什么我的.NET Web服务XML与其他人不同?

时间:2012-01-19 09:58:06

标签: .net xml web-services soap

我是.NET网络服务的新手,我对此问题非常困惑。 TCP Viewer显示我的测试应用程序与我的Web服务通信,形成如下XML:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <GetSupply xmlns="http://webservices.florecom.org/commercial/customer/">
      <Request>
        <SupplyRequest>
          <Header xmlns="urn:fec:florecom:xml:data:draft:SupplyStandardMessage:5">
            <UserName>xxx</UserName>
            <Password>xxx</Password>
            <MessageDateTime>2012-01-17T14:59:44.0438037+02:00</MessageDateTime>
            <MessageSerial>0</MessageSerial>
          </Header>
          <Body xmlns="urn:fec:florecom:xml:data:draft:SupplyStandardMessage:5">
            <SupplyRequestDetails>
              <SupplyRequestLine xmlns="urn:fec:florecom:xml:data:draft:ReusableAggregateBusinessInformationEntity:3"/>
            </SupplyRequestDetails>
          </Body>
        </SupplyRequest>
      </Request>
    </GetSupply>
  </s:Body>
</s:Envelope>

但我的网络服务正在从另一家公司接收XML,如下所示:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <soap:Body>
    <fsm:SupplyRequest xmlns:qdt="urn:un:unece:uncefact:data:draft:QualifiedDataType:5" xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:4" xmlns:ram="urn:un:unece:uncefact:data:draft:ReusableAggregateBusinessInformationEntity:3" xmlns:fsm="urn:fec:florecom:xml:data:draft:SupplyStandardMessage:5">
      <fsm:Header>
        <fsm:UserName>xxx</fsm:UserName>
        <fsm:Password>xxx</fsm:Password>
        <fsm:MessageID>634617184436505019</fsm:MessageID>
        <fsm:MessageDateTime>2012-01-09T15:07:23.6505019+01:00</fsm:MessageDateTime>
        <fsm:MessageSerial>0</fsm:MessageSerial>
      </fsm:Header>
      <fsm:Body>
        <fsm:SupplyRequestDetails>
          <SupplyRequestLine xmlns="urn:fec:florecom:xml:data:draft:ReusableAggregateBusinessInformationEntity:3"/>
        </fsm:SupplyRequestDetails>
      </fsm:Body>
    </fsm:SupplyRequest>
  </soap:Body>
</soap:Envelope>

有人可以帮忙解释原因吗?这些不同版本的SOAP?感谢

更新

感兴趣的是,在这种情况下(使用第二条XML消息)发生的问题是当服务方法被命中时(使用断点来检查这个并用Fiddler欺骗消息).NET无法绑定方法的参数(称为“请求”),使其值保持为NULL

1 个答案:

答案 0 :(得分:3)

如果你指的是肥皂与它实际上并不重要。这些节点是名称空间,以便消费者知道文档的格式。实际上,知道http://schemas.xmlsoap.org/soap/envelope

定义的模式的人将对它们进行相同的处理

两者都引用了soap 1.1名称空间

相关问题