Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > Other .NET > .NET Web Services
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
.NET Web Services Discussions about .NET XML Web Service technologies including ASMX files, WSDL and SOAP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the .NET Web Services section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 27th, 2004, 08:07 AM
Registered User
Join Date: Jan 2004
Location: Hammond, LA, USA.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default WSE 2.0 Sending Username Token

I'm trying to use WSE 2.0 in Visual Studio .NET 2003 to set up a web service to pass username and password in a token in the SOAP header.

Here's the page which sets the token (Token) and adds it to the web service proxy before calling the web service to populate a datagrid:

Public Token As New UsernameToken("OCDDdata", "support247dc", PasswordOption.SendPlainText)

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    Dim ws As New DCtoOCDDclient.refCensusService.CensusServiceWse


     Dim dsCensus As New DataSet
     dgCensus.DataSource = dsCensus
    Catch we As WebException
     Label1.Text = "Failed! " & we.Message
    End Try
End Sub

If I break at this point, I can see the RequestSoapContext filled with the token. However, when the web service is actually called it's missing.

<WebMethod(Description:="Basic Census info for DC's")> _
Public Function getCensus() As DataSet


    Dim dsCensus As New DataSet
    Dim Sqlstr As String
    Sqlstr = "SELECT DC_NR, dcID, Name_Last, Name_First, Name_Mid, Name_Suffix, SSN, DOB, ************, Begda, Endda FROM dbo.v_DCall"
    Dim daOCDD As New SqlDataAdapter(Sqlstr, ConfigurationSettings.AppSettings("connOCDD"))
    Return dsCensus

What am I missing here?

Reply With Quote
  #2 (permalink)  
Old April 28th, 2005, 08:29 AM
Registered User
Join Date: Apr 2005
Location: , , USA.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts

I've just encountered the same issue. Has anyone figured out the resolution? I'm running WSE 2.0 SP 3 and suspect there may be catch in how I've added the web reference to my client project.

Reply With Quote
  #3 (permalink)  
Old April 28th, 2005, 02:17 PM
Registered User
Join Date: Apr 2005
Location: , , USA.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts

As I suspected, the web Reference I'd set up was incorrect, inadvertantly pointed it to an old version of the web service, so once I set up a new one, I was ok.
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Invalid Token sani723 XSLT 2 December 25th, 2007 01:42 AM
WSE 2.0 sabansingh .NET Web Services 0 May 15th, 2006 02:19 AM
VB 6 and WSE 2.0 ramkumars .NET Web Services 0 May 9th, 2006 04:52 AM
WSE 2.0 trouble sabansingh C# 0 February 21st, 2006 07:54 AM
Unrecognized token was found Dennis Huisman BOOK: Professional Crystal Reports for VS.NET 0 September 6th, 2004 07:08 AM

All times are GMT -4. The time now is 01:18 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.