org.xml.sax.SAXParseException; The prefix "tem" for element "tem:UN" is not bound.

Rashmitha B 0 Reputation points
2024-02-12T06:57:50.3+00:00

Iam integrating service references from wsdl file in C#. the service is working fine with SOAPUI but while executing the process in C# it is giving exception asorg.xml.sax.SAXParseException; lineNumber: 2; columnNumber: 9; The prefix "tem" for element "tem:UN" is not bound. Any soltion for this . service example:

public IntegrationPlatformService.AIMSWeb.AimsAirportList FetchAirports(string   UN, string PSW) {  return base.Channel.FetchAirports(UN, PSW);  }

WSDL file :

<?xml version="1.0" encoding="utf-8"?> <wsdl:definitions xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:tns="http://tempuri.org/" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="api_x002F_soap_x002F_aimswebservice" targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> <wsdl:types> <xs:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:import namespace="http://schemas.datacontract.org/2004/07/AIMS.Data.AimsWebService" /> <xs:element name="FetchCountries"> <xs:complexType> <xs:sequence> <xs:element minOccurs="0" name="UN" nillable="true" type="xs:string" /> <xs:element minOccurs="0" name="PSW" nillable="true" type="xs:string" /> <xs:element minOccurs="0" name="CountryCode" nillable="true" type="xs:string" /> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="FetchCountriesResponse"> <xs:complexType> <xs:sequence> <xs:element xmlns:q1="http://schemas.datacontract.org/2004/07/AIMS.Data.AimsWebService" minOccurs="0" name="FetchCountriesResult" nillable="true" type="q1:AIMSCountriesList" /> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="FetchAirports"> <xs:complexType> <xs:sequence>
.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,182 questions
Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,432 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
9,973 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Rashmitha B 0 Reputation points
    2024-02-18T11:28:55.1566667+00:00

    This is the complete wsdl file.


  2. Rashmitha B 0 Reputation points
    2024-02-21T10:20:03.33+00:00

    Yes its loading properly but when I call that service, it is throwing exception using (var client = new ServiceReference1.AIMSWebServiceClient()) { var flightDetails = client.FetchAirports("", "");

                    var flights = flightDetails != null ? flightDetails.cCount: 0;
                }