5

Recently I got the need to access a web service created using SOAP::Lite. It's really messy to use since there's no WSDL, it doesn't return reasonable datatypes etc. so I started out using the provided sample code.

Right from the start I got problems, requests were timing out. Sometimes often, sometimes more seldom but never entirely without problem. After using Fiddler to sniff the traffic and searching it seems like there is/was a bug with SOAP::Lite that messed up the header Content-Length when dealing with UTF-8 encoded data. This seems reasonable since my analysis points to the timeouts being caused by the client waiting for more data (Content-Length) while the server said it was done (real data).

So now I need a way to counter this erroneous header field and either:

  1. Provide the correct Content-Length or
  2. Pad the payload to match the Content-Length

Problem is, I never get the chance to use a SoapExtension or any other modification since Invoke() eventually throws an IoException or WebException before parsing commences. Also, the WS is not mine and pretty unchangable, I presume.

I also tried overriding the SoapHttpClientProtocol.GetWebResponse() to do an async request but that didn't help either since I couldn't get hold of the ResponseStream before calling HttpWebRequest.EndGetResponse() and that one always threw an exception.

Does anyone have an idea how I could approach this?

UPDATE: by now I've also tried WCF and came across this post at MSDN - the answer is not very uplifting. Basically, this happens far too deep in the plumbing to be accesible by user code. My best bet now seems to be to use a Fiddler script to correct the Content-Length header, perhaps not trivial since this WS is only available by HTTPS.

/Dan

Community
  • 1
  • 1
method
  • 81
  • 6
  • 1
    Any chance they could fix their bug? Having the wrong `Content-Length` is not trivial. That's a serious bug. – John Saunders Feb 05 '11 at 13:15
  • 1
    I'm afraid not - the application (Numara FootPrints) is hosted by another parr of the company (I can't access Numara support) and Numara themselves seem quite uninterested in this interface. Their running SOAP::Lite 0.60 which is from 2003... – method Feb 13 '11 at 15:02

0 Answers0