Problem trying to consume a web service behind a web service proxy

I am hitting a rather critical bug regarding consuming a web service on a mobile device that is sitting behind a web service proxy (Jaxview).

My device is able to see the wsdl of the service (on IE) and it is able to send a request to the service, but on the response I get the error below. The response is processed just fine if I bypass the proxy but that is not an option in my environment. I also have been capturing the tcp traffic to confirm that the proxy is indeed sending back valid xml responses to my request and it is. I am really at a loss as to why I am getting this error.

Regards,

Darren

"The response did not contain an end of entity mark."

at System.Net.HttpWebRequest.finishGetResponse()
at System.Net.HttpWebRequest.GetResponse()
at System.Web.Services.Protocols.WebClientProtocol.GetWebResponse()
at System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse()
at System.Web.Services.Protocols.SoapHttpClientProtocol.doInvoke()
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke()
at MobileQuote.UserNameWrap.searchForCustomers()
at MobileQuote.frmCustomerLookUp.LookUpCustomerInformation()
at MobileQuote.frmCustomerLookUp.frmCustomerLookUp_Load()
at System.Windows.Forms.Form.OnLoad()
at System.Windows.Forms.Form._SetVisibleNotify()
at System.Windows.Forms.Control.set_Visible()
at System.Windows.Forms.Form.ShowDialog()
at MobileQuote.frmQuote.CustomerLookUp()
at MobileQuote.frmQuote.pictLookUp_Click()
at System.Windows.Forms.Control.OnClick()
at System.Windows.Forms.Control.WnProc()
at System.Windows.Forms.Control._InternalWnProc()
at Microsoft.AGL.Forms.EVL.EnterMainLoop()
at System.Windows.Forms.Application.Run()
at MobileQuote.Program.Main()



Answer this question

Problem trying to consume a web service behind a web service proxy

  • Abel Khumalo

    I put the code in place and everything compiles just fine, but now the request just times out when trying to invoke the web service method.  I will need to wait until Monday to see if the requests are being processed by the servers or not.

  • Alex Bates

    There appears to be an error at our proxy now that I am forcing a conversion to http 1.0. We are working with the company to see if it is an error with the proxy coding or not.

  • JGiers

    The issue has now been fixed on our proxy allowing for a proper request and response from the compact framework client. Thank you very much for your help.

  • Al33327

    It still continues to function properly with out the proxy. I am unable to get access to the soap requests right now but I will be able to look over the logs on Monday.

  • akin_l

    Put it into WS proxy code. To do so:

    1. Double click on your WS reference in solution explorer, which would open Object browser with your WS selected.

    2. Expand your WS branch to see proxy class.

    3. Double click on it to open code.

    4. Add code above to the proxy class (inherits from System.Web.Services.Protocols.SoapHttpClientProtocol).

    You might have to do it again if you regenerate proxy.



  • RHolt

    I believe I saw similar problem with chunking before but do not recall what it was exactly. I would suggest setting HTTP version to 1.0 which would prevent server from using chunking and proxy from mangling the response.

    Something like this should do:

    protected override System.Net.WebRequest GetWebRequest(Uri uri)

    {

    System.Net.WebRequest request = base.GetWebRequest(uri) as System.Net.HttpWebRequest;

    if (request is System.Net.HttpWebRequest)

    {

    ((System.Net.HttpWebRequest)request).ProtocolVersion = System.Net.HttpVersion.Version10;

    }

    return request;

    }



  • Fatming

    There are a few differences, but I find it odd that after testing it on a java client, and a .net client only the compact framework client has issues.

    with proxy:

    HTTP/1.1 200 OKDate: Fri, 13 Oct 2006 18:05:51 GMTServer: Apache/2.0.52 (Red Hat)Content-Type: text/xml;charset=utf-8
    < xml version="1.0" encoding="UTF-8" >
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Body>
    <client:CustomerSearchServiceProcessResponse xmlns:aeaaanstmp0="http://webservices.fastenal.com/bpel/fastdotcom/CustomerSearchService" xmlns:client="http://webservices.fastenal.com/bpel/fastdotcom/CustomerSearchService">
    <client:Customers>
    <client:CustomerNumber>XXXXXXXXX</client:CustomerNumber>
    <client:CustomerName>XXXXXXXXX</client:CustomerName>
    <client:CustomerStatus>XXXXXXXXX</client:CustomerStatus>
    </client:Customers>
    </client:CustomerSearchServiceProcessResponse>
    </soapenv:Body>
    </soapenv:Envelope>

    With out proxy:

    HTTP/1.1 100 Continue
    HTTP/1.1 200 OKDate: Fri, 13 Oct 2006 18:09:00 GMTServer: Apache/2.0.52 (Red Hat)
    Connection: closeTransfer-Encoding: chunkedContent-Type: text/xml;charset=utf-8
    162f
    < xml version="1.0" encoding="UTF-8" >
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Body>
    <client:CustomerSearchServiceProcessResponse xmlns:aeaaanstmp0="http://webservices.fastenal.com/bpel/fastdotcom/CustomerSearchService" xmlns:client="http://webservices.fastenal.com/bpel/fastdotcom/CustomerSearchService">
    <client:Customers>
    <client:CustomerNumber>XXXXXXXXX</client:CustomerNumber>
    <client:CustomerName>XXXXXXXXX</client:CustomerName>
    <client:CustomerStatus>XXXXXXXXX</client:CustomerStatus>
    </client:Customers>
    </client:CustomerSearchServiceProcessResponse>
    </soapenv:Body>
    </soapenv:Envelope>0

  • bhv

    Thank you for your reponse but I am unsure exactly where to impliment the code snippet you provided.

  • Zohaib Khan

    So what's the difference in responses with and without proxy



  • bonni

    Does it work without proxy Have response changed



  • Problem trying to consume a web service behind a web service proxy