473,324 Members | 2,501 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,324 software developers and data experts.

Configuration error in web.config while accessing SOAP webservice

Hi all,

I am creating a webservice to accept SOAP messages, parse the
message and send a SOAP response back to the client accessing my web service
using WSE-2 in ASP.NET.
I am creating a class which derives from "SoapReceiver" class and
do the processing here. To register this class by using the HTTP protocol, I
am editing the "web.config" file. I am adding an "add" element to this config
file as follows:
<httpHandlers>
<add verb="*" path="MyReceiver.ashx"
type="CodeService.HttpService"/>
</httpHandlers>

Here "HttpService" is the class I have created in "CodeService" namespace.
Also I am adding a "configSections" element to the "configuration" section of
the "web.config" file to add microsoft.web.services2 configuration section.

When I try accessing this webservice from a browser say like
"http://localhost/CodeService/CodeWebService.asmx", I get an error

Parser Error Message: Could not load type CodeService.HttpService from
assembly System.Web, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a.

Could anyone please let me know where I am going wrong?

Thanks,
kaush
Nov 23 '05 #1
4 6083
The type field needs the assembly name as well as the namespace and
class name

Try

<add verb="*" path="MyReceiver.ashx" type="CodeService.HttpService,
myassemblyname"/> (change myassemblyname to whatever your assemblies
name is)

Peter Kelcey

Nov 23 '05 #2
Hey Peter,

Thanks for the information. But still not working. I
changed the "add" element section as follows:

<add verb="*" path="*.ashx"
type="SOAPSERVEMON.HttpService,Microsoft.Web.Servi ces2, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

Not sure where I am going wrong.
Some more information on my "HttpService" class. I have defined it in
"SOAPSERVEMON" namespace. The class derives from the WSE's "SoapService"
class which is found in "Microsoft.Web.Services2.Messaging".

Any clue where I am going wrong.

kaushik


"Peter Kelcey" wrote:
The type field needs the assembly name as well as the namespace and
class name

Try

<add verb="*" path="MyReceiver.ashx" type="CodeService.HttpService,
myassemblyname"/> (change myassemblyname to whatever your assemblies
name is)

Peter Kelcey

Nov 23 '05 #3
Kaush

You need to specify your assembly, not the Microsoft assembly

Example

I create a new class called HttpService, derive it from the
Microsoft.Web.Services2.Messaging.SoapReceiver class.
My new class is in namespace SOAPSERVEMON.
The project that I've got this class in is configured to create an
assembly called asynctest.dll (You can check your assembly name by
right clicking on the project, selecting properties and looking at the
"general" section under the "common properties" folder.

Now, in order to use this class, I would add the following section to
my web.config

<httpHandlers>
<add verb="*" path="mytest.ashx" type="SOAPSERVEMON.HTTPService,
asynctest"/>
</httpHandlers>

As you can see, you need to specific the assembly that contains your
new class, not the existing Microsoft assembly that holds the Services2
classes.

The only thing you need to watch for at this point is that your project
doesn't have a root namespace. If it does, then you will need to
include that root namespace in you web.config as well.

Example

<httpHandlers>
<add verb="*" path="mytest.ashx"
type="projectrootnamespace.SOAPSERVEMON.HTTPServic e, asynctest"/>
</httpHandlers>

If done this in a quick little application I through together and it
compiles and runs fine.

Hope that helps.

Peter Kelcey

Nov 23 '05 #4
Hi Peter,

Thanks a lot. That was really helpful. And it worked. I am
very new to Web Service. So bit struggling.

Thanks again.
kaush

"Peter Kelcey" wrote:
Kaush

You need to specify your assembly, not the Microsoft assembly

Example

I create a new class called HttpService, derive it from the
Microsoft.Web.Services2.Messaging.SoapReceiver class.
My new class is in namespace SOAPSERVEMON.
The project that I've got this class in is configured to create an
assembly called asynctest.dll (You can check your assembly name by
right clicking on the project, selecting properties and looking at the
"general" section under the "common properties" folder.

Now, in order to use this class, I would add the following section to
my web.config

<httpHandlers>
<add verb="*" path="mytest.ashx" type="SOAPSERVEMON.HTTPService,
asynctest"/>
</httpHandlers>

As you can see, you need to specific the assembly that contains your
new class, not the existing Microsoft assembly that holds the Services2
classes.

The only thing you need to watch for at this point is that your project
doesn't have a root namespace. If it does, then you will need to
include that root namespace in you web.config as well.

Example

<httpHandlers>
<add verb="*" path="mytest.ashx"
type="projectrootnamespace.SOAPSERVEMON.HTTPServic e, asynctest"/>
</httpHandlers>

If done this in a quick little application I through together and it
compiles and runs fine.

Hope that helps.

Peter Kelcey

Nov 23 '05 #5

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

Similar topics

3
by: Kai Huener | last post by:
Hello, I have a problem to add a config File to a windows forms application. The File (UploadClient.exe.config) is in the same folder as the CodeFiles (namespace is UploadClient), but when I try...
1
by: Jinashe | last post by:
what do i need to enable accessing of webservices from a clients PC i'm hosting some webservices from my server in VB.NET. i've got some client windows applications done in VB.NET. what have i...
4
by: jf li | last post by:
I have a Asp.net web application and a Asp.net Web service application. The Web application is using HtmlInputFile to get a 50M size of file selected by end user, read the data of this file and...
7
by: Jorgen Haukland, Norway | last post by:
Hi, I have created a Java webservice which runs in IBM WebSphere appserver. I take the WSDL-file and create a VS.NET WinForm application and calls the service running on my PC and everything...
4
by: glebur | last post by:
Hi, I'm trying to create a web service client in C# but I get stuck at one of the first steps. When adding a Web reference to the Visual Studio project; I get this error (this is a translation,...
7
by: Mike Livenspargar | last post by:
We have an application converted from v1.1 Framework to v2.0. The executable references a class library which in turn has a web reference. The web reference 'URL Behavior' is set to dynamic. We...
10
by: smarty | last post by:
Hi, I have written a WSE in vis studio 2005 as and produced a dll that I can use in other projects by including the following in the web.config. <webservices> <soapextensiontypes> <add...
1
by: bixbarton | last post by:
Running C# .NET 1.1 I'm experiencing a weird oddity. We have a client app which access the webservice at http://www.test.planningportal.gov.uk/soap/servlet/messagerouter If I start the...
3
by: Lance Wynn | last post by:
Hello, I am receiving this error when trying to instantiate a webservice component. I have 2 development machines, both are XP sp2 with VS 2008 installed. On one machine, the code works fine. On...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.