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 6883389
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:22:39+00:00 2026-05-27T05:22:39+00:00

I have a webservices and I’ve added it to my .NET project as a

  • 0

I have a webservices and I’ve added it to my .NET project as a web reference. One of the web methods returns a nested array (NameValuePairDTOArray[NameValuePairDTO[]). I can only get null objects in .NET code, but it did return the data when I tested by SoapUI.

I pasted some part of the wsdl file here.

This is the method definition.

<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://services.mymachine.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="IneteractionService" targetNamespace="http://services.mymachine.com/">
    <operation name="getValue" parameterOrder="parameters">
        <input message="tns:MyServices_getValues"/>
        <output message="tns:MyServices_getValuesResponse"/>
        <fault message="tns:ServiceException" name="ServiceException"/>
    </operation>

    <xs:schema xmlns:ns1="http://ods.mymachine.com/v1_0_0" xmlns:tns="http://services.mymachine.com/" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://services.mymachine.com/" version="1.0">
        <xs:import namespace="http://ods.mymachine.com/v1_0_0"/>
        <xs:element name="ServiceException" type="tns:ServiceException"/>
        <xs:element name="getValue" type="tns:getValue"/>
        <xs:element name="getValuesResponse" type="tns:getValuesResponse"/>
        <xs:complexType name="getValue">
            <xs:sequence>
            <xs:element minOccurs="0" name="firstName" type="xs:string"/>
            <xs:element minOccurs="0" name="lastName" type="xs:string"/>
            </xs:sequence>
        </xs:complexType>
        <xs:complexType name="getValuesResponse">
            <xs:sequence>
            <xs:element maxOccurs="unbounded" minOccurs="0" name="return" type="ns1:NameValuePairDTOArray"/>
            </xs:sequence>
        </xs:complexType>
    </xs:schema>
</definitions>

This is the response data definitions.

<xs:schema xmlns:ns1="http://common.mymanchine.com/v1_0_0" xmlns:tns="http://ods.mymachine.com/v1_0_0" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://ods.mymachine.com/v1_0_0" version="1.0">
    <xs:import namespace="http://common.mymanchine.com/v1_0_0"/>
    <xs:complexType final="#all" name="NameValuePairDTOArray">
        <xs:sequence>
        <xs:element maxOccurs="unbounded" minOccurs="0" name="item" nillable="true" type="tns:NameValuePairDTO"/>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="NameValuePairDTO">
        <xs:complexContent>
            <xs:extension base="ns1:DataTransferObject">
                <xs:sequence/>
                <xs:attribute name="name" type="xs:string"/>
                <xs:attribute name="value" type="xs:string"/>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
</xs:schema

The proxy classes generated by .NET are like:

[WebServiceBinding(Name = "InteractionServicesBinding", Namespace = "http://services.mymachine.com/")]
[XmlInclude(typeof(DataTransferObject))]
[DebuggerStepThrough]
[GeneratedCode("System.Web.Services", "4.0.30319.1")]
[DesignerCategory("code")]
public class InteractionServicesServiceWse : WebServicesClientProtocol
{
    public InteractionServicesServiceWse();

    [SoapDocumentMethod("", RequestNamespace = "http://services.mymachine.com/", 
     ResponseNamespace = "http://services.services.mymachine.com/", Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)]
    public NameValuePairDTOArray[] getValue(string firstName, string lastName);
}

[Serializable]
[XmlType(Namespace = "http://ods.mymachine.com/v1_0_0")]
[GeneratedCode("System.Xml", "4.0.30319.233")]
[DebuggerStepThrough]
[DesignerCategory("code")]
public class NameValuePairDTOArray
{
    public NameValuePairDTOArray();

    [XmlElement("item", IsNullable = true)]
    public NameValuePairDTO[] item { get; set; }
}

[Serializable]
[DesignerCategory("code")]
[XmlType(Namespace = "http://ods.mymachine.com/v1_0_0")]
[GeneratedCode("System.Xml", "4.0.30319.233")]
[DebuggerStepThrough]
public class NameValuePairDTO : DataTransferObject
{
    public NameValuePairDTO();

    [XmlAttribute]
    public string name { get; set; }
    [XmlAttribute]
    public string value { get; set; }
}

Now if I call getValue(“John”, “Peter”), it will return as below in .NET.

enter image description here

But the soapUI returns something like:

<env:Body>
  <ns2:getValueResponse xmlns:ns2="http://services.mymachine.com/">
     <return>
        <item value="123" name="BONUS_ID"/>
        <item value="456" name="POPUP_OBJECT_ID"/>
     </return>
     <return>
        <item value="123" name="BONUS_ID"/>
        <item value="567" name="POPUP_OBJECT_ID"/>
     </return>
  </ns2:getValueResponse>
</env:Body>

It seems that .NET cannot detect that NameValuePairDTO/item is an array.

What’s wrong?

  • 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-27T05:22:40+00:00Added an answer on May 27, 2026 at 5:22 am

    Well, the issue turned out to be that something was wrong in the server side.

    The schema defined that NameValuePairDTOArray and NameValuePairDTO were quailifed.

    But look at the response xml,

    <env:Body>
      <ns2:getValueResponse xmlns:ns2="http://services.mymachine.com/">
         <return>
            <item value="123" name="BONUS_ID"/>
            <item value="456" name="POPUP_OBJECT_ID"/>
         </return>
         <return>
            <item value="123" name="BONUS_ID"/>
            <item value="567" name="POPUP_OBJECT_ID"/>
         </return>
      </ns2:getValueResponse>
    

    The return(NameValuePairDTOArray) and item(NameValuePairDTO) are unqualified. And the proxy class generated assumes that they are qualified because schema defined, but this caused the failure to parse the xml.

    The quick fix will be to manually add the unqualifed attribute to the NameValuePairDTO property in NameValuePairDTOArray class.In the future, the serve side should fix this issue.

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

Sidebar

Related Questions

I have a few webservices (.net 2.0/ C#) used by many partners. One of
I am using apache tomcat as a web server. I have deployed webservices on
I am using Spring and Maven project. I have Project mit-webservices and mit-util project
I have a list of webservices from a Flex project. I am trying to
I have an asp.net application and webservices (asmx) that reside in the same application
I have inherited a set of legacy webservices (VB.Net, IIS hosted ASMX) in which
I have a number of different webservices in the C# web application I'm building
I have deployed some jax-ws webservices in a tomcat: web.xml: ... <servlet> <servlet-name>WebServiceJaxWs</servlet-name> <servlet-class>...a
I have made a Rest Web Service: package org.jboss.samples.rs.webservices; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import
I am using Java and SOAP. I have two webservices. One (A), which generates

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.