Parameters aren't tranfered to the webservice

Discussion in 'ASP .Net Web Services' started by Pernille, Sep 9, 2003.

  1. Pernille

    Pernille Guest

    Hi,

    I have a problem transfurring the parametres from my perl client
    program to the webservice. I have another clientprogram in C# where
    there is no problem so it cant be the webservice which is wrong.

    The connection to the service is ok, but if I try to call the
    Webmethod with the parametres from the client and return the
    parametervalues from the webservice, they are always set to default,
    zero if it's an int or " " if its a string.

    Perl Client:
    _______________________________________________________________________________

    #!/local/perl/eg

    # hello.pl

    use WebService::ServiceProxy;

    my $wsdl = "http://localhost/DmuCheckOutService/Service1.asmx?WSDL";
    my $service = WebService::ServiceProxy->new($wsdl);

    print "Which funktion do you want to access?\n A: Check Out DMU\n ";

    $name = <STDIN>;

    if ($name =~ "a")
    {
    print "Check Out Dmu:\n Enter DMU id: ";
    $dmuid = <STDIN>;
    print $service->Test($dmuid);
    }
    ________________________________________________________________________________

    Webservice:
    ________________________________________________________________________________

    [WebMethod]
    public string Test(int id)
    {
    return "id : "+id;
    }

    ________________________________________________________________________________

    Even if I hardcode the id in the client as: "Test(2); " it returns 0.

    Can enyone tell me what I am doing wrong??

    Thanks

    Pernille
     
    Pernille, Sep 9, 2003
    #1
    1. Advertising

  2. Pernille

    Pernille Guest

    I solved the problem myself by using this code:

    use SOAP::Lite;

    my $soap = SOAP::Lite
    -> uri('http://kpmdev.newtech.dk')
    -> on_action( sub { join '/', 'http://kpmdev.newtech.dk', $_[1] } )
    -> proxy('http://kpmdev.newtech.dk/kpmwebservice/Service1.asmx');

    print "Check Out Dmu:\n Enter DMU id: ";
    $dmuid = <STDIN>;
    print " Enter User Id: ";
    $userid = <STDIN>;
    my $method = SOAP::Data->name('CheckoutDMU')
    ->attr({xmlns => 'http://kpmdev.newtech.dk'});

    my @params = ( SOAP::Data->name(dmuautoid => $dmuid),
    SOAP::Data->name(userid => $userid) );

    print $soap->call($method => @params)->result;
     
    Pernille, Sep 11, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?VHlzb24gQnJvd24=?=

    SetAuthCookie works, but our cookies aren't being written - HELP

    =?Utf-8?B?VHlzb24gQnJvd24=?=, May 3, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    449
  2. Rod
    Replies:
    2
    Views:
    5,955
  3. Guest
    Replies:
    1
    Views:
    591
    Lowell Heddings
    Dec 9, 2004
  4. Eric Sabine
    Replies:
    3
    Views:
    446
    =?Utf-8?B?U2hhdw==?=
    Jan 28, 2005
  5. AC [MVP MCMS]
    Replies:
    0
    Views:
    443
    AC [MVP MCMS]
    Jun 15, 2005
Loading...

Share This Page