Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

StackOverflow Point

StackOverflow Point Navigation

  • Web Stories
  • Badges
  • Tags
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Web Stories
  • Badges
  • Tags
Home/ Questions/Q 185392
Alex Hales
  • 0
Alex HalesTeacher
Asked: June 9, 20222022-06-09T21:28:48+00:00 2022-06-09T21:28:48+00:00

c# – Error on Web Service request: The top XML element ‘parameters’ from namespace ” references distinct types

  • 0

[ad_1]

I have the following service interface that I have imported using the Visual Studio tool (it is a WCF Web Service).

Reference.cs

But when I try to consume the service AuthenticateJAAS (execute the web service), I get the following error:

InvalidOperationException: The top XML element ‘parameters’ from namespace ” references distinct types XAFProject.Module.WS.MCWFUsers.mcwfUsersGetUserGroupsIn and XAFProject.Module.WS.MCWFUsers.mcwfUsersAuthenticateJAASIn. Use XML attributes to specify another XML name or namespace for the element or types.

I cannot change the namespace or the element name ‘parameters’, as it is from a WSDL that cannot be changed (third party). When I remove the class GetUserGroupsRequest and related content from the Reference.cs, I can consume the web service AuthenticateJAAS without problems. The generated XML is:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <AuthenticateJAAS xmlns="http://services.senior.com.br">
      <user xmlns=""/>
      <password xmlns=""/>
      <encryption xmlns="">0</encryption>
      <parameters xmlns="">
        <flowInstanceID xsi:nil="true"/>
        <flowName xsi:nil="true"/>
        <pmUserName>******</pmUserName>
        <pmUserPassword>******</pmUserPassword>
      </parameters>
    </AuthenticateJAAS>
  </s:Body>
</s:Envelope>

Is there a way to use both methods/services (AuthenticateJAAS + GetUserGroupsRequest) without any error? I was thinking that maybe, if I use namespace prefixes, I could manage to use both services, I think.

Here is the part of the code that I initialize the client and execute the service:

sapiens_SyncMCWFUsersClient mCWFUsersClient = new sapiens_SyncMCWFUsersClient(); 
mcwfUsersAuthenticateJAASIn parameters = new mcwfUsersAuthenticateJAASIn();
parametrosEntrada.pmUserName = "******";
parametrosEntrada.pmUserPassword = "******";
parametrosEntrada.pmEncrypted = 0;
AuthenticateJAASRequest request = new AuthenticateJAASRequest("", "", 0, parameters); 
AuthenticateJAASResponse response = mCWFUsersClient.AuthenticateJAAS(request);

[ad_2]

  • 0 0 Answers
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report
Leave an answer

Leave an answer
Cancel reply

Browse

Sidebar

Ask A Question

Related Questions

  • xcode - Can you build dynamic libraries for iOS and ...

    • 0 Answers
  • bash - How to check if a process id (PID) ...

    • 399 Answers
  • database - Oracle: Changing VARCHAR2 column to CLOB

    • 371 Answers
  • What's the difference between HEAD, working tree and index, in ...

    • 366 Answers
  • Amazon EC2 Free tier - how many instances can I ...

    • 0 Answers

Stats

  • Questions : 43k

Subscribe

Login

Forgot Password?

Footer

Follow

© 2022 Stackoverflow Point. All Rights Reserved.

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.