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. Advertisements

  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. Advertisements

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. batista
    Replies:
    1
    Views:
    1,115
    Laurent Bugnion
    Jan 26, 2006
  2. batista
    Replies:
    0
    Views:
    710
    batista
    Jan 26, 2006
  3. Mr. x
    Replies:
    2
    Views:
    853
    Andrew
    Oct 10, 2003
  4. Cyril
    Replies:
    2
    Views:
    4,780
    Cyril
    Jun 1, 2006
  5. Mr. x

    use another webservice in a webservice

    Mr. x, Sep 26, 2003, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    241
    Mr. x
    Sep 26, 2003
  6. Peter Nordström

    Webservice calling a webservice.....Error

    Peter Nordström, Oct 21, 2003, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    280
    Peter Nordström
    Oct 21, 2003
  7. Dotnet developer

    How to communicates with another webservice with another webservice

    Dotnet developer, Apr 9, 2004, in forum: ASP .Net Web Services
    Replies:
    3
    Views:
    265
    Jan Tielens
    Apr 13, 2004
  8. Calling a webservice from a webservice

    , Apr 19, 2005, in forum: ASP .Net Web Services
    Replies:
    2
    Views:
    239
Loading...