all groups > dotnet web services enhancements > september 2007 >
You're in the

dotnet web services enhancements

group:

WSE 3.0 UsernameToken in COM+ to Web Service


WSE 3.0 UsernameToken in COM+ to Web Service BigJohn
9/25/2007 6:58:03 AM
dotnet web services enhancements:
I have a usernameToken in a VB .Net 2005 Class configured for COM interface
for a VB6 EXE. The VB6 to COM works fine, but the addition of a Proxy is not
found.

The error I keep getting is:
Specified argument was out of the range of valid values.
Parameter name: Policy 'REVSCOMPolicy' is not configured in the system


The other entries I have read reference the Policy names not matching in the
Config files but are specific to ASP.Net and Forms applications but do not
address COM.

Suggestions?


COM Code:
Dim wsREVS As New REVS_WS.ServiceWse
Dim wsToken As New Tokens.UsernameToken(strID, strPSW,
PasswordOption.SendPlainText)

Try
wsREVS.SetClientCredential(wsToken)
wsREVS.SetPolicy("REVSCOMPolicy")


app.Config File
<microsoft.web.services3>
<policy fileName="wse3policyCache.config" />
</microsoft.web.services3>


WSE3Policy.config File
<policies xmlns="http://schemas.microsoft.com/wse/2005/06/policy">
<extensions>
<extension name="usernameOverTransportSecurity"
type="Microsoft.Web.Services3.Design.UsernameOverTransportAssertion,
Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35" />
<extension name="requireActionHeader"
type="Microsoft.Web.Services3.Design.RequireActionHeaderAssertion,
Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35" />
</extensions>
<policy name="REVSCOMPolicy">
<usernameOverTransportSecurity />
<requireActionHeader />
</policy>
</policies>

RE: WSE 3.0 UsernameToken in COM+ to Web Service wawang NO[at]SPAM online.microsoft.com (
9/26/2007 12:00:00 AM
Hi BigJohn,

Based on my understanding, you've created a class library in VB.NET 2005
and registered for com interop and it will be used by your VB6 code. You
created app.config for the VB.NET 2005 class library project to configure
the WSE 3 related settings. You found the added policy name is not found
when VB6 code called the VB.NET 2005 component. Please feel free to correct
me if I've misunderstood anything.

First, the app.config is not used by the compiled class library (.dll). In
other words, although the app.config is copied to the output directory and
named as the .dll but with .dll.config extension, it's not used by .NET at
run-time. This is because .NET configuration file is used per AppDomain and
by default it will only use the .exe.config with the main application.

You can verify this by creating a simple Console project in .NET and add
reference to your class library, then copy the app.config into the Console
project and see if it works.

On the other hand, I understand that you need to make the config file work
with your class library project when called by VB6 code. I will do some
further research to see how to make this work. I'll keep you posted. Please
feel free to let me know if you have any questions or concerns. Thanks.


Regards,
Walter Wang (wawang@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

RE: WSE 3.0 UsernameToken in COM+ to Web Service BigJohn
9/27/2007 5:21:03 AM
Due to the urgency of this problem, I opened a Severity 1 ticket and received
the following resolution:

Problem Description:
Implementing a .NET DLL consumed by a VB6 application where the .NET DLL
calls a web service. The web service call uses WSE 3.0 to provide a username
token for security. The web service call fails with the error:

"Run-time error '-2146233086 (80131502)':
Specified argument was out of range of valid values.
Parameter name: Policy 'ClientPolicy' is not configured in the system

Root Cause (if known):
This error is caused by the .NET dll not having access to its app.config and
wse3policycache.config files.


Resolution:
To resolve the problem copy the .NET dll’s app.config and
wse3policycache.config files to the working folder of the hosting VB6
application. Then rename the app.config to match the VB6 exe. The format is
“VB6exename”.exe.config. The name of this file is critical. It must match the
VB6 executable because when the .NET DLL looks for the file it looks for it
under its parent process.


Common Language Resolution:
Given the VB6 desktop distributed name is VB6Desktop.exe, and the COM
component distributed name is MyCOM.dll, copy the MyCOM.dll.config file from
the release directory to the VBDesktop.exe directory and rename it to
VBDesktop.exe.config. Since I was not registering the dll through Component
Services, .Net was running it under the EXE application space which, by
default, the config file is expected there. This works nicely since my dll
is associated with the exe and are always distributed together to be used
RE: WSE 3.0 UsernameToken in COM+ to Web Service wawang NO[at]SPAM online.microsoft.com (
9/28/2007 2:02:45 AM
Hi John,

Thanks very much for sharing the cause and solution here.


Regards,
Walter Wang (wawang@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

RE: WSE 3.0 UsernameToken in COM+ to Web Service Durga - VB6 code to call WSE webservice
11/30/2007 11:49:00 AM
Hi John,

I have a similar requirement in my project to call a wse webservice from VB
6 code. It would be more helpful if you can share the code for .NET wrapper
and VB6 code to call the webservice. Any pointers would also help.

Thanks
Durga

[quoted text, click to view]
RE: WSE 3.0 UsernameToken in COM+ to Web Service Kan
2/6/2008 3:40:25 PM

[quoted text, click to view]

hi,

I would like to use a sample application with Vb.Net using the UserToken. i tried to download the example from internet but it alwys fails at X.05 certificate not avialable. Can any one please help in with a sample project using UserToken.
My client application is Vb.Net desktop application.

Thanks in advance.
Hope some one will respond to this post.
Please help.


Kancharla

BizTalk Utilities - Frustration free BizTalk Adapters
RE: WSE 3.0 UsernameToken in COM+ to Web Service Kan
2/6/2008 3:49:40 PM

[quoted text, click to view]

hi,

I would like to use a sample application with Vb.Net using the UserToken. i tried to download the example from internet but it alwys fails at X.05 certificate not avialable. Can any one please help in with a sample project using UserToken.
My client application is Vb.Net desktop application.

Thanks in advance.
Hope some one will respond to this post.
Please help.


Kancharla

BizTalk Utilities - Frustration free BizTalk Adapters
AddThis Social Bookmark Button