Webservice not returning the soap header in client response.

Discussion in 'ASP .Net Web Services' started by imonline, Dec 1, 2006.

  1. imonline

    imonline Guest

    Hi,
    I have created a webservice which has soap headers in both
    client request and response.

    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Header>
    <HTNGHeader xmlns="http://htng.org/1.1/Header/">
    <From>
    <systemId />
    <Credential>
    <userName />
    <password />
    </Credential>
    </From>
    <To>
    <systemId />
    </To>
    <timestamp>date</timestamp>
    <echoToken />
    <transactionId />
    <action />
    </HTNGHeader>
    </soap:Header>
    <soap:Body>
    <OTA_HotelGetMsgRQ EchoToken="" TimeStamp="dateTime" Target=""
    Version="decimal" TransactionIdentifier=""
    SequenceNmbr="nonNegativeInteger" TransactionStatusCode=""
    PrimaryLangID="language" AltLangID="language"
    RetransmissionIndicator="boolean"
    xmlns="http://www.opentravel.org/OTA/2003/05">
    <UniqueID URL="anyURI" Type="" Instance="" ID="" ID_Context="">
    <CompanyName CompanyShortName="" TravelSector="" Code=""
    CodeContext="" />
    </UniqueID>
    <Messages>
    <Message ChainCode="" BrandCode="" HotelCode=""
    HotelCityCode="" HotelName="" HotelCodeContext="" ChainName=""
    BrandName="" AreaID="" Start="" Duration="" End=""
    StartSeqNmbr="nonNegativeInteger" EndSeqNmbr="nonNegativeInteger"
    MessageType="" ResponseValue="" RequestCode="string"
    ReasonForRequest="string" UserName="string" RatePlanCode="string"
    ConfirmationID="string" ReservationID="string">
    <OriginalPayloadStdAttributes EchoToken=""
    TimeStamp="dateTime" Target="" Version="decimal"
    TransactionIdentifier="" SequenceNmbr="nonNegativeInteger"
    TransactionStatusCode="" PrimaryLangID="language" AltLangID="language"
    RetransmissionIndicator="boolean" />
    <MessageContent>string</MessageContent>
    </Message>
    <Message ChainCode="" BrandCode="" HotelCode=""
    HotelCityCode="" HotelName="" HotelCodeContext="" ChainName=""
    BrandName="" AreaID="" Start="" Duration="" End=""
    StartSeqNmbr="nonNegativeInteger" EndSeqNmbr="nonNegativeInteger"
    MessageType="" ResponseValue="" RequestCode="string"
    ReasonForRequest="string" UserName="string" RatePlanCode="string"
    ConfirmationID="string" ReservationID="string">
    <OriginalPayloadStdAttributes EchoToken=""
    TimeStamp="dateTime" Target="" Version="decimal"
    TransactionIdentifier="" SequenceNmbr="nonNegativeInteger"
    TransactionStatusCode="" PrimaryLangID="language" AltLangID="language"
    RetransmissionIndicator="boolean" />
    <MessageContent>string</MessageContent>
    </Message>
    </Messages>
    </OTA_HotelGetMsgRQ>
    </soap:Body>
    </soap:Envelope>
    HTTP/1.1 200 OK
    Content-Type: text/xml; charset=utf-8
    Content-Length: length

    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Header>
    <HTNGHeader xmlns="http://htng.org/1.1/Header/">
    <From>
    <systemId />
    <Credential>
    <userName />
    <password />
    </Credential>
    </From>
    <To>
    <systemId />
    </To>
    <timestamp>date</timestamp>
    <echoToken />
    <transactionId />
    <action />
    </HTNGHeader>
    </soap:Header>
    <soap:Body>
    <OTA_HotelGetMsgRS EchoToken="" TimeStamp="dateTime" Target=""
    Version="decimal" TransactionIdentifier=""
    SequenceNmbr="nonNegativeInteger" TransactionStatusCode=""
    PrimaryLangID="language" AltLangID="language"
    RetransmissionIndicator="boolean"
    xmlns="http://www.opentravel.org/OTA/2003/05">
    <Errors>
    <Error Type="" ShortText="" Code="" DocURL="anyURI" Status=""
    Tag="string" RecordID="" NodeList="string" />
    <Error Type="" ShortText="" Code="" DocURL="anyURI" Status=""
    Tag="string" RecordID="" NodeList="string" />
    </Errors>
    </OTA_HotelGetMsgRS>
    </soap:Body>
    </soap:Envelope>
    Its request and response are as above I
    have created it from XSDs using wscf 0.7. I am able to receive the
    header but the response that I send does not contain the soap header.


    My vb.net coding is as under:
    <System.Web.Services.Protocols.SoapHeader("HTNGHeader",
    Direction:=SoapHeaderDirection.InOut Or SoapHeaderDirection.Fault), _
    System.Web.Services.WebMethodAttribute(), _

    System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://www.opentravel.org/OTA/2003/05:eek:TA_HotelGetMsgIn",
    Use:=System.Web.Services.Description.SoapBindingUse.Literal,
    ParameterStyle:=System.Web.Services.Protocols.SoapParameterStyle.Bare,
    Binding:="HotelReservation")> _
    Public Overridable Function
    OTA_HotelGetMsg(<System.Xml.Serialization.XmlElementAttribute([Namespace]:="http://www.opentravel.org/OTA/2003/05",
    ElementName:="OTA_HotelGetMsgRQ")> ByVal oTA_HotelGetMsgRQ As
    OTA_HotelGetMsgRQ) As
    <System.Xml.Serialization.XmlElementAttribute("OTA_HotelGetMsgRS",
    [Namespace]:="http://www.opentravel.org/OTA/2003/05")>
    OTA_HotelGetMsgRS Implements IHotelReservation.OTA_HotelGetMsg
    End function


    Please let me know what am i doing wrong.


    Thanks,
    Nis
     
    imonline, Dec 1, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. comp.text.xml
    Replies:
    0
    Views:
    543
    comp.text.xml
    Sep 20, 2006
  2. Ivan S
    Replies:
    0
    Views:
    557
    Ivan S
    Aug 13, 2008
  3. Steve Kuhn
    Replies:
    2
    Views:
    378
    majiofpersia
    Jul 29, 2003
  4. Andrew Robinson

    Encoded WebService SOAP Header?

    Andrew Robinson, May 25, 2005, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    293
    [MSFT]
    May 26, 2005
  5. Peter van der veen

    How to add SOAP header to a SOAP message?

    Peter van der veen, Nov 8, 2006, in forum: ASP .Net Web Services
    Replies:
    6
    Views:
    641
    J. Dudgeon
    Nov 14, 2006
Loading...

Share This Page