0

I'm trying to add wsdl using WCF. But at first I get an warning like this; enter image description here

Here is the details:

The following Policy Assertions were not Imported:

XPath://wsdl:definitions[@targetNamespace='urn:sap-com:document:sap:soap:functions:mc-style']/wsdl:binding[@name='zz_binding_SOAP12']

Assertions:

<saptrnbnd:OptimizedXMLTransfer xmlns:saptrnbnd='http://www.sap.com/webas/710/soap/features/transportbinding/'>..</saptrnbnd:OptimizedXMLTransfer>
<sapattahnd:Enabled xmlns:sapattahnd='http://www.sap.com/710/features/attachment/'>..</sapattahnd:Enabled>

The following Policy Assertions were not Imported:

XPath://wsdl:definitions[@targetNamespace='urn:sap-com:document:sap:soap:functions:mc-style']/wsdl:binding[@name='zz_binding']

Assertions:

    <saptrnbnd:OptimizedXMLTransfer xmlns:saptrnbnd='http://www.sap.com/webas/710/soap/features/transportbinding/'>..</saptrnbnd:OptimizedXMLTransfer>
    <sapattahnd:Enabled xmlns:sapattahnd='http://www.sap.com/710/features/attachment/'>..</sapattahnd:Enabled>

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

XPath: //wsdl:definitions[@targetNamespace='urn:sap-com:document:sap:soap:functions:mc-style']/wsdl:portType[@name='zz_test_web_structure']/wsdl:operation[@name='ZzTestWebService']

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

XPath: //wsdl:definitions[@targetNamespace='urn:sap-com:document:sap:soap:functions:mc-style']/wsdl:portType[@name='zz_test_web_structure']

I still can't run the wcf service after adding it. Does anyone know about this?

Dvyn Resh
  • 980
  • 1
  • 6
  • 14

1 Answers1

0

Microsoft WCF Web Service Reference Provider tool based on the Mex service endpoint, namely metadata exchange service endpoint instead of the Web service definition language(WSDL page).

  <services>
      <service name="WcfService1.Service1">
        <endpoint address="" binding="basicHttpBinding" contract="WcfService1.IService1" bindingConfiguration="mybinding"></endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"></endpoint>
      </service>
</services>

Or,

Binding mexbinding = MetadataExchangeBindings.CreateMexHttpBinding();
                sh.AddServiceEndpoint(typeof(IMetadataExchange), mexbinding, "mex");

If you prefer to generate a client proxy class by using WSDL, you could try the SVCUtil.exe tool.
https://learn.microsoft.com/en-us/dotnet/framework/wcf/servicemodel-metadata-utility-tool-svcutil-exe
All the above ways can generate a client proxy class.
https://learn.microsoft.com/en-us/dotnet/framework/wcf/accessing-services-using-a-wcf-client
Besides, In WCF4.5 there is a new feature called SingleWSDL, which contains the whole WSDL with the related schema. It could be consumed perfectly by a third-party system.
What is the difference between ?wsdl and ?singleWsdl parameters
https://learn.microsoft.com/en-us/dotnet/framework/wcf/whats-new
Feel free to let me know if there is anything I can help with.

Abraham Qian
  • 7,117
  • 1
  • 8
  • 22