0
votes

I get warnings regarding my app.config file in my project because I upgraded my service reference to a newer version with some different methods and configurations. Is there a way that I can generate a new app.config file and not have to change all its bindings and endpoints because that will be very exhausting. there must be a way i guess.

This is my app.config:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <system.diagnostics>
        <sources>
            <!-- This section defines the logging configuration for My.Application.Log -->
            <source name="DefaultSource" switchName="DefaultSwitch">
                <listeners>
                    <add name="FileLog"/>
                    <!-- Uncomment the below section to write to the Application Event Log -->
                    <!--<add name="EventLog"/>-->
                </listeners>
            </source>
        </sources>
        <switches>
            <add name="DefaultSwitch" value="Information" />
        </switches>
        <sharedListeners>
            <add name="FileLog"
                 type="Microsoft.VisualBasic.Logging.FileLogTraceListener, Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"
                 initializeData="FileLogWriter"/>
            <!-- Uncomment the below section and replace APPLICATION_NAME with the name of your application to write to the Application Event Log -->
            <!--<add name="EventLog" type="System.Diagnostics.EventLogTraceListener" initializeData="APPLICATION_NAME"/> -->
        </sharedListeners>
    </system.diagnostics>
    <system.serviceModel>
        <bindings>
            <basicHttpBinding>
                <binding name="Apsis Newsletter Pro v3 APISoap" closeTimeout="00:01:00"
                    openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                    allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
                    maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                    messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
                    useDefaultWebProxy="true">
                    <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                    <security mode="None">
                        <transport clientCredentialType="None" proxyCredentialType="None"
                            realm="" />
                        <message clientCredentialType="UserName" algorithmSuite="Default" />
                    </security>
                </binding>
            </basicHttpBinding>
            <customBinding>
                <binding name="Apsis Newsletter Pro v3 APISoap12">
                    <textMessageEncoding maxReadPoolSize="64" maxWritePoolSize="16"
                        messageVersion="Soap12" writeEncoding="utf-8">
                        <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                            maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                    </textMessageEncoding>
                    <httpTransport manualAddressing="false" maxBufferPoolSize="524288"
                        maxReceivedMessageSize="65536" allowCookies="false" authenticationScheme="Anonymous"
                        bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
                        keepAliveEnabled="true" maxBufferSize="65536" proxyAuthenticationScheme="Anonymous"
                        realm="" transferMode="Buffered" unsafeConnectionNtlmAuthentication="false"
                        useDefaultWebProxy="true" />
                </binding>
            </customBinding>
        </bindings>
        <client>
            <endpoint address="http://api.anpdm.com/ExternalAPIService.asmx"
                binding="basicHttpBinding" bindingConfiguration="Apsis Newsletter Pro v3 APISoap"
                contract="Apsis5.ApsisNewsletterProv3APISoap" name="Apsis Newsletter Pro v3 APISoap" />
            <endpoint address="http://api.anpdm.com/ExternalAPIService.asmx"
                binding="customBinding" bindingConfiguration="Apsis Newsletter Pro v3 APISoap12"
                contract="Apsis5.ApsisNewsletterProv3APISoap" name="Apsis Newsletter Pro v3 APISoap12" />
        </client>
    </system.serviceModel>
</configuration>

These are the warnings:

Warning 1:Custom tool warning: Cannot import wsdl:portType Detail: An exception was thrown while running a WSDL import extension: System.ServiceModel.Description.XmlSerializerMessageContractImporter Error: Referenced type 'http://schemas.xmlsoap.org/soap/encoding/:Array' is only valid for encoded SOAP. XPath to Error Source: //wsdl:definitions[@targetNamespace='http://api.anpdm.com/']/wsdl:portType[@name='Apsis_x0020_Newsletter_x0020_Pro_x0020_v3_x0020_APIHttpGet'] C:\Users\Pedram\Desktop\Apsis5 (Avanza)\Apsis5\Service References\Apsis5\Reference.svcmap 1 1 Apsis5

Warning 2 Custom tool warning: Cannot import wsdl:binding Detail: There was an error importing a wsdl:portType that the wsdl:binding is dependent on. XPath to wsdl:portType: //wsdl:definitions[@targetNamespace='http://api.anpdm.com/']/wsdl:portType[@name='Apsis_x0020_Newsletter_x0020_Pro_x0020_v3_x0020_APIHttpGet'] XPath to Error Source: //wsdl:definitions[@targetNamespace='http://api.anpdm.com/']/wsdl:binding[@name='Apsis_x0020_Newsletter_x0020_Pro_x0020_v3_x0020_APIHttpGet'] C:\Users\Pedram\Desktop\Apsis5 (Avanza)\Apsis5\Service References\Apsis5\Reference.svcmap 1 1 Apsis5

Warning 3 Custom tool warning: Cannot import wsdl:port Detail: There was an error importing a wsdl:binding that the wsdl:port is dependent on. XPath to wsdl:binding: //wsdl:definitions[@targetNamespace='http://api.anpdm.com/']/wsdl:binding[@name='Apsis_x0020_Newsletter_x0020_Pro_x0020_v3_x0020_APIHttpGet'] XPath to Error Source: //wsdl:definitions[@targetNamespace='http://api.anpdm.com/']/wsdl:service[@name='Apsis_x0020_Newsletter_x0020_Pro_x0020_v3_x0020_API']/wsdl:port[@name='Apsis_x0020_Newsletter_x0020_Pro_x0020_v3_x0020_APIHttpGet'] C:\Users\Pedram\Desktop\Apsis5 (Avanza)\Apsis5\Service References\Apsis5\Reference.svcmap 1 1 Apsis5

Warning 4 Custom tool warning: Cannot import wsdl:portType Detail: An exception was thrown while running a WSDL import extension: System.ServiceModel.Description.XmlSerializerMessageContractImporter Error: Referenced type 'http://schemas.xmlsoap.org/soap/encoding/:Array' is only valid for encoded SOAP. XPath to Error Source: //wsdl:definitions[@targetNamespace='http://api.anpdm.com/']/wsdl:portType[@name='Apsis_x0020_Newsletter_x0020_Pro_x0020_v3_x0020_APIHttpPost'] C:\Users\Pedram\Desktop\Apsis5 (Avanza)\Apsis5\Service References\Apsis5\Reference.svcmap 1 1 Apsis5

Warning 5 Custom tool warning: Cannot import wsdl:binding Detail: There was an error importing a wsdl:portType that the wsdl:binding is dependent on. XPath to wsdl:portType: //wsdl:definitions[@targetNamespace='http://api.anpdm.com/']/wsdl:portType[@name='Apsis_x0020_Newsletter_x0020_Pro_x0020_v3_x0020_APIHttpPost'] XPath to Error Source: //wsdl:definitions[@targetNamespace='http://api.anpdm.com/']/wsdl:binding[@name='Apsis_x0020_Newsletter_x0020_Pro_x0020_v3_x0020_APIHttpPost'] C:\Users\Pedram\Desktop\Apsis5 (Avanza)\Apsis5\Service References\Apsis5\Reference.svcmap 1 1 Apsis5

Warning 6 Custom tool warning: Cannot import wsdl:port Detail: There was an error importing a wsdl:binding that the wsdl:port is dependent on. XPath to wsdl:binding: //wsdl:definitions[@targetNamespace='http://api.anpdm.com/']/wsdl:binding[@name='Apsis_x0020_Newsletter_x0020_Pro_x0020_v3_x0020_APIHttpPost'] XPath to Error Source: //wsdl:definitions[@targetNamespace='http://api.anpdm.com/']/wsdl:service[@name='Apsis_x0020_Newsletter_x0020_Pro_x0020_v3_x0020_API']/wsdl:port[@name='Apsis_x0020_Newsletter_x0020_Pro_x0020_v3_x0020_APIHttpPost'] C:\Users\Pedram\Desktop\Apsis5 (Avanza)\Apsis5\Service References\Apsis5\Reference.svcmap 1 1 Apsis5

1
What are the warnings? Updating service reference should change the app.config.Amiram Korach
this is one of them: Warning 1 Custom tool warning: Cannot import wsdl:portType Detail: An exception was thrown while running a WSDL import extension: System.ServiceModel.Description.XmlSerializerMessageContractImporter Error: Referenced type 'schemas.xmlsoap.org/soap/encoding/:Array' is only valid for encoded SOAP. XPath to Error Source: //wsdl:definitions[@targetNamespace='api.anpdm.com/']/… C:\Users\Pedram\Desktop\Apsis5 (Avanza)\Apsis5\Service References\Apsis5\Reference.svcmap 1 1 Apsis5disasterkid
Please add it and the app.config to your questionAmiram Korach
Done. added app.config and the warnings.disasterkid
Looks like there is no problem with your app.config but with the service wsdl contentAmiram Korach

1 Answers

0
votes

I didn't find the root problem with this but I tried to add my service as a web reference and everything started working.