dimanche 27 août 2017

"Required xml:lang attribute value is missing" error

I'm new to this and stumbled upon a wall while creating an app which calls a web service. I've added the wsdl as service reference with no issues. The method I'm trying to call requires authentication through user key and login but the only thing I need to pass in a form is login (without auth it gives me failed login error). I used ClientCredentials to pass the username but then I received this:

   [CommunicationException: Server returned an invalid SOAP Fault.  Please see InnerException for more details.]

And inner exception:

   [XmlException: Required xml:lang attribute value is missing.]

I checked the log and response gave me a weird message (most of the code was provided by example in the documentation):

   Call to undefined method X::Action()

I honestly don't know how to approach this. It's doubtful that documentation is wrong so it should be on my end but can't figure out where. Plus, this app is supposed to be a widget able to be deployed on every site so it should be as simple as possible. Can you point me in the right direction on how to deal with this error? My web.config file:

<?xml version="1.0" encoding="utf-8"?>

<configuration>
  <system.diagnostics>  
  <system.web>
    <compilation debug="true" targetFramework="4.5.2"/>
    <httpRuntime targetFramework="4.5.2"/>
  </system.web>
  <system.codedom>
    <compilers>
      <compiler language="c#;cs;csharp" extension=".cs"
        type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701"/>
      <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb"
        type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+"/>
    </compilers>
  </system.codedom>
  <system.serviceModel>
    <diagnostics>
      <messageLogging logEntireMessage="true" logMalformedMessages="true"
        logMessagesAtTransportLevel="true" />
    </diagnostics>
    <bindings>
      <wsHttpBinding>
        <binding name="ApiClientsBinding">
          <security mode="Transport">
            <transport clientCredentialType="Basic" />
          </security>
        </binding>
      </wsHttpBinding>
    </bindings>
    <client>
      <endpoint address="http://ift.tt/2wSveRF"
        binding="wsHttpBinding" bindingConfiguration="ApiClientsBinding"
        contract="ServiceClient.ApiClientsPortType" name="ApiClientsPort" />
    </client>
  </system.serviceModel>
</configuration>

Thank you.




Aucun commentaire:

Enregistrer un commentaire