1

Svcutil.exe gives this warning:

The optional WSDL extension element 'Policy' from namespace 'http://schemas.xmlsoap.org/ws/2004/09/policy' was not handled.

and a team member reports a similar Java tool crashes with an exception (I don't have any details).

<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:p1="urn:mycompany.com:fi:myservice" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" name="MyService" targetNamespace="urn:mycompany.com:fi:myservice">
   <wsp:UsingPolicy wsdl:required="true" />
   <wsp:Policy wsu:Id="OP_DoSomething" />
   <wsdl:portType name="MyPort">
      <wsdl:operation name="DoSomething">
         <wsp:Policy>
            <wsp:PolicyReference URI="#OP_DoSomething" />
         </wsp:Policy>
         <wsdl:input message="p1:MyRequest" />
      </wsdl:operation>
   </wsdl:portType>
</wsdl:definitions>

Removing the policy elements solves the problem. Any ideas why?

4

1 回答 1

1

WS-Policy 的当前版本是 1.5 版。它使用命名空间http://www.w3.org/ns/ws-policy

请参阅“ XML 命名空间”。


确实,看起来您已经获得了 1.2 版。它使用http://schemas.xmlsoap.org/ws/2004/09/policy/ws-policy.xsd. 请参阅http://schemas.xmlsoap.org/ws/2004/09/policy/

于 2013-03-06T05:36:47.763 回答