error with web service call

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?QWNl?=

    #1

    error with web service call

    hi all,
    we are trying to hook up with a web service provided by one of our vendors.
    i got their wsdl file and generated a proxy class using wsdl.exe. below is
    the method signature as well as the class associated with it:

    public partial class WSProxy :
    System.Web.Serv ices.Protocols. SoapHttpClientP rotocol
    {
    ....
    public MyArray SearchThis([System.Xml.Seri alization.XmlEl ementAttribute( Form
    = System.Xml.Sche ma.XmlSchemaFor m.Unqualified, IsNullable = true)] string
    SearchName)
    {
    object[] results = this.Invoke("Se archNow", new object[] {
    SearchName});
    return ((MyArray)(resu lts[0]));
    }
    }

    public partial class MyArray : Array
    {
    }

    public partial class Array
    {

    private System.Xml.XmlE lement[] anyField;

    .....
    }


    and here is how i consume this method on my code.

    try
    {
    private WSProxy proxy = new WSProxy();
    myArray oArray = new myArray();
    oArray = proxy.searchThi s(strSearchName );
    }
    catch (Exception e)
    {
    throw e;
    }

    it looks simple to me; however, i am getting the following error:

    message: "There is an error in XML document (2, 347)."
    inner exception: "The specified type was not recognized: name='Array',
    namespace='http ://schemas.xmlsoap .org/soap/encoding/', at <SearchResult
    xmlns=''>."

    any suggestions?

    thanks...a
  • John Saunders [MVP]

    #2
    Re: error with web service call

    "Ace" <Ace@discussion s.microsoft.com wrote in message
    news:E0FC58DD-EC24-4E00-AED8-F259522D88AC@mi crosoft.com...
    hi all,
    we are trying to hook up with a web service provided by one of our
    vendors.
    i got their wsdl file and generated a proxy class using wsdl.exe. below
    is
    the method signature as well as the class associated with it:
    >
    public partial class WSProxy :
    System.Web.Serv ices.Protocols. SoapHttpClientP rotocol
    {
    ...
    public MyArray
    SearchThis([System.Xml.Seri alization.XmlEl ementAttribute( Form
    = System.Xml.Sche ma.XmlSchemaFor m.Unqualified, IsNullable = true)] string
    SearchName)
    {
    object[] results = this.Invoke("Se archNow", new object[] {
    SearchName});
    return ((MyArray)(resu lts[0]));
    }
    }
    >
    public partial class MyArray : Array
    {
    }
    >
    public partial class Array
    {
    >
    private System.Xml.XmlE lement[] anyField;
    >
    ....
    }
    >
    >
    and here is how i consume this method on my code.
    >
    try
    {
    private WSProxy proxy = new WSProxy();
    myArray oArray = new myArray();
    oArray = proxy.searchThi s(strSearchName );
    }
    catch (Exception e)
    {
    throw e;
    }
    >
    it looks simple to me; however, i am getting the following error:
    >
    message: "There is an error in XML document (2, 347)."
    inner exception: "The specified type was not recognized: name='Array',
    namespace='http ://schemas.xmlsoap .org/soap/encoding/', at <SearchResult
    xmlns=''>."
    >
    any suggestions?
    For one thing, I'd suggest your vendor not use the word "Array" as a type
    name!

    I'd like to see all or part of the WSDL, though. In particular, I'm
    wondering where all the XML namespaces are.
    --
    John Saunders [MVP]


    Comment

    Working...