Redirection from web service is not working????

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • masanand
    New Member
    • Jul 2008
    • 1

    Redirection from web service is not working????

    Hi

    I have a web page which is calling a web method through which
    i am tring to do redirection to other url. But i am getting error says

    if i use server.transer. ...

    Client found response content type of 'text/html; charset=utf-8', but expected 'text/xml'

    otherwise

    {"The request failed with the error message:\r\n--\r\n<?xml version=\"1.0\" encoding=\"utf-8\"?><soap:Enve lope xmlns:soap=\"ht tp://schemas.xmlsoap .org/soap/envelope/\" xmlns:xsi=\"htt p://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"htt p://www.w3.org/2001/XMLSchema\"><so ap:Body><PostUR IResponse xmlns=\"http://tempuri.org/\" /></soap:Body></soap:Envelope>\ r\n--."}

    The way i created my web method is..

    Context.Respons e.StatusCode = 307;
    Context.Respons e.AddHeader("Lo cation", "redirect url");

    Please help me solve this..
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    web service methods are not supposed to redirect.
    Create a special return value for the web method, so that when a calling page sees it, it knows to transfer to another page.

    Comment

    Working...