Click here to Skip to main content
15,890,123 members
Home / Discussions / C#
   

C#

 
GeneralRe: c++ to c# and marshalling Pin
tom_dx17-Jun-05 2:20
tom_dx17-Jun-05 2:20 
GeneralSize Of a Managed Object Pin
Andre Trollip16-Jun-05 20:58
Andre Trollip16-Jun-05 20:58 
GeneralRe: Size Of a Managed Object Pin
S. Senthil Kumar16-Jun-05 23:51
S. Senthil Kumar16-Jun-05 23:51 
GeneralRe: Size Of a Managed Object Pin
Andre Trollip17-Jun-05 0:30
Andre Trollip17-Jun-05 0:30 
GeneralRe: Size Of a Managed Object Pin
DavidNohejl17-Jun-05 3:40
DavidNohejl17-Jun-05 3:40 
GeneralInstaller CustomAction in managed code Pin
mav.northwind16-Jun-05 20:49
mav.northwind16-Jun-05 20:49 
Generalon using dataset Pin
ppp00116-Jun-05 19:05
ppp00116-Jun-05 19:05 
GeneralWeb Service - Query Pin
Sumit Domyan16-Jun-05 18:56
Sumit Domyan16-Jun-05 18:56 
Hi All

I am looking for a solution to a problem regarding web service. I want to call a web method of a web service, but I don’t want to use wsdl nor can I generate the proxy class. The scenario is that, in my application user can fill in the web service address and a list of methods with parameters, he wants to execute and I have to get the results.

I have some solution to this problem. Right now i am using WSE to solve this problem. My code is:


        Dim env As SoapEnvelope
        Dim epr As EndpointReference
        Dim client As MyHttpClient
        Dim rs As SoapEnvelope
        Dim bodyResponse As String

        env = New SoapEnvelope
        env.Context.Addressing.Action = New Action("http://tempuri.com/TestWebService/MyService/HelloWorld")
        env.CreateBody()

        env.Body.InnerXml = String.Format("<HelloWorld xmlns=""http://tempuri.com/TestWebService/MyService/"" />")
        epr = New EndpointReference(New Uri("http://localhost/TestWebService/MyService.asmx")) 
        client = New MyHttpClient(epr)

        rs = client.Hello_World(env)
        bodyResponse = rs.Body.OuterXml
        TestReport.Text = bodyResponse




Imports System.Xml
Imports Microsoft.Web.Services2
Imports Microsoft.Web.Services2.Addressing
Imports Microsoft.Web.Services2.Messaging
Imports System.Web

Public Class MyHttpClient
    Inherits SoapClient

    Public msg As String = String.Empty
    Public LoadTesterForm As LoadTesterForm = Nothing

    Public Sub New(ByVal dest As EndpointReference)
        MyBase.New(dest)
    End Sub

    <SoapMethod("http://tempuri.com/TestWebService/MyService/HelloWorld")> _
    Public Function Hello_World(ByVal envelope As SoapEnvelope) As SoapEnvelope
        Dim response As SoapEnvelope

        response = MyBase.SendRequestResponse("HelloWorld", envelope)
        msg = response.Body.OuterXml


        Hello_World = response
    End Function

    Protected Overrides Sub FilterMessage(ByVal envelope As Microsoft.Web.Services2.SoapEnvelope)
        MyBase.FilterMessage(envelope)
    End Sub
End Class



I am getting the response back with this code.
Main problem is env.Body.InnerXml, Here we need to specify all the parameters & method name as XML. But i dont have parameter names.

One solution to this problem might be i can generate proxy class at runtime. Can anybody guide me to the right direction?

Thanks a lot

Sumit Domyan
GeneralApplication Shell then create modules Pin
misticat16-Jun-05 16:51
misticat16-Jun-05 16:51 
Generaldrop excel to winform Pin
Ista16-Jun-05 15:14
Ista16-Jun-05 15:14 
QuestionGood tree and PropertyGrid controls? Pin
David Thielen16-Jun-05 13:06
David Thielen16-Jun-05 13:06 
AnswerRe: Good tree and PropertyGrid controls? Pin
Ista16-Jun-05 15:46
Ista16-Jun-05 15:46 
GeneralRe: Good tree and PropertyGrid controls? Pin
Roger Alsing20-Jun-05 20:55
Roger Alsing20-Jun-05 20:55 
GeneralRe: Good tree and PropertyGrid controls? Pin
Ista20-Jun-05 21:02
Ista20-Jun-05 21:02 
QuestionCan i change the look of a progress bar? Pin
Anthony Mushrow16-Jun-05 12:10
professionalAnthony Mushrow16-Jun-05 12:10 
AnswerRe: Can i change the look of a progress bar? Pin
Christian Graus16-Jun-05 12:28
protectorChristian Graus16-Jun-05 12:28 
AnswerRe: Can i change the look of a progress bar? Pin
tom_dx16-Jun-05 15:17
tom_dx16-Jun-05 15:17 
AnswerRe: Can i change the look of a progress bar? Pin
Marc Clifton16-Jun-05 15:38
mvaMarc Clifton16-Jun-05 15:38 
GeneralWSE The signature or decryption was invalid Pin
Vadim Tabakman16-Jun-05 11:42
Vadim Tabakman16-Jun-05 11:42 
GeneralRe: WSE The signature or decryption was invalid Pin
Vadim Tabakman26-Jun-06 18:46
Vadim Tabakman26-Jun-06 18:46 
GeneralTransfer String from Class to Form Pin
epfuller16-Jun-05 11:02
epfuller16-Jun-05 11:02 
GeneralRe: Transfer String from Class to Form Pin
Kevin C Ferron16-Jun-05 12:42
Kevin C Ferron16-Jun-05 12:42 
Generalwebbrowser javascript error handling/disabling Pin
astroflake16-Jun-05 8:50
astroflake16-Jun-05 8:50 
GeneralRe: webbrowser javascript error handling/disabling Pin
Judah Gabriel Himango16-Jun-05 10:20
sponsorJudah Gabriel Himango16-Jun-05 10:20 
GeneralConvert Grpahic object to Image object Pin
Sasuko16-Jun-05 8:00
Sasuko16-Jun-05 8:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.