I’ve been working on building a .NET Client Application to consume a Java based Web Service hosted in an Equinox-based Server Application. I followed the standard procedure in Visual Studio to consume a Web Service
- Add Web Reference
- Instantiate Proxy Class in my client code
- Added the additional User Credential code as the Web Service requires user authentication
- Ran the App and was confronted with an HTTP Error 501 that the method i was calling is not supported
Error Analysis
The detailed error message was Method+%3C%3FXML+is+not+defined+in+RFC+2068+ and+is+not+supported+by+the+Servlet+API+.
Using dynaTrace to instrument both my client application and the server gave me a PurePath that showed exceptions on both the server and the client side that were thrown for the single Web Service Request.
Exploring the Exception Details revealed that the problem actually happened during the resubmit of the Web Request caused by a server side authentication request (HTTP 401).
It turned out that the .NET SOAP Stack Implementation sent the HTTP Body along with the first request although the response from the server was a HTTP 401. The .NET SOAP Stack again responded with Header (now containing the authentication information) and Body (containing the XML for the Web Service call). The server side SOAP Stack implementation however was considering the HTTP Body of the first request as the response to its HTTP 401 request. Parsing this data caused the HTTP 501 error saying that <?xml … is not a supported Servlet API.
So in this particular case – the server was not expecting an HTTP Body before the authenticate was not completed. As .NET sent the HTTP body anyway it caused the server to raise an error when parsing the data.
Solution
The solution for this particular problem was to force the .NET SOAP Stack to automatically send the authentication information with the first request as its not possible to prevent sending the HTTP Body for a non authenticated HTTP Request.
I first thought that using PreAuthentication will do the trick – but it didnt. So I found a great workaround by Norman Rasmussen that solved the interoperability problem. Additionally I saved one roundtrip to the server.
Conclusion
We should think that SOAP has been around for a long time and that interoperability issues are problems from the past. With the insight I got into the client and server-side code it was easy to find the root cause of the problem and – with the help of others – I was able to solve it.
Related posts:
- Interoperability is more than just talking with each other Microsoft and Sun recently announced their Open Source Project Stonehenge...
- User based service level enforcement for Web Applications Monitoring response times for web applications is one way to...
- Proof of Concept: dynaTrace provides Cloud Service Monitoring and Root Cause Analysis for GigaSpaces In this blog – Challenges of Monitoring, Tracing and Profiling...
- Performance Analysis: How to identify synchronization issues under load? Synchronization is a necessary mechanism to control access to shared...


One would definitely expect these to be problems of the past. However note that SOAP is not to be blamed here – it’s an HTTP issue – can also happen with REST or any regular web request.
You are right. I should not blame SOAP in general for this issue – neither should it be HTTP.
It is the SOAP/HTTP Stack Implementation that are still not a 100% interopable. As a “user” of such frameworks I expected to connect to any remote web service without having any major issues.
Thanks for your comment
When i check with my PC its send TCP traffic to IP called 10.0.5.12 in remote port 40002.
When i check it with sniffer software it will give below type of containt of sending packet. What will be a reason for this and how can i stop this? . I try to use several firewalls to stop this but its not worked.
HTTP/1.1 501 Method+%01%00%00%00E%00%00%00%7B%05%00%00%7B%00B%00B%001%00E%00F%000%00F%00C%00%2D%006%00E%001%009%00%2D%004%00A%00E%004%00%2D%00B%002%00C%00A%00%2D%008%004%00D%007%007%006%00E%009%003%002%003%00F%00%7D%00%00%008%000%002%000%00C%00%00%000%005%001%007%000%007%00%00%00W%00I%00F%00I%00%5F%00K%00I%00O%00S%00K%00%00%00W%00I%00F%00I%00%5F%00K%00I%00O%00S%00K%00%00%002%00%2E%000%00%2E%008%002%00%2E%000%00%00%00%01%00%00M%00I%00C%00R%00O%00S%00O%00F%00T%00+is+not+defined+in+RFC+2068+and+is+not+supported+by+the+Servlet+API+
Date: Mon, 27 Oct 2008 08:07:33 GMT
Content-Type: text/html
Content-Length: 3309
Connection: close
Error 501 Method+%01%00%00%00E%00%00%00%7B%05%00%00%7B%00B%00B%001%00E%00F%000%00F%00C%00%2D%006%00E%001%009%00%2D%004%00A%00E%004%00%2D%00B%002%00C%00A%00%2D%008%004%00D%007%007%006%00E%009%003%002%003%00F%00%7D%00%00%008%000%002%000%00C%00%00%000%005%001%007%000%007%00%00%00W%00I%00F%00I%00%5F%00K%00I%00O%00S%00K%00%00%00W%00I%00F%00I%00%5F%00K%00I%00O%00S%00K%00%00%002%00%2E%000%00%2E%008%002%00%2E%000%00%00%00%01%00%00M%00I%00C%00R%00O%00S%00O%00F%00T%00+is+not+defined+in+RFC+2068+and+is+not+supported+by+the+Servlet+API+
HTTP ERROR: 501 Method+%01%00%00%00E%00%00%00%7B%05%00%00%7B%00B%00B%001%00E%00F%000%00F%00C%00%2D%006%00E%001%009%00%2D%004%00A%00E%004%00%2D%00B%002%00C%00A%00%2D%008%004%00D%007%007%006%00E%009%003%002%003%00F%00%7D%00%00%008%000%002%000%00C%00%00%000%005%001%007%000%007%00%00%00W%00I%00F%00I%00%5F%00K%00I%00O%00S%00K%00%00%00W%00I%00F%00I%00%5F%00K%00I%00O%00S%00K%00%00%002%00%2E%000%00%2E%008%002%00%2E%000%00%00%00%01%00%00M%00I%00C%00R%00O%00S%00O%00F%00T%00+is+not+defined+in+RFC+2068+and+is+not+supported+by+the+Servlet+API+
RequestURI=.W.i.n.d.o.w.s. .X.P. .E.m.b.e.d.d.e.d. …S.e.r.v.i.c.e. .P.a.c.k. .2…4.7.9…4.8.7…1.1…8.0.1…A.d.o.b.e. .F.l.a.s.h. .P.l.a.y.e.r. .A.c.t.i.v.e.X.;.A.d.o.b.e. .F.l.a.s.h. .P.l.a.y.e.r. .P.l.u.g.i.n.;.F.o.x.i.t. .R.e.a.d.e.r.;.M.i.c.r.o.s.o.f.t. .B.a.s.e. .S.m.a.r.t. .C.a.r.d. .C.r.y.p.t.o.g.r.a.p.h.i.c. .S.e.r.v.i.c.e. .P.r.o.v.i.d.e.r. .P.a.c.k.a.g.e.;.U.p.d.a.t.e. .f.o.r. .W.i.n.d.o.w.s. .X.P. .(.K.B.9.2.5.8.7.6.).;.V.N.C. .F.r.e.e. .E.d.i.t.i.o.n. .4…1…2.;.V.I.A. .R.h.i.n.e.-.F.a.m.i.l.y. .F.a.s.t.-.E.t.h.e.r.n.e.t. .A.d.a.p.t.e.r.;.Y.a.h.o.o.!. .M.e.s.s.e.n.g.e.r.;.G.e.m.P.C.T.w.i.n.;.G.o.o.g.l.e. .T.a.l.k. .(.r.e.m.o.v.e. .o.n.l.y.).;.J.a.v.a.(.T.M.). .S.E. .R.u.n.t.i.m.e. .E.n.v.i.r.o.n.m.e.n.t. .6. .U.p.d.a.t.e. .1.;.W.e.b.F.l.d.r.s. .X.P.;.M.i.c.r.o.s.o.f.t. .O.f.f.i.c.e. .E.x.c.e.l. .V.i.e.w.e.r. .2.0.0.3.;.M.i.c.r.o.s.o.f.t. .O.f.f.i.c.e. .W.o.r.d. .V.i.e.w.e.r. .2.0.0.3.;.M.i.c.r.o.s.o.f.t. .O.f.f.i.c.e. .P.o.w.e.r.P.o.i.n.t. .V.i.e.w.e.r. .2.0.0.3.;.O.p.e.r.a. .9…2.6.;.M.S.N. .M.e.s.s.e.n.g.e.r. .7…5.;.R.a.l.i.n.k. .W.i.r.e.l.e.s.s. .L.A.N.
Powered by Jetty://