Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

custom web service in wss 3.0 cannot load type class from assembly !!!

2 views
Skip to first unread message

gmail001

unread,
Dec 4, 2006, 5:21:30 PM12/4/06
to
hi there
I am trying deploying this a custom web service using this article
http://msdn2.microsoft.com/en-us/library/ms464040.aspx#

i deployed Create_Site. dll into GAc , and test.asmx file in layouts
for creating the discovery files and wsdl files. So tha i could browuse
via http://local;host/_layouts/test.asmx

ERROR ------ !!!@@@ @@@ Could not load type 'class1 from
assembly 'Create_Site_ECS, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=12bef56a6427b4cc' @@@@@

code in test.asmx is '

<%@ WebService Language="C#" Class="Class1, 'Create_Site,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=12bef56a6427b4cc" %>

thanks
sunil

S.S. Ahmed

unread,
Dec 5, 2006, 6:44:26 AM12/5/06
to
It should be like this:

<%@ WebService Language="C#" Class="Class1, Create_Site.DLL" %>

and if you are using a codebehind then include it in the declaration:

<%@ WebService Language="C#" CodeBehind="Class1.asmx.cs" Class="Class1,
Create_Site.DLL" %>

HTH

--
S.S. Ahmed
www.walisystems.com


"gmail001" <abcs...@yahoo.com> wrote in message
news:1165270890.1...@n67g2000cwd.googlegroups.com...

gmail001

unread,
Dec 5, 2006, 10:42:06 AM12/5/06
to
hi there
thanks for ur quick reply
deploying the dll in gac , do u think i should register this dll as
safe in the web.config file at the web application level.

http://localhost/_layouts/test.asmx

if my test.asmx code is
<%@ WebService Language="C#" Class="Class1, Create_Site.DLL" %>
filw not found error AND CREATE_SITE.DLL IS IN THE gAC OF THE WSS
SERVER.

if code in test.asmx is

gmail001

unread,
Dec 5, 2006, 6:21:25 PM12/5/06
to
changed the trust level to be fullin web.config file. any pointers
thanks
gamil 001

S.S. Ahmed

unread,
Dec 6, 2006, 5:31:41 AM12/6/06
to
Hi Sunil,

Well both the errors you mentioned point to the same problem, that is,
SharePoint is unable to locate the assembly. It is not a permissions issue,
therefore, changing the trust level to FULL or adding the assembly as SAFE
in web.config wont make any difference. Make sure the assembly is accessible
to SharePoint. Add a bin folder to the application where you want to use
this assembly and copy the assembly in that bin folder and then add it to
the GAC (using the bin folder path). Dont forget to restart your IIS and
then try again and let me know the result.

Looking forward to hearing from you soon.

Regards,

--
S.S. Ahmed
www.walisystems.com


"gmail001" <abcs...@yahoo.com> wrote in message

news:1165360885.5...@f1g2000cwa.googlegroups.com...

gmail001

unread,
Dec 6, 2006, 11:02:20 AM12/6/06
to
hi there
.

I still get the same error : steps folowed by ur help comments
1) Made a bin folder in _layouts folder is, copied the assembly. And
also copied to the web application GUId folder
c:\inetpub\wwwroot\wss\virtualdirectories\guid. Deployed my test.asmx
file in the _layouts folder.

2) From visual studio 2005 command prompt  change the directory to
the current bin folder and used gacutil.exe to deploy the assembly into
GAC
3) With out any problem it got deployed.
4) Then Reset iis
5) Browsed the _layouts folder http://server\_layouts\test.asmx
Still I get the same error cannot load type form assembly


based on your previous recommendation i could sucssfully deploy and
use my custom web services and use it if i dont delete the code
behind form the project and moving it intoa differect class project.


the reason for chaning the trust level is my web service would do some
admin works( sub site creation and role assignment, group creation
programaticaly) in wss 3.0 and moss 2007

thanks
Sunil Prabha

S.S. Ahmed

unread,
Dec 7, 2006, 6:27:40 AM12/7/06
to
Hi Sunil,

Bin folder should be created in
c:\inetpub\wwwroot\wss\virtualdirectories\portno path, not in _layout
folder! If you want to use your service in a site configured at port 81 then
you should create a bin folder in the following path:

c:\inetpub\wwwroot\wss\virtualdirectories\81

and the final path after adding the bin folder will be:

c:\inetpub\wwwroot\wss\virtualdirectories\81\bin

Now, your web service should be accessible in code. We add it to GAC to
avoid permissions error. You can change the trust level to medium if you
dont want to add the assembly in GAC or you can create a custom policy of
your own.

--
S.S. Ahmed
www.sharepointblogs.com/ssa


"gmail001" <abcs...@yahoo.com> wrote in message

news:1165420940.7...@80g2000cwy.googlegroups.com...
hi there
.

I still get the same error : steps folowed by ur help comments
1) Made a bin folder in _layouts folder is, copied the assembly. And
also copied to the web application GUId folder
c:\inetpub\wwwroot\wss\virtualdirectories\guid. Deployed my test.asmx
file in the _layouts folder.

2) From visual studio 2005 command prompt ? change the directory to

gmail001

unread,
Dec 7, 2006, 1:49:51 PM12/7/06
to
Hi there
Followed Ur steps but no luck, bad luck thanks for ur support and help
man.
But i want to follow
http://msdn2.microsoft.com/en-us/library/ms464040.aspx#
if i follow those msnd steps it wont work .

1)))) @@@--Failure-- @@@
I deploy the code in bin folder and deploy the assembly in GAC using
gacutil running from bin folder location,, still it wont work " I get
could not find Type class a form .....Assembly. "

2)))) @@@success:!!!@@@@
Developing Web service in .net 2005 and using code behind and deploy
the assembly into (Inetpub\wwwroot\wss\VirtualDirectories\port\_app_bin
) and (amsx,wsdl and disco files in ISPI folder. works. but i cannot
read my app settings from web.config file .

If I deploy it in
Inetpub\wwwroot\wss\VirtualDirectories\port\_app_bin\web.config file
wont work ? What is the best place to deploy the web.config file.

3)))) @@@success:!!!@@@@====with appsetting in web.config file ----->
Fails to read config values, developing Web service in .net 2005 and
use code behind and deploy the assembly into
Inetpub\wwwroot\wss\VirtualDirectories\port\_app_bin and amsx,wsdl and
disco files in ISPI folder. it works. but I cannot read my app
settings.


I am trying to do this: to read appsetting from web.config, and be able
to deploy my assembly and be able to use my web service with wsdl and
disco . Unable to read appsettings, and unable to find bin folder.


Problems is 1) unable to0 find my assembly 2) success and finds my
assembly but cannot read values from web.config file.

Thanks for Ur insight and Appreciate Ur help time .
Sunil Prabha

gmail001

unread,
Dec 7, 2006, 2:27:08 PM12/7/06
to
share point gone carzy/broken links , hold on , i have some wired
problem
all sites links are working , except my web parts
no web parts works , no list view web parts workls and no custom web
part works
I removed all the webparts for webpart maintence page.
when i try to add a new webpart like page viewer webpart of some thing
it throws a message box error

Error
Web Part Error: This page has encountered a critical error. Contact
your system administrator if this problem persists.

stepsdone to resolve this:
1) ran the SharePoint Products and Technologies Configuration Wizard,
hoping tha twill resolve, no luck.
2) what might be the problem. this might be effecting my webservice
also.


thanks
sunil

S.S. Ahmed

unread,
Dec 8, 2006, 4:22:24 AM12/8/06
to
Restore your original web.config! Sometimes, making changes incorrectly in
the web.config causes this type of problem.

--
S.S. Ahmed
www.sharepointblogs.com/ssa


"gmail001" <abcs...@yahoo.com> wrote in message

news:1165519628....@j72g2000cwa.googlegroups.com...

gmail001

unread,
Dec 8, 2006, 10:39:03 AM12/8/06
to
thanks ahmed
i restored the web.config file, and works fine thanks a lot.
I will let u know when i suceed in deploying my custom web service
using msdn method
. i can get it working like deploying the assembly in the app_bin
folder. C:\Inetpub\wwwroot\wss\VirtualDirectories\80\_app_bin

i cannot get the code to work if ideploy custom assembly in bin
folder.
C:\Inetpub\wwwroot\wss\VirtualDirectories\80\bin

the question is what is teh best place u recommend ?
Where to deploy the web.config file if i deploy my assembly in
C:\Inetpub\wwwroot\wss\VirtualDirectories\80\_app_bin


thank you much , appreciate ur time
sunilprabha

S.S. Ahmed

unread,
Dec 9, 2006, 3:21:17 AM12/9/06
to
Hi Sunil,

Well, i always put my assembly in the BIN folder.

Why do you want to access the web.config? If you are placing your assembly
in the _app_bin folder then the default web.config of the virtual server
should work.

--
S.S. Ahmed
www.sharepointblogs.com/ssa


"gmail001" <abcs...@yahoo.com> wrote in message

news:1165592343.5...@n67g2000cwd.googlegroups.com...

0 new messages