Question

sending soap request and reciving xml reply C#

Asked by: QuinnDester

I am having problems with soap and web references in C#

I have read lots abouit this and have got as far as setting up the web references with a namespace,

when i use the methods in the code behind they highlight so are recognised, intellisense is giving me all the choices for all the methods.

what i cant figure out is where i go next, i seem to have all the things needed available to me but i dont know how to put it all together to produce a soap request and receive an answer.

i have read pages of tutorials and 100's of forum posts about this but cant tie up what i have read with what i have infront of me (obviously i am having trouble understanding the procedure)

Any help that can be given will be greatfully received

Below is a simple peice of code, its a call to the webservice using the default method, only information that needs passing is username and password, this will then return default menues eg dropdownlist data.

i have got this far and can pass the username and password into the method as you can see below, how do I now execute the call to get the response

thanks

using System;
using System.IO;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using carhire;
using System.Xml.Xsl;
using System.Xml.XPath;
 
public partial class _Default : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {
        
        GetAllCarhireLevelsRequest testquery = new GetAllCarhireLevelsRequest("username", "password");
 
        
 
       
    }
}

                                  
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:

Select allOpen in new window

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2009-08-20 at 07:38:31ID24668344
Tags

C#

,

.NET

,

Visual C#

,

soap

,

web references

Topics

SOAP

,

C# Programming Language

,

Microsoft Visual C#.Net

Participating Experts
1
Points
500
Comments
13

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. SOAP
    Please give me ideas on how I can use SOAP as MIDDLEWARE. Thanks
  2. SOAP via XML
    Sample Request Message-login Call-Enterprise API POST https://www.salesforce.com/services/Soap/c/5.0 HTTP/1.1 User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 1.1.4322.573) Content-Type: text/xml; charset=utf-8 SOAPAction: "" ...
  3. XML and SOAP
    I am in the process of developing an ASP.net database project based on a Win32 prototype. I've been able to write a service application that uses BDP to connect to an Access database and client app which invokes the service, both passing parameters successfully. It was relat...
  4. How to use SimpleXML to set values on namespaced xml (…
    I am using SimpleXMLElement() to read in an xml template string. I'd like to set some values to the resulting xml object, but I don't know how to to it it with a SOAP template because it's all namespaced. In the below example, I'd like to set the values of <UserId&g...
  5. SOAP envelope version mismatch
    I am connecting a Java webserver, using .net c# SOAP, I received this error when I try to connect. Possible SOAP version mismatch: Envelope namespace http://schemas.xmlsoap.org/wsdl/ was unexpected. Expecting http://schemas.xmlsoap.org/soap/envelope/.

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: carl_tawnPosted on 2009-08-20 at 08:09:18ID: 25143473

I think you're getting confused between a method call to the web service and the constructor of the proxy class. When you add a web reference to an existing web service, Visual Studio will create a proxy class that provides a simplified method for you to interact with the service. Essentially doing away with the need for you to manually construct a SOAP request.

In your case the GetAllCarhireLevelsRequest class is a wrapper around a set of available methods of the web service, that happens to take a username and password as part of its constructor.

If you just type "testquery." in the IDE it should give you a list of the supported methods. One, or more, of which should allow you to retrieve that data you require.

 

by: QuinnDesterPosted on 2009-08-20 at 08:20:29ID: 25143651

I have done that, it gives me the options to add the user name and password.

adding them when creating the "wrapper" is just a short cut.

so what you are saying (i am just guessing here) is that i now need to send a httpwebrequest using "testquery"as the url ?

 

by: QuinnDesterPosted on 2009-08-20 at 08:28:45ID: 25143764

No just tried that it needs a string for the url create..

Understanding of this just hasnt dawned yet, the more i read about it the less i understand it.

could you give me an example of how the code should look.

 

by: carl_tawnPosted on 2009-08-20 at 08:47:47ID: 25144009

Do you happen to have the URL for the web service you are using, so we can check the WSDL?

 

by: QuinnDesterPosted on 2009-08-20 at 08:59:34ID: 25144135

its ip restricted, i can past the wdsl in here for you

<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:s7="http://ws-affiliate.afnt.co.uk/GetAllCarhireLevelsResponse" xmlns:s2="http://ws-affiliate.afnt.co.uk/GetCarhireSuppliersByCollectionPoint" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:s5="http://ws-affiliate.afnt.co.uk/GetCarhireLevelsResponse" xmlns:s8="http://ws-affiliate.afnt.co.uk/GetVehicleTypes" xmlns:s10="http://ws-affiliate.afnt.co.uk/CarHireSearch" xmlns:s0="http://ws-affiliate.afnt.co.uk/GetCarhireSuppliers" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:s3="http://ws-affiliate.afnt.co.uk/GetCarhireSuppliersByCollectionPointResponse" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:tns="http://ws-affiliate.afnt.co.uk/" xmlns:s6="http://ws-affiliate.afnt.co.uk/GetAllCarhireLevels" xmlns:s9="http://ws-affiliate.afnt.co.uk/GetVehicleTypesResponse" xmlns:s1="http://ws-affiliate.afnt.co.uk/GetCarhireSuppliersResponse" xmlns:s11="http://ws-affiliate.afnt.co.uk/CarHireSearchResponse" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:s4="http://ws-affiliate.afnt.co.uk/GetCarhireLevels" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" targetNamespace="http://ws-affiliate.afnt.co.uk/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
  <wsdl:types>
    <s:schema elementFormDefault="qualified" targetNamespace="http://ws-affiliate.afnt.co.uk/GetCarhireSuppliers">
      <s:element name="GetCarhireSuppliers">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="user" type="s:string" />
            <s:element minOccurs="0" maxOccurs="1" name="password" type="s:string" />
          </s:sequence>
        </s:complexType>
      </s:element>
    </s:schema>
    <s:schema elementFormDefault="qualified" targetNamespace="http://ws-affiliate.afnt.co.uk/GetCarhireSuppliersResponse">
      <s:element name="GetCarhireSuppliersResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="GetCarhireSuppliersResult">
              <s:complexType mixed="true">
                <s:sequence>
                  <s:any />
                </s:sequence>
              </s:complexType>
            </s:element>
          </s:sequence>
        </s:complexType>
      </s:element>
    </s:schema>
    <s:schema elementFormDefault="qualified" targetNamespace="http://ws-affiliate.afnt.co.uk/GetCarhireSuppliersByCollectionPoint">
      <s:element name="GetCarhireSuppliersByCollectionPoint">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="1" maxOccurs="1" name="CollectionPoint" type="s:int" />
            <s:element minOccurs="0" maxOccurs="1" name="user" type="s:string" />
            <s:element minOccurs="0" maxOccurs="1" name="password" type="s:string" />
          </s:sequence>
        </s:complexType>
      </s:element>
    </s:schema>
    <s:schema elementFormDefault="qualified" targetNamespace="http://ws-affiliate.afnt.co.uk/GetCarhireSuppliersByCollectionPointResponse">
      <s:element name="GetCarhireSuppliersByCollectionPointResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="GetCarhireSuppliersByCollectionPointResult">
              <s:complexType mixed="true">
                <s:sequence>
                  <s:any />
                </s:sequence>
              </s:complexType>
            </s:element>
          </s:sequence>
        </s:complexType>
      </s:element>
    </s:schema>
    <s:schema elementFormDefault="qualified" targetNamespace="http://ws-affiliate.afnt.co.uk/GetCarhireLevels">
      <s:element name="GetCarhireLevels">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="1" maxOccurs="1" name="ParentId" type="s:int" />
            <s:element minOccurs="0" maxOccurs="1" name="user" type="s:string" />
            <s:element minOccurs="0" maxOccurs="1" name="password" type="s:string" />
          </s:sequence>
        </s:complexType>
      </s:element>
    </s:schema>
    <s:schema elementFormDefault="qualified" targetNamespace="http://ws-affiliate.afnt.co.uk/GetCarhireLevelsResponse">
      <s:element name="GetCarhireLevelsResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="GetCarhireLevelsResult">
              <s:complexType mixed="true">
                <s:sequence>
                  <s:any />
                </s:sequence>
              </s:complexType>
            </s:element>
          </s:sequence>
        </s:complexType>
      </s:element>
    </s:schema>
    <s:schema elementFormDefault="qualified" targetNamespace="http://ws-affiliate.afnt.co.uk/GetAllCarhireLevels">
      <s:element name="GetAllCarhireLevels">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="user" type="s:string" />
            <s:element minOccurs="0" maxOccurs="1" name="password" type="s:string" />
          </s:sequence>
        </s:complexType>
      </s:element>
    </s:schema>
    <s:schema elementFormDefault="qualified" targetNamespace="http://ws-affiliate.afnt.co.uk/GetAllCarhireLevelsResponse">
      <s:element name="GetAllCarhireLevelsResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="GetAllCarhireLevelsResult">
              <s:complexType mixed="true">
                <s:sequence>
                  <s:any />
                </s:sequence>
              </s:complexType>
            </s:element>
          </s:sequence>
        </s:complexType>
      </s:element>
    </s:schema>
    <s:schema elementFormDefault="qualified" targetNamespace="http://ws-affiliate.afnt.co.uk/GetVehicleTypes">
      <s:element name="GetVehicleTypes">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="user" type="s:string" />
            <s:element minOccurs="0" maxOccurs="1" name="password" type="s:string" />
          </s:sequence>
        </s:complexType>
      </s:element>
    </s:schema>
    <s:schema elementFormDefault="qualified" targetNamespace="http://ws-affiliate.afnt.co.uk/GetVehicleTypesResponse">
      <s:element name="GetVehicleTypesResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="GetVehicleTypesResult">
              <s:complexType mixed="true">
                <s:sequence>
                  <s:any />
                </s:sequence>
              </s:complexType>
            </s:element>
          </s:sequence>
        </s:complexType>
      </s:element>
    </s:schema>
    <s:schema elementFormDefault="qualified" targetNamespace="http://ws-affiliate.afnt.co.uk/CarHireSearch">
      <s:element name="CarHireSearch">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="ProviderName" type="s:string" />
            <s:element minOccurs="0" maxOccurs="1" name="CollectionDate" type="s:string" />
            <s:element minOccurs="0" maxOccurs="1" name="CollectionTime" type="s:string" />
            <s:element minOccurs="0" maxOccurs="1" name="CollectionPoint" type="s:string" />
            <s:element minOccurs="0" maxOccurs="1" name="ReturnDate" type="s:string" />
            <s:element minOccurs="0" maxOccurs="1" name="ReturnTime" type="s:string" />
            <s:element minOccurs="0" maxOccurs="1" name="ReturnPoint" type="s:string" />
            <s:element minOccurs="1" maxOccurs="1" name="VehicleClassType" type="s:int" />
            <s:element minOccurs="0" maxOccurs="1" name="DriverAge" type="s:string" />
            <s:element minOccurs="0" maxOccurs="1" name="user" type="s:string" />
            <s:element minOccurs="0" maxOccurs="1" name="password" type="s:string" />
            <s:element minOccurs="0" maxOccurs="1" name="tracking" type="s:string" />
            <s:element minOccurs="0" maxOccurs="1" name="wait_time" type="s:string" />
            <s:element minOccurs="1" maxOccurs="1" name="max_age_of_records" type="s:int" />
          </s:sequence>
        </s:complexType>
      </s:element>
    </s:schema>
    <s:schema elementFormDefault="qualified" targetNamespace="http://ws-affiliate.afnt.co.uk/CarHireSearchResponse">
      <s:element name="CarHireSearchResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="CarHireSearchResult">
              <s:complexType mixed="true">
                <s:sequence>
                  <s:any />
                </s:sequence>
              </s:complexType>
            </s:element>
          </s:sequence>
        </s:complexType>
      </s:element>
    </s:schema>
  </wsdl:types>
  <wsdl:message name="GetCarhireSuppliersSoapIn">
    <wsdl:part name="parameters" element="s0:GetCarhireSuppliers" />
  </wsdl:message>
  <wsdl:message name="GetCarhireSuppliersSoapOut">
    <wsdl:part name="parameters" element="s1:GetCarhireSuppliersResponse" />
  </wsdl:message>
  <wsdl:message name="GetCarhireSuppliersByCollectionPointSoapIn">
    <wsdl:part name="parameters" element="s2:GetCarhireSuppliersByCollectionPoint" />
  </wsdl:message>
  <wsdl:message name="GetCarhireSuppliersByCollectionPointSoapOut">
    <wsdl:part name="parameters" element="s3:GetCarhireSuppliersByCollectionPointResponse" />
  </wsdl:message>
  <wsdl:message name="GetCarhireLevelsSoapIn">
    <wsdl:part name="parameters" element="s4:GetCarhireLevels" />
  </wsdl:message>
  <wsdl:message name="GetCarhireLevelsSoapOut">
    <wsdl:part name="parameters" element="s5:GetCarhireLevelsResponse" />
  </wsdl:message>
  <wsdl:message name="GetAllCarhireLevelsSoapIn">
    <wsdl:part name="parameters" element="s6:GetAllCarhireLevels" />
  </wsdl:message>
  <wsdl:message name="GetAllCarhireLevelsSoapOut">
    <wsdl:part name="parameters" element="s7:GetAllCarhireLevelsResponse" />
  </wsdl:message>
  <wsdl:message name="GetVehicleTypesSoapIn">
    <wsdl:part name="parameters" element="s8:GetVehicleTypes" />
  </wsdl:message>
  <wsdl:message name="GetVehicleTypesSoapOut">
    <wsdl:part name="parameters" element="s9:GetVehicleTypesResponse" />
  </wsdl:message>
  <wsdl:message name="CarHireSearchSoapIn">
    <wsdl:part name="parameters" element="s10:CarHireSearch" />
  </wsdl:message>
  <wsdl:message name="CarHireSearchSoapOut">
    <wsdl:part name="parameters" element="s11:CarHireSearchResponse" />
  </wsdl:message>
  <wsdl:message name="GetCarhireSuppliersHttpPostIn">
    <wsdl:part name="user" type="s:string" />
    <wsdl:part name="password" type="s:string" />
  </wsdl:message>
  <wsdl:message name="GetCarhireSuppliersHttpPostOut">
    <wsdl:part name="Body" />
  </wsdl:message>
  <wsdl:message name="GetCarhireSuppliersByCollectionPointHttpPostIn">
    <wsdl:part name="CollectionPoint" type="s:string" />
    <wsdl:part name="user" type="s:string" />
    <wsdl:part name="password" type="s:string" />
  </wsdl:message>
  <wsdl:message name="GetCarhireSuppliersByCollectionPointHttpPostOut">
    <wsdl:part name="Body" />
  </wsdl:message>
  <wsdl:message name="GetCarhireLevelsHttpPostIn">
    <wsdl:part name="ParentId" type="s:string" />
    <wsdl:part name="user" type="s:string" />
    <wsdl:part name="password" type="s:string" />
  </wsdl:message>
  <wsdl:message name="GetCarhireLevelsHttpPostOut">
    <wsdl:part name="Body" />
  </wsdl:message>
  <wsdl:message name="GetAllCarhireLevelsHttpPostIn">
    <wsdl:part name="user" type="s:string" />
    <wsdl:part name="password" type="s:string" />
  </wsdl:message>
  <wsdl:message name="GetAllCarhireLevelsHttpPostOut">
    <wsdl:part name="Body" />
  </wsdl:message>
  <wsdl:message name="GetVehicleTypesHttpPostIn">
    <wsdl:part name="user" type="s:string" />
    <wsdl:part name="password" type="s:string" />
  </wsdl:message>
  <wsdl:message name="GetVehicleTypesHttpPostOut">
    <wsdl:part name="Body" />
  </wsdl:message>
  <wsdl:message name="CarHireSearchHttpPostIn">
    <wsdl:part name="ProviderName" type="s:string" />
    <wsdl:part name="CollectionDate" type="s:string" />
    <wsdl:part name="CollectionTime" type="s:string" />
    <wsdl:part name="CollectionPoint" type="s:string" />
    <wsdl:part name="ReturnDate" type="s:string" />
    <wsdl:part name="ReturnTime" type="s:string" />
    <wsdl:part name="ReturnPoint" type="s:string" />
    <wsdl:part name="VehicleClassType" type="s:string" />
    <wsdl:part name="DriverAge" type="s:string" />
    <wsdl:part name="user" type="s:string" />
    <wsdl:part name="password" type="s:string" />
    <wsdl:part name="tracking" type="s:string" />
    <wsdl:part name="wait_time" type="s:string" />
    <wsdl:part name="max_age_of_records" type="s:string" />
  </wsdl:message>
  <wsdl:message name="CarHireSearchHttpPostOut">
    <wsdl:part name="Body" />
  </wsdl:message>
  <wsdl:portType name="carhire_V2_2Soap">
    <wsdl:operation name="GetCarhireSuppliers">
      <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Car Hire Suppliers</wsdl:documentation>
      <wsdl:input message="tns:GetCarhireSuppliersSoapIn" />
      <wsdl:output message="tns:GetCarhireSuppliersSoapOut" />
    </wsdl:operation>
    <wsdl:operation name="GetCarhireSuppliersByCollectionPoint">
      <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Car Hire Suppliers By Collection Point</wsdl:documentation>
      <wsdl:input message="tns:GetCarhireSuppliersByCollectionPointSoapIn" />
      <wsdl:output message="tns:GetCarhireSuppliersByCollectionPointSoapOut" />
    </wsdl:operation>
    <wsdl:operation name="GetCarhireLevels">
      <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Car Hire Levels</wsdl:documentation>
      <wsdl:input message="tns:GetCarhireLevelsSoapIn" />
      <wsdl:output message="tns:GetCarhireLevelsSoapOut" />
    </wsdl:operation>
    <wsdl:operation name="GetAllCarhireLevels">
      <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">All Car Hire Levels</wsdl:documentation>
      <wsdl:input message="tns:GetAllCarhireLevelsSoapIn" />
      <wsdl:output message="tns:GetAllCarhireLevelsSoapOut" />
    </wsdl:operation>
    <wsdl:operation name="GetVehicleTypes">
      <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Vehicle Types</wsdl:documentation>
      <wsdl:input message="tns:GetVehicleTypesSoapIn" />
      <wsdl:output message="tns:GetVehicleTypesSoapOut" />
    </wsdl:operation>
    <wsdl:operation name="CarHireSearch">
      <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Search for Car Hire Availability</wsdl:documentation>
      <wsdl:input message="tns:CarHireSearchSoapIn" />
      <wsdl:output message="tns:CarHireSearchSoapOut" />
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:portType name="carhire_V2_2HttpPost">
    <wsdl:operation name="GetCarhireSuppliers">
      <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Car Hire Suppliers</wsdl:documentation>
      <wsdl:input message="tns:GetCarhireSuppliersHttpPostIn" />
      <wsdl:output message="tns:GetCarhireSuppliersHttpPostOut" />
    </wsdl:operation>
    <wsdl:operation name="GetCarhireSuppliersByCollectionPoint">
      <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Car Hire Suppliers By Collection Point</wsdl:documentation>
      <wsdl:input message="tns:GetCarhireSuppliersByCollectionPointHttpPostIn" />
      <wsdl:output message="tns:GetCarhireSuppliersByCollectionPointHttpPostOut" />
    </wsdl:operation>
    <wsdl:operation name="GetCarhireLevels">
      <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Car Hire Levels</wsdl:documentation>
      <wsdl:input message="tns:GetCarhireLevelsHttpPostIn" />
      <wsdl:output message="tns:GetCarhireLevelsHttpPostOut" />
    </wsdl:operation>
    <wsdl:operation name="GetAllCarhireLevels">
      <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">All Car Hire Levels</wsdl:documentation>
      <wsdl:input message="tns:GetAllCarhireLevelsHttpPostIn" />
      <wsdl:output message="tns:GetAllCarhireLevelsHttpPostOut" />
    </wsdl:operation>
    <wsdl:operation name="GetVehicleTypes">
      <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Vehicle Types</wsdl:documentation>
      <wsdl:input message="tns:GetVehicleTypesHttpPostIn" />
      <wsdl:output message="tns:GetVehicleTypesHttpPostOut" />
    </wsdl:operation>
    <wsdl:operation name="CarHireSearch">
      <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Search for Car Hire Availability</wsdl:documentation>
      <wsdl:input message="tns:CarHireSearchHttpPostIn" />
      <wsdl:output message="tns:CarHireSearchHttpPostOut" />
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:binding name="carhire_V2_2Soap" type="tns:carhire_V2_2Soap">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
    <wsdl:operation name="GetCarhireSuppliers">
      <soap:operation soapAction="http://ws-affiliate.afnt.co.uk/GetCarhireSuppliers" style="document" />
      <wsdl:input>
        <soap:body use="literal" />
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal" />
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="GetCarhireSuppliersByCollectionPoint">
      <soap:operation soapAction="http://ws-affiliate.afnt.co.uk/GetCarhireSuppliersCollectionPoint" style="document" />
      <wsdl:input>
        <soap:body use="literal" />
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal" />
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="GetCarhireLevels">
      <soap:operation soapAction="http://ws-affiliate.afnt.co.uk/GetCarhireLevels" style="document" />
      <wsdl:input>
        <soap:body use="literal" />
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal" />
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="GetAllCarhireLevels">
      <soap:operation soapAction="http://ws-affiliate.afnt.co.uk/GetAllCarhireLevels" style="document" />
      <wsdl:input>
        <soap:body use="literal" />
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal" />
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="GetVehicleTypes">
      <soap:operation soapAction="http://ws-affiliate.afnt.co.uk/GetVehicleTypes" style="document" />
      <wsdl:input>
        <soap:body use="literal" />
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal" />
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="CarHireSearch">
      <soap:operation soapAction="http://ws-affiliate.afnt.co.uk/CarHireSearch" style="document" />
      <wsdl:input>
        <soap:body use="literal" />
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal" />
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:binding name="carhire_V2_2Soap12" type="tns:carhire_V2_2Soap">
    <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" />
    <wsdl:operation name="GetCarhireSuppliers">
      <soap12:operation soapAction="http://ws-affiliate.afnt.co.uk/GetCarhireSuppliers" style="document" />
      <wsdl:input>
        <soap12:body use="literal" />
      </wsdl:input>
      <wsdl:output>
        <soap12:body use="literal" />
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="GetCarhireSuppliersByCollectionPoint">
      <soap12:operation soapAction="http://ws-affiliate.afnt.co.uk/GetCarhireSuppliersCollectionPoint" style="document" />
      <wsdl:input>
        <soap12:body use="literal" />
      </wsdl:input>
      <wsdl:output>
        <soap12:body use="literal" />
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="GetCarhireLevels">
      <soap12:operation soapAction="http://ws-affiliate.afnt.co.uk/GetCarhireLevels" style="document" />
      <wsdl:input>
        <soap12:body use="literal" />
      </wsdl:input>
      <wsdl:output>
        <soap12:body use="literal" />
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="GetAllCarhireLevels">
      <soap12:operation soapAction="http://ws-affiliate.afnt.co.uk/GetAllCarhireLevels" style="document" />
      <wsdl:input>
        <soap12:body use="literal" />
      </wsdl:input>
      <wsdl:output>
        <soap12:body use="literal" />
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="GetVehicleTypes">
      <soap12:operation soapAction="http://ws-affiliate.afnt.co.uk/GetVehicleTypes" style="document" />
      <wsdl:input>
        <soap12:body use="literal" />
      </wsdl:input>
      <wsdl:output>
        <soap12:body use="literal" />
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="CarHireSearch">
      <soap12:operation soapAction="http://ws-affiliate.afnt.co.uk/CarHireSearch" style="document" />
      <wsdl:input>
        <soap12:body use="literal" />
      </wsdl:input>
      <wsdl:output>
        <soap12:body use="literal" />
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:binding name="carhire_V2_2HttpPost" type="tns:carhire_V2_2HttpPost">
    <http:binding verb="POST" />
    <wsdl:operation name="GetCarhireSuppliers">
      <http:operation location="/GetCarhireSuppliers" />
      <wsdl:input>
        <mime:content type="application/x-www-form-urlencoded" />
      </wsdl:input>
      <wsdl:output>
        <mime:content part="Body" type="text/xml" />
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="GetCarhireSuppliersByCollectionPoint">
      <http:operation location="/GetCarhireSuppliersByCollectionPoint" />
      <wsdl:input>
        <mime:content type="application/x-www-form-urlencoded" />
      </wsdl:input>
      <wsdl:output>
        <mime:content part="Body" type="text/xml" />
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="GetCarhireLevels">
      <http:operation location="/GetCarhireLevels" />
      <wsdl:input>
        <mime:content type="application/x-www-form-urlencoded" />
      </wsdl:input>
      <wsdl:output>
        <mime:content part="Body" type="text/xml" />
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="GetAllCarhireLevels">
      <http:operation location="/GetAllCarhireLevels" />
      <wsdl:input>
        <mime:content type="application/x-www-form-urlencoded" />
      </wsdl:input>
      <wsdl:output>
        <mime:content part="Body" type="text/xml" />
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="GetVehicleTypes">
      <http:operation location="/GetVehicleTypes" />
      <wsdl:input>
        <mime:content type="application/x-www-form-urlencoded" />
      </wsdl:input>
      <wsdl:output>
        <mime:content part="Body" type="text/xml" />
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="CarHireSearch">
      <http:operation location="/CarHireSearch" />
      <wsdl:input>
        <mime:content type="application/x-www-form-urlencoded" />
      </wsdl:input>
      <wsdl:output>
        <mime:content part="Body" type="text/xml" />
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="carhire_V2_2">
    <wsdl:port name="carhire_V2_2Soap" binding="tns:carhire_V2_2Soap">
      <soap:address location="http://ws-affiliate.afnt.co.uk/carhire/v2_2/carhire.asmx" />
    </wsdl:port>
    <wsdl:port name="carhire_V2_2Soap12" binding="tns:carhire_V2_2Soap12">
      <soap12:address location="http://ws-affiliate.afnt.co.uk/carhire/v2_2/carhire.asmx" />
    </wsdl:port>
    <wsdl:port name="carhire_V2_2HttpPost" binding="tns:carhire_V2_2HttpPost">
      <http:address location="http://ws-affiliate.afnt.co.uk/carhire/v2_2/carhire.asmx" />
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>

                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
191:
192:
193:
194:
195:
196:
197:
198:
199:
200:
201:
202:
203:
204:
205:
206:
207:
208:
209:
210:
211:
212:
213:
214:
215:
216:
217:
218:
219:
220:
221:
222:
223:
224:
225:
226:
227:
228:
229:
230:
231:
232:
233:
234:
235:
236:
237:
238:
239:
240:
241:
242:
243:
244:
245:
246:
247:
248:
249:
250:
251:
252:
253:
254:
255:
256:
257:
258:
259:
260:
261:
262:
263:
264:
265:
266:
267:
268:
269:
270:
271:
272:
273:
274:
275:
276:
277:
278:
279:
280:
281:
282:
283:
284:
285:
286:
287:
288:
289:
290:
291:
292:
293:
294:
295:
296:
297:
298:
299:
300:
301:
302:
303:
304:
305:
306:
307:
308:
309:
310:
311:
312:
313:
314:
315:
316:
317:
318:
319:
320:
321:
322:
323:
324:
325:
326:
327:
328:
329:
330:
331:
332:
333:
334:
335:
336:
337:
338:
339:
340:
341:
342:
343:
344:
345:
346:
347:
348:
349:
350:
351:
352:
353:
354:
355:
356:
357:
358:
359:
360:
361:
362:
363:
364:
365:
366:
367:
368:
369:
370:
371:
372:
373:
374:
375:
376:
377:
378:
379:
380:
381:
382:
383:
384:
385:
386:
387:
388:
389:
390:
391:
392:
393:
394:
395:
396:
397:
398:
399:
400:
401:
402:
403:
404:
405:
406:
407:
408:
409:
410:
411:
412:
413:
414:
415:
416:
417:
418:
419:
420:
421:
422:
423:
424:
425:
426:
427:
428:
429:
430:
431:
432:
433:
434:
435:
436:
437:
438:
439:
440:
441:
442:
443:
444:
445:
446:
447:
448:
449:
450:
451:
452:
453:
454:
455:
456:
457:
458:
459:
460:
461:
462:
463:
464:
465:
466:
467:
468:
469:
470:
471:
472:
473:
474:
475:
476:
477:
478:
479:
480:
481:
482:
483:
484:
485:
486:
487:
488:
489:
490:
491:
492:
493:
494:
495:
496:
497:
498:
499:
500:
501:
502:
503:
504:
505:
506:
507:

Select allOpen in new window

 

by: carl_tawnPosted on 2009-08-21 at 01:29:31ID: 25149907

Ok, that helped. I created  a proxy class from your wsdl, but I don't see the GetAllCarhireLevelsRequest class that you are using.

For me, based on the service proxt class being called "carhire_V2_2" in my case, the call you are attempting would be something like:


    carhire_V2_2 proxy = new carhire_V2_2();
    XmlNode node = proxy.GetAllCarhireLevels("username", "password");


Which returns you an XML node.

 

by: QuinnDesterPosted on 2009-08-21 at 02:57:05ID: 25150248

Fantasic... i was tring to use a web service reference, that is supposed to take care of creating the proxy and would only give me the methods as choices through the intellisense.

changing the reference to a web reference allowed me to create the proxy as you have done above and returns the results as expected.
though i do have to use the carhire2.carhire_V2_2. to get it to recognise the class
using carhire2; declaration will not work for this

Thank you very much for your help, this has had my head in a twist since last monday

 

by: QuinnDesterPosted on 2009-08-21 at 03:13:02ID: 25150308

Is there a way of getting the information back into a stream, or can i pass the XmlNode to xslt as is

 

by: carl_tawnPosted on 2009-08-21 at 03:39:07ID: 25150401

It depends on what you are trying to do I guess. You could just create a new XmlDocument with a dummy root element and append the node to it and then apply a transform to the resulting document.

 

by: QuinnDesterPosted on 2009-08-21 at 03:59:59ID: 25150492

Just tried that it errors and gives this message

{"The node to be inserted is from a different document context."}

is there anything i can do about that.

here is the code

        carhire2.carhire_V2_2 proxy = new carhire2.carhire_V2_2();
        
        XmlNode node = proxy.GetAllCarhireLevels(user, password);
 
        XmlDocument doc = new XmlDocument();// Create the XML Declaration, and append it to XML document
        XmlDeclaration dec = doc.CreateXmlDeclaration("1.0", null, null);
        doc.AppendChild(dec);// Create the root element
        XmlElement root = doc.CreateElement("rootelement");
        doc.AppendChild(root);
        doc.AppendChild(node);
        string xmlOutput = doc.OuterXml;

                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:

Select allOpen in new window

 

by: QuinnDesterPosted on 2009-08-21 at 04:08:25ID: 25150540

Got it  :)

        carhire2.carhire_V2_2 proxy = new carhire2.carhire_V2_2();
        XmlDocument XmlDocumentObject = new XmlDocument();
        XmlNode node = proxy.GetAllCarhireLevels(user, password);
        XmlDocumentObject.LoadXml(node.OuterXml);

does the trick

Thanks again for all your help

 

by: carl_tawnPosted on 2009-08-21 at 04:23:05ID: 25150635

Try this instead:

doc.AppendChild(doc.ImportNode(node, true));

Although I think you actually want to be appending "node" to "root" rather than directlt to "doc"

 

by: QuinnDesterPosted on 2009-08-21 at 04:52:10ID: 25150798

I need to do 2 this with it according to what info i request.

i will need to pass it through xslt to transform it and dispaly the info on the web page.
or i will need to convert it into a data set to use in dropdownlists

the code i have shown above converts it into a xmldoc this will aloow me to pass it to xslt to process.

i have just been looking at creating a data source from the node.

which i think i have just cracked, i have the data now dispalying in a gridview

took a long time to dispaly though so will probably need to find a way of caching the dataset

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...