1
我有一个.NET 4.0 Web服务,其中有一个targetNamespace为“http://tempuri.org”WSDL生成时。客户向我发送一个xmlns设置为“uri:company:agent”的SOAP信封(请参阅下面的示例)由于命名空间不同,我的服务拒绝SOAP信封。WSDL Xmlns更改
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/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/" xmlns:ns1="urn:company:agent">
<SOAP-ENV:Body>
<ns1:send_message xmlns="urn:company:agent">
<item1>abc</item1>
我收到以下错误:
<faultstring xml:lang="en-US">Error in deserializing body of request message for operation 'send_message'. OperationFormatter encountered an invalid Message body. Expected to find node type 'Element' with name 'send_message' and namespace 'http://tempuri.org/'. Found node type 'Element' with name 'ns1:send_message' and namespace 'urn:company:agent'</faultstring>
我的问题是:我找不到在哪里改的Visual Studio 2010中我的项目的命名空间,以反映“URI:公司:代理商“而不是”http://tempuri.org/“。我已经看过很多,但是我所做的任何更改都没有反映在WSDL中。
..我想我可以在上面输错....我有一个。 svc文件不是asmx文件。这会有所作为吗? – 2010-11-08 16:03:53
更新了我的答案,第二部分应该适合你。 – brendan 2010-11-08 16:14:10
谢谢!这是我必须添加到每种方法吗?我添加了服务行为,但现在所有的公共方法现在在WSDL中更长时间可见了? – 2010-11-08 16:34:07