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 a 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

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6473799
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:30:35+00:00 2026-05-25T06:30:35+00:00

In a c# project, I have to query some web services which is not

  • 0

In a c# project, I have to query some web services which is not build with .Net (actually WebLogic).

Where I can query most of the web services with no problem, I have difficulties with one. When I call the method, I get the following error (stack trace removed) :

System.InvalidOperationException: There was an error reflecting 'in'. 
---> System.InvalidOperationException: The top XML element 'in' from namespace '' references distinct types MyReference.DistantWS.firstMethodInType and MyReference.DistantWS.secondMethodInType.
 Use XML attributes to specify another XML name or namespace for the element or types.

After a bit of googling, I conclude this is due because the distant service have two methods FirstMethod and SecondMethod, both with a complex FirstMethodRequest type having a property “In” as input parameter. However, the In parameter have two distinct types(respectively firstMethodInType and secondMethodInType).

I use svcutil for building the proxy code. This actually generate the code :

Pseudo code :

class firstMethodRequest
{
    public firstMethodintype @in; // First occurence of a "in" parameter
}

class firstMethodintype
{
}

class secondMethodRequest
{
    public secondMethodintype @in; // Second occurence of a "in" parameter
}

class secondMethodintype
{
}

Full code :

[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
[System.ServiceModel.MessageContractAttribute(WrapperName="first-method", WrapperNamespace="http://mynamespace/ws/wsdl/first-method", IsWrapped=true)]
internal partial class firstMethodRequest
{
    [System.ServiceModel.MessageBodyMemberAttribute(Namespace="", Order=0)]
    public firstMethodintype @in;

    public firstMethodRequest()        {        }
    public firstMethodRequest(firstMethodintype @in)        {            this.@in = @in;        }
}

[System.CodeDom.Compiler.GeneratedCodeAttribute("svcutil", "4.0.30319.1")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(TypeName="first-method-in-type", Namespace="http://mynamespace")]
public partial class firstMethodintype
{
    private string site_origineField;
}

[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
[System.ServiceModel.MessageContractAttribute(WrapperName="second-method", WrapperNamespace="http://mynamespace/ws/wsdl/second-method", IsWrapped=true)]
internal partial class secondMethodRequest
{
    [System.ServiceModel.MessageBodyMemberAttribute(Namespace="", Order=0)]
    public secondMethodintype @in; // Problem is here

    public secondMethodRequest()        {        }
    public secondMethodRequest(secondMethodintype @in)        {            this.@in = @in;        }
}

[System.CodeDom.Compiler.GeneratedCodeAttribute("svcutil", "4.0.30319.1")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(TypeName="second-method-in-type", Namespace="http://mynamespace")]
public partial class secondMethodintype
{
    private string site_origineField;
}

As I don’t control the output code, how can I properly solve my problem ?

thx in advance

[Edit] Don’t know if it’s related, but here is an extract of the WSDL definition :

<message name="first-method-in">
    <part name="in" type="tp:first-method-in-type"/>
</message>
<message name="second-method-in">
    <part name="in" type="tp:second-method-in-type"/>
</message>

[Edit 2] Also, if the source WSDL / Schema is not valid or respectful to the W3C standards, please tells me. I can negotiate with the customer to rewrite its WS

[Edit 3] If I manually patch the wsdl to (renamed the second part) :

<message name="first-method-in">
    <part name="in" type="tp:first-method-in-type"/>
</message>
<message name="second-method-in">
    <part name="inSecond" type="tp:second-method-in-type"/>
</message>

then the problem disappeared (but of course the call to the second method stop working)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T06:30:36+00:00Added an answer on May 25, 2026 at 6:30 am

    Finally, I ask the customer to change its WSDL to avoid this name conflicts.
    This solved the problem and is probably the simplest way to solve the issue.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an asp.net mvc3 project, it has some reports in aspx web pages.
I have an asp.net mvc project that uses some search methods in a seperate
I have problems running a dynamic LIKE statement in my project: this query works
I have project Emle in Launchpad . I set it to import from emle.svn.sourceforge.net
For a particular project I have, no server side code is allowed. How can
I have several web sequential pages which will modify a record and its child
Im working on a web project in ASP .NET MVC 2. In this project
I have win 2008 R2 server with .net mvc project and other Ubuntu Linux
I've been doing some Web-Projects lately that rely on heavy Data-Binding and have been
I have a small project I am doing in Python using web.py. It's a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

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.