0

I have a WSDL file.

I need to perform a request with 2 parameters of Custom type, and get the response.

I have added a Service Reference in my client application like so:

using WSDLCall.wsdlReference;

After which proxy has been generated.

getCustomerData custInfo = new getCustomerData();

here, getCustomerData is a class, which is having 2 custom type parameters.

I need to assign value to those params and get response.

my wsdl schema:



    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.7.9.0")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://someurl" +
    "gement/v1")]
    public partial class GetCustomerData : object,                                         System.ComponentModel.INotifyPropertyChanged {

    private CustID custAccIDField;

    private OtherOrgId1 idField;

    /// 
    [System.Xml.Serialization.XmlElementAttribute(Order=0)]
    public CustID custAccID {
    get {
    return this.custAccIDField;
    }
    set {
    this.custAccIDField = value;
    this.PropertyChanged("custAccID");
    }
    }

    /// 
    [System.Xml.Serialization.XmlElementAttribute(Order=1)]
    public OtherOrgId1 id {
    get {
    return this.idField;
    }
    set {
    this.idField = value;
    this.PropertyChanged("id");
    }
    }

    public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;

    protected void PropertyChanged(string propertyName) {
    System.ComponentModel.PropertyChangedEventHandler propertyChanged =    this.PropertyChanged;
    if ((propertyChanged != null)) {
    propertyChanged(this, new     System.ComponentModel.PropertyChangedEventArgs(propertyName));
    }
    }
    }

    
user5226582
  • 1,946
  • 1
  • 22
  • 37
Kingshuk
  • 9
  • 3

2 Answers2

0

You didn't post your wsdl schema so you will have to substitute your method and class names.

To perform a call:

var client = new WSDLCall.wsdlClient(); 

var param1 = new WSDLCall. ??? ();
var param2 = new WSDLCall. ??? ();
var result = client.getCustomerData(param1, param2);

Reference link

user5226582
  • 1,946
  • 1
  • 22
  • 37
0

First, did you have a endpoint in your definition structure ? If not, you do add this in using WSDLCall.wsdlReference = new WSDLCall.wsdlReference(name, url)

Next, be sure that custom type is declared in wsdl too.

Then, you can assign value in your parameters

getCustomerData custInfo = new getCustomerData(); custInfo.Foo = new Foo { Id = 1, Text = "Foo" }; ...

But if you don't have any methods to retrieve data, you can't "get a response"

In good condition, you will have a class to structure your data (CustomerData with custom type parameters) AND methods as getCustomer(int id), getAllCustomer(), setCustomer(Customer cust), ...

As I see, your constructor return is not void and send the data with 2 params in constructor. So you can instanciate the class with custom too, but same as above the custom type should be declared in wsdl too.

EDIT : It is as announced, you don't have definition of CustID and OtherOrgId1 in your WSDL. Check the url from

[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://someurl" +
    "gement/v1")] 

if there is a definition of params at this place. Without this definition, you can't request anything.

User.Anonymous
  • 1,719
  • 1
  • 28
  • 51