Sending xml request to a webservice

Peter Nordberg
Peter Nordberg used Ask the Experts™
on
Hi,

I have to do an integration from a business system to a webservice. I'm supposed to send a code in xml to the webservice at this address:

http://dev.memnonnetworks.com/ws/services/ConsignmentWS?wsdl

Then I'm supposed to get a response.

The xml I have already created like this:
        Dim path As String = "c:\memnon.xml"
        Dim writer As New XmlTextWriter(Server.MapPath("memnon.xml"), Encoding.GetEncoding(28591))
        ' start writing!
        writer.Formatting = Formatting.Indented
        'ResponseEncoding = "iso-8859-1"
        writer.WriteStartDocument()


        writer.WriteStartElement("ConsignmentList")


        For Each item As GridDataItem In RadGrid1.Items
            If item.Selected Then
                Dim id As HiddenField = DirectCast(item.FindControl("id"), HiddenField)

                Dim c As New orderDBL
                c.GetPacsoftByID(id.Value)

                Dim cTotal As New orderDBL
                cTotal.GetOrderTotal(id.Value)

                ' ---- Authentication
                writer.WriteStartElement("AuthenticationToken")
                ' ---Username
                writer.WriteStartElement("userName")
                writer.WriteString("user")
                writer.WriteEndElement() ' userName
                ' -- groupname
                writer.WriteStartElement("groupName")
                writer.WriteString("groupname")
                writer.WriteEndElement() ' end groupname
                '-- password
                writer.WriteStartElement("password")
                writer.WriteString("password")
                writer.WriteEndElement() ' end password

                writer.WriteEndElement() ' end Authentication


                '--- Consignment
                writer.WriteStartElement("Consignment")
                writer.WriteAttributeString("orderNo", c.orderID)
                writer.WriteAttributeString("templateName", "Package")

                ' --- Part
                writer.WriteStartElement("Part")
                writer.WriteAttributeString("role", "consignee")

                ' ---Address
                writer.WriteStartElement("Address")

                ' id
                writer.WriteStartElement("id")
                writer.WriteString(c.customerID)
                writer.WriteEndElement() ' end id

                ' Name
                writer.WriteStartElement("name")
                writer.WriteString(c.FirstName & " " & c.LastName)
                writer.WriteEndElement() ' --- end name

                ' adress
                writer.WriteStartElement("address")
                writer.WriteString(c.Address)
                writer.WriteEndElement() ' -- end address

                ' postcode
                writer.WriteStartElement("postcode")
                writer.WriteString(c.Zip)
                writer.WriteEndElement() ' end postcode

                ' city
                writer.WriteStartElement("city")
                writer.WriteString(c.City)
                writer.WriteEndElement() ' end city

                ' countrycode
                writer.WriteStartElement("countrycode")
                writer.WriteString(c.countryCode)
                writer.WriteEndElement() ' end countrycode

                writer.WriteEndElement() ' --- End Address

                ' -- Communication
                writer.WriteStartElement("Communication")

                ' contactperson
                'writer.WriteStartElement("contactPerson")
                'writer.WriteString("Kalle Persson")
                'writer.WriteEndElement() ' end contactperson

                ' mobile
                writer.WriteStartElement("mobile")
                writer.WriteAttributeString("notify", StrConv(c.alertID, VbStrConv.Lowercase))
                writer.WriteString(c.mobile)
                writer.WriteEndElement() ' end mobile

                writer.WriteEndElement() ' -- End communication

                writer.WriteEndElement() ' --- End part

                ' --- GoodsItem
                writer.WriteStartElement("GoodsItem")

                ' NoOfPackage
                writer.WriteStartElement("noOfPackages")
                writer.WriteString("1")
                writer.WriteEndElement() ' End noOfPackages

                ' weight
                writer.WriteStartElement("weight")
                'writer.WriteString("1")
                writer.WriteEndElement() ' end weight
                writer.WriteEndElement() ' --- End GoodsItem

                ' --- TransportProduct
                writer.WriteStartElement("TransportProduct")
                writer.WriteStartElement("PaymentInstruction")
                writer.WriteAttributeString("value", "P")
                writer.WriteEndElement() ' End paymentInstr
                writer.WriteEndElement() ' --- End Transportproduct

                writer.WriteEndElement() ' --- End consignement

            End If
        Next

        writer.WriteEndElement() ' consignmentList
        writer.WriteEndDocument()      
        writer.Close()

Open in new window


But I'm not sure how to send this request and then handle the response.

The manual is here!
http://www.spedpoint.com/static/specifications/ConsignmentWS(eng).pdf

If someone could just show me how to handle the request and response from the service I would be very grateful.

Peter
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
If you are doing coding in .net then just add the web service in the web reference.
then you need to create object of this and you will find all the methods of that web service.

Let me know if you required code for this.

Give me web service address and the xml request that you have created.

hope this will help you.
you are supposed to have a method in webservice which either accepts string(xml string) or xmldocument as parameter.

Here is how to call the webservice dynamically.
http://msdn.microsoft.com/en-us/library/1k1skd40.aspx

You can also use Add web reference in visual studio and add service URL
Peter NordbergIT Manager

Author

Commented:
Hi,

Some code would be appreciated. The webservice address is like this:
http://dev.memnonnetworks.com/ws/services/ConsignmentWS?wsdl

The only xml I've created is the one above. In the example they have this xml to make an request but I'm not sure how to use it.
:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://www.spedpoint.com/consignment/types" xmlns:v1="http://www.spedpoint.com/consignment/types/v1_0">
<soapenv:Header/>
<soapenv:Body>
<typ:book>
<AuthenticationToken>
<userName>user</userName>
<groupName>group</groupName>
<password>password</password>
</AuthenticationToken>
<Consignment orderNo="myorderno" automaticBooking="Y" templateName="testtemplate">
<!--1 or more repetitions:-->
<Part role="consignor" account="accountno">
<Address>
<v1:id>consignorID</v1:id>
<v1:name>consignor name</v1:name>
<!--1 or more repetitions:-->
<v1:address>Testgatan 1</v1:address>
<v1:postcode>11339</v1:postcode>
<v1:city>Stockholm</v1:city>
<v1:countrycode>SE</v1:countrycode>
</Address>
</Part>
<Part role="consignee">
<Address>
<v1:id>consigneeID</v1:id>
<v1:name>consignee name</v1:name>
<!--1 or more repetitions:-->
<v1:address>Testgatan 1</v1:address>
<v1:postcode>11339</v1:postcode>
<v1:city>Stockholm</v1:city>
<v1:countrycode>SE</v1:countrycode>
</Address>
</Part>
<!--1 or more repetitions:-->
<GoodsItem>
<v1:noOfPackages>1</v1:noOfPackages>
<v1:weight>1</v1:weight>
</GoodsItem>
<TransportProduct>
<PaymentInstruction value="P"/>
</TransportProduct>
</Consignment>
<transactionId>transactionid</transactionId>
</typ:book>
</soapenv:Body>
</soapenv:Envelope>

Open in new window


Peter
Learn SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

Rose BabuSenior Team Manager
Commented:
Hi,

from your description, i guess the book web method is you are calling. The request xml structure for the book web method will be as like below.

Book Request XML

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://www.spedpoint.com/consignment/types" xmlns:v1="http://www.spedpoint.com/consignment/types/v1_0">
   <soapenv:Header/>
   <soapenv:Body>
      <typ:book>
         <AuthenticationToken>
            <userName>?</userName>
            <groupName>?</groupName>
            <password>?</password>
         </AuthenticationToken>
         <Consignment orderNo="?" orderType="?" automaticBooking="?" consignmentId="?" consignmentNo="?" templateName="?">
            <!--1 or more repetitions:-->
            <Part role="?" account="?">
               <Address>
                  <v1:id>?</v1:id>
                  <v1:name>?</v1:name>
                  <!--1 or more repetitions:-->
                  <v1:address>?</v1:address>
                  <v1:postcode>?</v1:postcode>
                  <v1:city>?</v1:city>
                  <!--Optional:-->
                  <v1:state>?</v1:state>
                  <v1:countrycode>?</v1:countrycode>
                  <!--Optional:-->
                  <v1:posX>?</v1:posX>
                  <!--Optional:-->
                  <v1:posY>?</v1:posY>
                  <!--Optional:-->
                  <v1:posSystem>?</v1:posSystem>
               </Address>
               <!--Optional:-->
               <Communication>
                  <!--Optional:-->
                  <v1:contactPerson>?</v1:contactPerson>
                  <!--Optional:-->
                  <v1:phone>?</v1:phone>
                  <!--Optional:-->
                  <mobile notify="?">?</mobile>
                  <!--Optional:-->
                  <v1:fax>?</v1:fax>
                  <!--Optional:-->
                  <email notify="?">?</email>
               </Communication>
               <!--Optional:-->
               <Reference>
                  <!--Optional:-->
                  <v1:customerNo>?</v1:customerNo>
                  <!--Optional:-->
                  <v1:reference>?</v1:reference>
                  <!--Optional:-->
                  <v1:accountNo>?</v1:accountNo>
                  <!--Optional:-->
                  <v1:eanCustomerNo>?</v1:eanCustomerNo>
                  <!--Optional:-->
                  <v1:palletRegNo>?</v1:palletRegNo>
                  <!--Optional:-->
                  <v1:vatNo>?</v1:vatNo>
               </Reference>
            </Part>
            <!--1 or more repetitions:-->
            <GoodsItem>
               <v1:noOfPackages>?</v1:noOfPackages>
               <v1:weight>?</v1:weight>
               <!--Optional:-->
               <v1:volume>?</v1:volume>
               <!--Optional:-->
               <v1:length>?</v1:length>
               <!--Optional:-->
               <v1:width>?</v1:width>
               <!--Optional:-->
               <v1:height>?</v1:height>
               <!--Optional:-->
               <v1:loadingMetres>?</v1:loadingMetres>
               <!--Optional:-->
               <v1:palletSpace>?</v1:palletSpace>
               <!--Optional:-->
               <v1:packageType>?</v1:packageType>
               <!--Optional:-->
               <v1:tag>?</v1:tag>
               <!--Optional:-->
               <v1:goodsType>?</v1:goodsType>
               <!--Optional:-->
               <v1:netWeight>?</v1:netWeight>
               <!--Optional:-->
               <v1:weightUnit>?</v1:weightUnit>
               <!--Optional:-->
               <v1:volumeUnit>?</v1:volumeUnit>
               <!--Optional:-->
               <v1:lengthUnit>?</v1:lengthUnit>
               <!--Optional:-->
               <v1:stackable>?</v1:stackable>
               <!--Optional:-->
               <PackageIds>
                  <!--1 or more repetitions:-->
                  <v1:code>?</v1:code>
               </PackageIds>
               <!--Optional:-->
               <DangerousGoods>
                  <!--Optional:-->
                  <v1:unNo>?</v1:unNo>
                  <!--Optional:-->
                  <v1:adrClass>?</v1:adrClass>
                  <!--Optional:-->
                  <v1:packGroup>?</v1:packGroup>
                  <!--Optional:-->
                  <v1:weight>?</v1:weight>
                  <!--Optional:-->
                  <v1:netWeight>?</v1:netWeight>
                  <!--Optional:-->
                  <v1:netWeightExplSub>?</v1:netWeightExplSub>
                  <!--Optional:-->
                  <v1:noOfPackages>?</v1:noOfPackages>
                  <!--Optional:-->
                  <v1:packageType>?</v1:packageType>
                  <!--Optional:-->
                  <v1:mp>?</v1:mp>
                  <!--Optional:-->
                  <v1:flamePoint>?</v1:flamePoint>
                  <!--Optional:-->
                  <v1:lq>?</v1:lq>
                  <!--Optional:-->
                  <Category value="?"/>
                  <!--Optional:-->
                  <v1:ems>?</v1:ems>
                  <!--Optional:-->
                  <v1:sp>?</v1:sp>
                  <!--Zero or more repetitions:-->
                  <v1:description>?</v1:description>
               </DangerousGoods>
            </GoodsItem>
            <TransportProduct>
               <!--Optional:-->
               <v1:mode>?</v1:mode>
               <!--Optional:-->
               <v1:code>?</v1:code>
               <PaymentInstruction value="P"/>
               <!--Zero or more repetitions:-->
               <AddService name="?" value=""/>
               <!--Optional:-->
               <v1:advice>?</v1:advice>
               <!--Optional:-->
               <Tod>
                  <v1:combiterm>?</v1:combiterm>
                  <v1:location>?</v1:location>
                  <!--Optional:-->
                  <v1:countrycode>?</v1:countrycode>
                  <!--Optional:-->
                  <v1:notes>?</v1:notes>
               </Tod>
               <!--Optional:-->
               <Cod>
                  <v1:amount>?</v1:amount>
                  <v1:currency>?</v1:currency>
                  <v1:paymentMethod>?</v1:paymentMethod>
                  <!--Optional:-->
                  <v1:accountNo>?</v1:accountNo>
                  <!--Optional:-->
                  <v1:reference>?</v1:reference>
               </Cod>
               <!--Optional:-->
               <Pickup>
                  <!--Optional:-->
                  <v1:date>?</v1:date>
                  <!--Optional:-->
                  <v1:earliest>?</v1:earliest>
                  <!--Optional:-->
                  <v1:latest>?</v1:latest>
                  <!--Zero or more repetitions:-->
                  <v1:instruction>?</v1:instruction>
               </Pickup>
               <!--Optional:-->
               <Delivery>
                  <!--Optional:-->
                  <v1:date>?</v1:date>
                  <!--Optional:-->
                  <v1:earliest>?</v1:earliest>
                  <!--Optional:-->
                  <v1:latest>?</v1:latest>
                  <!--Zero or more repetitions:-->
                  <v1:instruction>?</v1:instruction>
               </Delivery>
               <!--Optional:-->
               <Transport>
                  <!--Zero or more repetitions:-->
                  <v1:instruction>?</v1:instruction>
                  <!--You have a CHOICE of the next 3 items at this level-->
                  <v1:cooling>?</v1:cooling>
                  <v1:heating>?</v1:heating>
                  <v1:frozen>?</v1:frozen>
                  <!--Optional:-->
                  <v1:tempLow>?</v1:tempLow>
                  <!--Optional:-->
                  <v1:tempHigh>?</v1:tempHigh>
                  <!--Optional:-->
                  <v1:subsidyNo>?</v1:subsidyNo>
                  <!--Optional:-->
                  <v1:valuableGoods>?</v1:valuableGoods>
                  <!--Optional:-->
                  <v1:carryIn>?</v1:carryIn>
                  <!--Optional:-->
                  <v1:extraCrew>?</v1:extraCrew>
                  <!--Optional:-->
                  <v1:eurPallets>?</v1:eurPallets>
               </Transport>
               <!--Zero or more repetitions:-->
               <CustomsClearance>
                  <!--Optional:-->
                  <v1:customsDeclarationNo>?</v1:customsDeclarationNo>
                  <!--Optional:-->
                  <v1:customsDescription>?</v1:customsDescription>
                  <!--Optional:-->
                  <v1:customsReference>?</v1:customsReference>
                  <!--Optional:-->
                  <v1:countryOfOrigin>?</v1:countryOfOrigin>
                  <!--Optional:-->
                  <v1:invoiceNo>?</v1:invoiceNo>
                  <!--Optional:-->
                  <v1:invoiceDate>?</v1:invoiceDate>
                  <!--Optional:-->
                  <v1:goodsValue>?</v1:goodsValue>
                  <!--Optional:-->
                  <v1:goodsValueCurrency>?</v1:goodsValueCurrency>
                  <!--Optional:-->
                  <v1:statisticalNo>?</v1:statisticalNo>
               </CustomsClearance>
               <!--Optional:-->
               <Sortcode>
                  <v1:code>?</v1:code>
                  <v1:quantity>?</v1:quantity>
               </Sortcode>
               <!--Optional:-->
               <Insurance>
                  <v1:amount>?</v1:amount>
                  <v1:currency>?</v1:currency>
               </Insurance>
               <!--Zero or more repetitions:-->
               <ServiceOption value="?" type="?">
                  <!--Zero or more repetitions:-->
                  <ServiceOptionItem type="?" value="?"/>
               </ServiceOption>
            </TransportProduct>
            <!--Optional:-->
            <Target>
               <v1:date>?</v1:date>
               <!--Optional:-->
               <v1:earliest>?</v1:earliest>
               <!--Optional:-->
               <v1:latest>?</v1:latest>
            </Target>
            <!--Optional:-->
            <Contents>
               <!--1 or more repetitions:-->
               <ContentItem>
                  <!--Optional:-->
                  <v1:noOfOrderedItems>?</v1:noOfOrderedItems>
                  <!--Optional:-->
                  <v1:noOfDeliveredItems>?</v1:noOfDeliveredItems>
                  <!--Optional:-->
                  <v1:articleNo>?</v1:articleNo>
                  <!--Optional:-->
                  <v1:productName>?</v1:productName>
                  <!--Zero or more repetitions:-->
                  <v1:productAttribute>?</v1:productAttribute>
                  <!--Optional:-->
                  <v1:weight>?</v1:weight>
                  <!--Optional:-->
                  <v1:volume>?</v1:volume>
                  <!--Optional:-->
                  <v1:length>?</v1:length>
                  <!--Optional:-->
                  <v1:width>?</v1:width>
                  <!--Optional:-->
                  <v1:height>?</v1:height>
                  <!--Optional:-->
                  <v1:price>?</v1:price>
                  <!--Optional:-->
                  <v1:packageType>?</v1:packageType>
                  <!--Optional:-->
                  <v1:location>?</v1:location>
                  <!--Optional:-->
                  <v1:notes>?</v1:notes>
                  <!--Optional:-->
                  <v1:itemId>?</v1:itemId>
               </ContentItem>
            </Contents>
            <!--Zero or more repetitions:-->
            <GoodsGroup name="?">
               <!--Zero or more repetitions:-->
               <GoodsGroupItem>
                  <!--Zero or more repetitions:-->
                  <ContentItem>
                     <!--Optional:-->
                     <v1:noOfOrderedItems>?</v1:noOfOrderedItems>
                     <!--Optional:-->
                     <v1:noOfDeliveredItems>?</v1:noOfDeliveredItems>
                     <!--Optional:-->
                     <v1:articleNo>?</v1:articleNo>
                     <!--Optional:-->
                     <v1:productName>?</v1:productName>
                     <!--Zero or more repetitions:-->
                     <v1:productAttribute>?</v1:productAttribute>
                     <!--Optional:-->
                     <v1:weight>?</v1:weight>
                     <!--Optional:-->
                     <v1:volume>?</v1:volume>
                     <!--Optional:-->
                     <v1:length>?</v1:length>
                     <!--Optional:-->
                     <v1:width>?</v1:width>
                     <!--Optional:-->
                     <v1:height>?</v1:height>
                     <!--Optional:-->
                     <v1:price>?</v1:price>
                     <!--Optional:-->
                     <v1:packageType>?</v1:packageType>
                     <!--Optional:-->
                     <v1:location>?</v1:location>
                     <!--Optional:-->
                     <v1:notes>?</v1:notes>
                     <!--Optional:-->
                     <v1:itemId>?</v1:itemId>
                  </ContentItem>
                  <!--Zero or more repetitions:-->
                  <GoodsItem>
                     <v1:noOfPackages>?</v1:noOfPackages>
                     <v1:weight>?</v1:weight>
                     <!--Optional:-->
                     <v1:volume>?</v1:volume>
                     <!--Optional:-->
                     <v1:length>?</v1:length>
                     <!--Optional:-->
                     <v1:width>?</v1:width>
                     <!--Optional:-->
                     <v1:height>?</v1:height>
                     <!--Optional:-->
                     <v1:loadingMetres>?</v1:loadingMetres>
                     <!--Optional:-->
                     <v1:palletSpace>?</v1:palletSpace>
                     <!--Optional:-->
                     <v1:packageType>?</v1:packageType>
                     <!--Optional:-->
                     <v1:tag>?</v1:tag>
                     <!--Optional:-->
                     <v1:goodsType>?</v1:goodsType>
                     <!--Optional:-->
                     <v1:netWeight>?</v1:netWeight>
                     <!--Optional:-->
                     <v1:weightUnit>?</v1:weightUnit>
                     <!--Optional:-->
                     <v1:volumeUnit>?</v1:volumeUnit>
                     <!--Optional:-->
                     <v1:lengthUnit>?</v1:lengthUnit>
                     <!--Optional:-->
                     <v1:stackable>?</v1:stackable>
                     <!--Optional:-->
                     <PackageIds>
                        <!--1 or more repetitions:-->
                        <v1:code>?</v1:code>
                     </PackageIds>
                     <!--Optional:-->
                     <DangerousGoods>
                        <!--Optional:-->
                        <v1:unNo>?</v1:unNo>
                        <!--Optional:-->
                        <v1:adrClass>?</v1:adrClass>
                        <!--Optional:-->
                        <v1:packGroup>?</v1:packGroup>
                        <!--Optional:-->
                        <v1:weight>?</v1:weight>
                        <!--Optional:-->
                        <v1:netWeight>?</v1:netWeight>
                        <!--Optional:-->
                        <v1:netWeightExplSub>?</v1:netWeightExplSub>
                        <!--Optional:-->
                        <v1:noOfPackages>?</v1:noOfPackages>
                        <!--Optional:-->
                        <v1:packageType>?</v1:packageType>
                        <!--Optional:-->
                        <v1:mp>?</v1:mp>
                        <!--Optional:-->
                        <v1:flamePoint>?</v1:flamePoint>
                        <!--Optional:-->
                        <v1:lq>?</v1:lq>
                        <!--Optional:-->
                        <Category value="?"/>
                        <!--Optional:-->
                        <v1:ems>?</v1:ems>
                        <!--Optional:-->
                        <v1:sp>?</v1:sp>
                        <!--Zero or more repetitions:-->
                        <v1:description>?</v1:description>
                     </DangerousGoods>
                  </GoodsItem>
               </GoodsGroupItem>
            </GoodsGroup>
            <!--Zero or more repetitions:-->
            <ConsignmentReference type="?">
               <v1:value>?</v1:value>
            </ConsignmentReference>
            <!--Zero or more repetitions:-->
            <Note type="?">
               <v1:value>?</v1:value>
            </Note>
            <!--Optional:-->
            <GoodsInvoice>
               <!--Optional:-->
               <v1:invoiceNo>?</v1:invoiceNo>
               <!--Optional:-->
               <v1:invoiceDate>?</v1:invoiceDate>
               <!--Optional:-->
               <v1:orderNo>?</v1:orderNo>
               <!--Optional:-->
               <v1:termsOfPayment>?</v1:termsOfPayment>
               <!--Optional:-->
               <v1:discount>?</v1:discount>
               <!--Optional:-->
               <v1:freightCost>?</v1:freightCost>
               <!--Optional:-->
               <v1:currency>?</v1:currency>
               <!--Zero or more repetitions:-->
               <InvoiceNote type="?">
                  <v1:value>?</v1:value>
               </InvoiceNote>
            </GoodsInvoice>
         </Consignment>
         <transactionId>?</transactionId>
      </typ:book>
   </soapenv:Body>
</soapenv:Envelope>

Open in new window

To consume this web service in .NET, do the following in your project/website...

1. Add http://dev.memnonnetworks.com/ws/services/ConsignmentWS?wsdl as a web reference (i added the reference named as EE_ConsignmentWS)
2. Imports EE_ConsignmentWS
3. Create a web service client
4. Then create a request object and response object to call Book web method

	    Dim wsClient As New ConsignmentWS
		
		
        Dim bookReq As New book
        Dim bookResp As New bookResponse

        ' Create Authentication Tocken Object
        Dim AuthTocken As New AuthenticationToken
        AuthTocken.groupName = ""
        AuthTocken.password = ""
        AuthTocken.userName = ""

        ' Assign Authentication Tocken object
        bookReq.AuthenticationToken = AuthTocken

        ' Create Consignment request object
        Dim consReq As New Consignment
        consReq.automaticBooking = ""
        consReq.orderNo = ""
        consReq.orderType = ""
        consReq.automaticBooking = ""
        consReq.consignmentId = ""
        consReq.consignmentNo = ""
        consReq.templateName = ""
        ' ... consReq object has some more values needed to be assign if needed

        ' Assign Consignment request object
        bookReq.Consignment = consReq

        ' Assign Transaction ID
        bookReq.transactionId = ""


        ' Call Book web method
        bookResp = wsClient.book(bookReq)

        Dim consResult As New ConsignmentResult
        consResult = bookResp.result

        Dim consignmentObj() As Consignment = consResult.consignments

        Dim docsObj() As Document = consResult.documents

        Dim errObj() As [Error] = consResult.errors

        Dim receiptObj As Receipt = consResult.receipt

        Dim StatusCode As Integer = consResult.statusCode

Open in new window

This is how the book webmethod can be consumed. And you have to updated the request object with the necessary correct input to get the response.

Hope this will help you a lot to process.
Hi,

There are two method.

1) first one : you need to add web reference (guidance provided in image 1.jpg and 2.jpg)
which will create copy of WSDL and XSD in your project and then you just need to enter name space in your .cs file
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using com.memnonnetworks.dev;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        com.memnonnetworks.dev.Address obj = new com.memnonnetworks.dev.Address();
        //obj.

         com.memnonnetworks.dev.isBooked objisBooked =  new  com.memnonnetworks.dev.isBooked();
         AuthenticationToken objAuthenticationToken = new AuthenticationToken();
        string consignmentId;
        consignmentId = objisBooked.consignmentId;
        objAuthenticationToken = objisBooked.AuthenticationToken;
       

       
//you can use appropriate method what ever you want to do.


    }
}

2) Other one you simple pass the XML to the web service by creating proxy class.
but I think first one will help you a lot.

Hope this solution will guide you some more to achieve your goal
1.JPG
2.JPG

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial