473,396 Members | 1,914 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

SOAP Extension Problem

I was trying, for the first time, to create a (fairly simple) SOAP
extension for some of my web services. They were to be called from the
WindowsForms host application.
Following error message occured:

Client found response content type of '', but expected 'text/xml'.

Calling this web service from the browser (as recommended) produced
little more explanation:

Exception Details: System.InvalidOperationException: Request format is
unrecognized.

Stack Trace:

[InvalidOperationException: Request format is unrecognized.]
System.Web.Services.Protocols.WebServiceHandlerFac tory.CoreGetHandler(Type
type, HttpContext context, HttpRequest request, HttpResponse response)
+388
System.Web.Services.Protocols.WebServiceHandlerFac tory.GetHandler(HttpContext
context, String verb, String url, String filePath) +94
System.Web.HttpApplication.MapHttpHandler(HttpCont ext context,
String requestType, String path, String pathTranslated, Boolean
useAppConfig) +699
System.Web.MapHandlerExecutionStep.System.Web.Http Application+IExecutionStep.Execute()
+95
System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean&
completedSynchronously) +173

This explanation left me unclear if this was the case of malformed XML
or (somehow) missing content type?

Initial implementation was connected to the service by using
(SoapExtensionAttribute inherited) attribute. I tried with the
<soapExtensionTypes> entry in the web.config, with no result at all.

Next step for me was to go back and try an official MS example (from
the Developer Studio help files) - simple request/response service
log. It resulted with exactly the same set of error messages.

Following that I commented out all the code in the overriden
ProcessMessage - voiding all extension functionality - same thing
again. It seems that this problem has nothing to do with the web
service code itself or with the SoapExtension inherited class code. Am
I missing some additional configuration parameters?

This kind (and very similar kind) of problems were raised several
times on this forum by now, but nobody gave any reasonable answer yet
to it.

Everything works under Windows XP (tested on two different machines),
IIS 5.1.

At this stage, I am starting to run out of ideas. Any comment is
appreciated.
Regards,

Dejan Petrovic
Nov 21 '05 #1
3 7350
I have seen this a couple of times and never fully got to the bottom of it.
When using config settings are you sure you set them correctly? If nothing
is return from your service then the config settings are most likely not set
correctly.

"Dejan" <pe*******@roymorgan.com> wrote in message
news:7e**************************@posting.google.c om...
I was trying, for the first time, to create a (fairly simple) SOAP
extension for some of my web services. They were to be called from the
WindowsForms host application.
Following error message occured:

Client found response content type of '', but expected 'text/xml'.

Calling this web service from the browser (as recommended) produced
little more explanation:

Exception Details: System.InvalidOperationException: Request format is
unrecognized.

Stack Trace:

[InvalidOperationException: Request format is unrecognized.]
System.Web.Services.Protocols.WebServiceHandlerFac tory.CoreGetHandler(Type type, HttpContext context, HttpRequest request, HttpResponse response)
+388
System.Web.Services.Protocols.WebServiceHandlerFac tory.GetHandler(HttpContex
t context, String verb, String url, String filePath) +94
System.Web.HttpApplication.MapHttpHandler(HttpCont ext context,
String requestType, String path, String pathTranslated, Boolean
useAppConfig) +699
System.Web.MapHandlerExecutionStep.System.Web.Http Application+IExecutionStep
..Execute() +95
System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean&
completedSynchronously) +173

This explanation left me unclear if this was the case of malformed XML
or (somehow) missing content type?

Initial implementation was connected to the service by using
(SoapExtensionAttribute inherited) attribute. I tried with the
<soapExtensionTypes> entry in the web.config, with no result at all.

Next step for me was to go back and try an official MS example (from
the Developer Studio help files) - simple request/response service
log. It resulted with exactly the same set of error messages.

Following that I commented out all the code in the overriden
ProcessMessage - voiding all extension functionality - same thing
again. It seems that this problem has nothing to do with the web
service code itself or with the SoapExtension inherited class code. Am
I missing some additional configuration parameters?

This kind (and very similar kind) of problems were raised several
times on this forum by now, but nobody gave any reasonable answer yet
to it.

Everything works under Windows XP (tested on two different machines),
IIS 5.1.

At this stage, I am starting to run out of ideas. Any comment is
appreciated.
Regards,

Dejan Petrovic

Nov 21 '05 #2
Web Services Framework requires valid ContentType to be able to process a
SOAP message. In your case the ContentType is empty.
This could happens if
1. the SoapExtension explicitly sets the SoapMessage.ContentType to null
(or empty string)
2. the SoapExtension modifies the message stream in a way that it looks
empty, the most common case is that after the stream manipulation its
position is not re-set to the beginning of the stream:

case SoapMessageStage.AfterSerialize:
// need to set the position at the begginning of the stream
to be able to process the stream data
newStream.Position = 0;
GenerateNewStreamData(newStream, oldStream);
break;

case SoapMessageStage.BeforeDeserialize:
GenerateNewStreamData(oldStream, newStream);
// have to reset the position to 0, so the stream could be
processed by other extensions or the WS Framework
newStream.Position = 0;
break;
Nov 21 '05 #3
You were right, problem was in the stream re-wind. This was a simple
case of doing it in the wrong place, in the AfterSerialize stage.
Thank you very much for your help.
el****@online.microsoft.com (Elena Kharitidi) wrote in message news:<C#**************@cpmsftngxa10.phx.gbl>...
Web Services Framework requires valid ContentType to be able to process a
SOAP message. In your case the ContentType is empty.
This could happens if
1. the SoapExtension explicitly sets the SoapMessage.ContentType to null
(or empty string)
2. the SoapExtension modifies the message stream in a way that it looks
empty, the most common case is that after the stream manipulation its
position is not re-set to the beginning of the stream:

case SoapMessageStage.AfterSerialize:
// need to set the position at the begginning of the stream
to be able to process the stream data
newStream.Position = 0;
GenerateNewStreamData(newStream, oldStream);
break;

case SoapMessageStage.BeforeDeserialize:
GenerateNewStreamData(oldStream, newStream);
// have to reset the position to 0, so the stream could be
processed by other extensions or the WS Framework
newStream.Position = 0;
break;
--

Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: David C. allen | last post by:
I have created a simple Client-side SOAP Extension for a webclass that I have. When I apply the extension attribute to the the calling function in the proxy class I get an error 'Value cannot be...
4
by: pepcag | last post by:
I used http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconalteringsoapmessageusingsoapextensions.asp as a template to create a very simple web method with soap...
0
by: Amar | last post by:
I am recieving the "The root element is missing" error from my soap extension while attempting to validate an incoming SOAP message request. I suspect the problem resides in the ChainStream method...
4
by: Ramon de Klein | last post by:
I have created a SOAP extension that can be enabled using a SoapExtensionAttribute. This attibute holds two additional properties that are used to configure the SOAP extension. This works fine, but...
0
by: zac# | last post by:
i interesting to try using soap extension, and i using sample on msdn. but when i debug my soap extension, i have error message... i invoke soap extension using client desktop application, i want...
0
by: dex | last post by:
Hi, I'm trying use a webservice with PHP5 soap extension in WSDL mode. I generated the php classes using wsdl2php. The problem is that 'auth' member of loginRequest (witch is a complex type)...
1
by: khoy | last post by:
Hello. I am writing a web service and I need to use a Soap Extension to add a custom header that is expected at the destination. I can use the Soap Extension successfully for adding the header...
2
by: Frederik Vanderhaegen | last post by:
Hi, I'm writing a simple soap extension for a webservice I developed (without the use of an extension the webservice works perfect). The extension is registered through the web.config files of...
1
by: klerik123456 | last post by:
I try set soap extension attributes on client side. For example: Implementation in web service: public class EncryptMessageAttribute : SoapExtensionAttribute { private string...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.