473,626 Members | 3,365 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Debug webservice

Hi

I have a VS2005 c# solution which includes a webservice and a windows
application which uses the webservice.

How do I "debug" into the webservice from the application?

I can for example debug/attach to aspnet_wp.exe and access the webservice
from a browser - and there I can hit breakpoints in the webservice (but
unfortunately not access the more complex methods in my webservice).

But I can't work out how to achieve the same from my windows application.
Thanks,
Peter
Jun 27 '07 #1
2 2285
How do I "debug" into the webservice from the application?
On a related note, how would one get a look at the soap packets (request and
response) when using the wrapper classes generated from a wsdl? The wrapper
classes try to hide the conversation and it would be nice to see the
specifics of the question.

And in my case, I'm talking to a web service written in php that doesn't
seem to give proper soap error responses, so I really need to see what's
getting sent back.

Thanks
Mark

Jun 27 '07 #2
One options for getting at the Soap message content is to use a "universal"
client such as the System.Net.Http WebRequest object to send and recieve raw
Soap (see the second post to WebClient generates exception: header must be
modified using ... 6/22/07). If you have a WCF client to your web service,
you can add the following local to the class containing the client object
creation and web service call:

Public Shared results As String

Private Class MyBehavior
Implements ServiceModel.De scription.IEndp ointBehavior

Public Sub AddBindingParam eters(ByVal endpoint As
System.ServiceM odel.Descriptio n.ServiceEndpoi nt, ByVal bindingParamete rs As
System.ServiceM odel.Channels.B indingParameter Collection) Implements
System.ServiceM odel.Descriptio n.IEndpointBeha vior.AddBinding Parameters

End Sub

Public Sub ApplyClientBeha vior(ByVal endpoint As
System.ServiceM odel.Descriptio n.ServiceEndpoi nt, ByVal clientRuntime As
System.ServiceM odel.Dispatcher .ClientRuntime) Implements
System.ServiceM odel.Descriptio n.IEndpointBeha vior.ApplyClien tBehavior
clientRuntime.M essageInspector s.Add(New MyInspector)
End Sub

Public Sub ApplyDispatchBe havior(ByVal endpoint As
System.ServiceM odel.Descriptio n.ServiceEndpoi nt, ByVal endpointDispatc her As
System.ServiceM odel.Dispatcher .EndpointDispat cher) Implements
System.ServiceM odel.Descriptio n.IEndpointBeha vior.ApplyDispa tchBehavior

End Sub

Public Sub Validate(ByVal endpoint As
System.ServiceM odel.Descriptio n.ServiceEndpoi nt) Implements
System.ServiceM odel.Descriptio n.IEndpointBeha vior.Validate

End Sub
End Class

Private Class MyInspector
Implements ServiceModel.Di spatcher.IClien tMessageInspect or

Public Sub AfterReceiveRep ly(ByRef reply As
System.ServiceM odel.Channels.M essage, ByVal correlationStat e As Object)
Implements
System.ServiceM odel.Dispatcher .IClientMessage Inspector.After ReceiveReply
results = vbCrLf
results &= "=====AfterRece iveReply======= ========="
results &= vbCrLf
results &= reply.ToString
results &= vbCrLf
results &= "============== =============== ========="
results &= vbCrLf

End Sub

Public Function BeforeSendReque st(ByRef request As
System.ServiceM odel.Channels.M essage, ByVal channel As
System.ServiceM odel.IClientCha nnel) As Object Implements
System.ServiceM odel.Dispatcher .IClientMessage Inspector.Befor eSendRequest
Return Nothing
End Function
End Class

The calling code would do the following to invoke this behavior assuming the
service object is name WsClient and you have a Textbox control named
txtResults:

WsClient.Endpoi nt.Behaviors.Ad d(New MyBehavior)

''' code to invoke your service goes here

'Display the response from the web servive:

txtResults.Text &= results

''' rest of your code...

Hope this helps!
Jun 27 '07 #3

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

Similar topics

0
1486
by: DKode | last post by:
Ok, Maybe there is an easier way to do what it is im trying to do. Let me explain how I have the solution setup first. Basically, I am having alot of difficulty debugging on my local machine and then deploying the projects to remote machines. Project : Portal this is the web project that is the UI for the app. it contains a reference to BusinessLayer
1
1578
by: John Nelson | last post by:
I seem to only be able to use a webservice after I compile a project and run the executable code. When I try to run the code in Visual Studio 2003 in debug mode it always hangs on the "this.Invoke" line of the webservice wrapper and gives me a timeout error. I know it's not a problem with the code since it runs fine in the EXE. I started having this problem on the same machine 2 weeks ago. To my knowledge I didn't change anything in...
9
2315
by: mekim | last post by:
Hi All, I have a solution that has a asp.net app project and webservice project in it When I debug the asp.net app...and then terminate it...the webservice is still live...and aspnet_wp.exe is still live w/ it. I have to end task aspnet_wp.exe in order for the webservice part of the solution to end Is there a "right" way to terminate a webservice project when it is called from a asp.net project in a solution?
2
11202
by: wcchan | last post by:
Hi, We set debug="false" at web.config of a WebService for performance sake. We found that after set, the web service request will sometimes got a timeout exception. Would anyone tell me how long the web service request be timeout and how to configure the timeout limit of the webservice calls? Thanks advance.
0
1905
by: rob | last post by:
I am trying to debug a webservice by steping into a web method called from a windows form project. The strange thing is that sometimes it works but often it does not. When it does not work I get the following error when trying to step into a web method: Unable to automatically step into the server. The remote procedure could not be debugged. This usually indicaes that debugging has not been enabled on the server. See help for...
1
1986
by: Epetruk | last post by:
Hello, In VS2003, I used to have two solutions - a debug and release solution. Each solution had a webservice project and several other class library projects. The webservice project referenced all the other class library projects (i.e. so that it used the dll created when those other projects were built). The debug solution was configured so that all the projects in it had debug
5
5766
by: perspolis | last post by:
Hi all I have a webservice that I want to debug it line by line.. I enabled the Debug option in WeConfig. but I can't debug that and when I set a break point for it,that dosen't work .. thanks in advance
1
4255
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 client with no debugging it's fine. But if I start the client with debuggin on, when it Invokes a method on
4
1674
by: John Sheppard | last post by:
Hello all, I have an application written in VB.Net that comsumes a webservice. We are having issues with speed. I have not ruled out a webservice problem, and this was my first guess. However when running through my application in release mode the application's (assemblyname.vhost.exe) memory usage fluctuates heavily and goes upto a max of 1.5GB and then rests on 1GB once the application is loaded. This does not occur in debug mode, it...
0
8196
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8701
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8364
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
8502
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
7192
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...
0
5571
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
4090
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
1807
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1507
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.