473,806 Members | 2,661 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.InvalidO perationExcepti on: Request format is
unrecognized.

Stack Trace:

[InvalidOperatio nException: Request format is unrecognized.]
System.Web.Serv ices.Protocols. WebServiceHandl erFactory.CoreG etHandler(Type
type, HttpContext context, HttpRequest request, HttpResponse response)
+388
System.Web.Serv ices.Protocols. WebServiceHandl erFactory.GetHa ndler(HttpConte xt
context, String verb, String url, String filePath) +94
System.Web.Http Application.Map HttpHandler(Htt pContext context,
String requestType, String path, String pathTranslated, Boolean
useAppConfig) +699
System.Web.MapH andlerExecution Step.System.Web .HttpApplicatio n+IExecutionSte p.Execute()
+95
System.Web.Http Application.Exe cuteStep(IExecu tionStep step, Boolean&
completedSynchr onously) +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
(SoapExtensionA ttribute inherited) attribute. I tried with the
<soapExtensionT ypes> 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 7377
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*******@roym organ.com> wrote in message
news:7e******** *************** ***@posting.goo gle.com...
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.InvalidO perationExcepti on: Request format is
unrecognized.

Stack Trace:

[InvalidOperatio nException: Request format is unrecognized.]
System.Web.Serv ices.Protocols. WebServiceHandl erFactory.CoreG etHandler(Type type, HttpContext context, HttpRequest request, HttpResponse response)
+388
System.Web.Serv ices.Protocols. WebServiceHandl erFactory.GetHa ndler(HttpConte x
t context, String verb, String url, String filePath) +94
System.Web.Http Application.Map HttpHandler(Htt pContext context,
String requestType, String path, String pathTranslated, Boolean
useAppConfig) +699
System.Web.MapH andlerExecution Step.System.Web .HttpApplicatio n+IExecutionSte p
..Execute() +95
System.Web.Http Application.Exe cuteStep(IExecu tionStep step, Boolean&
completedSynchr onously) +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
(SoapExtensionA ttribute inherited) attribute. I tried with the
<soapExtensionT ypes> 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.Con tentType 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 SoapMessageStag e.AfterSerializ e:
// need to set the position at the begginning of the stream
to be able to process the stream data
newStream.Posit ion = 0;
GenerateNewStre amData(newStrea m, oldStream);
break;

case SoapMessageStag e.BeforeDeseria lize:
GenerateNewStre amData(oldStrea m, newStream);
// have to reset the position to 0, so the stream could be
processed by other extensions or the WS Framework
newStream.Posit ion = 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.m icrosoft.com (Elena Kharitidi) wrote in message news:<C#******* *******@cpmsftn gxa10.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.Con tentType 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 SoapMessageStag e.AfterSerializ e:
// need to set the position at the begginning of the stream
to be able to process the stream data
newStream.Posit ion = 0;
GenerateNewStre amData(newStrea m, oldStream);
break;

case SoapMessageStag e.BeforeDeseria lize:
GenerateNewStre amData(oldStrea m, newStream);
// have to reset the position to 0, so the stream could be
processed by other extensions or the WS Framework
newStream.Posit ion = 0;
break;
--

Nov 21 '05 #4

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

Similar topics

1
5729
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 null'. When the extension attribute is not applied it runs fine. The wierd thing is that it does not appear to be an error within the SOAP extension because I break-pointed it and when the proxy function gets called the SOAP extension runs fine....
4
6033
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 extension. The code like this: public string HelloWorld() { return "Hello World.";
0
2940
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 but I'm not sure. Below is a water-downed version of the code that I'm working on. While debugging, I noticed that if I pass an invalid SOAP request, the schema validation catches it and throws the error appropriately. However, when I pass in a...
4
6520
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 I often want to use the SOAP extension from my web.config file and I have no idea how to configure it. The SOAP extension's GetInitializer method only receives the type of the webservice, but that isn't very useful for me. Adding the attribute...
0
1154
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 to ask some question : 1. am i must installing WSE 1.0 on my server to resolve my problem?? 2. do you have simple soap extension (c#) for example, perhaps with step by step building soap extension.. i need your help..
0
2138
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) dosen't get serialized. The 'version' member witch is decimal is being serialized and sent to the server. I am doing something wrong ?
1
1907
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 in the AfterSerialize section and the destination accepts my request and sends back the appropriate data, but my problem comes when I try to return the data. Depending on what I do I either get an exception that "the root element is missing" or...
2
4041
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 my webservice and my application. In my extension I override the Chainstream method and implement the abstract methods (GetInitializer, Initialize and ProcessMessage) my chainstream method:
1
4839
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 strKey="null";
0
9719
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10369
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10372
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10110
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9187
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7650
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6877
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5546
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4329
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.