Loading ...
Sorry, an error occurred while loading the content.

OK, got this to work.

Expand Messages
  • nate_bowler
    I tried enough combinations and eventually, I got this to work. The key was I changed - name( User = SOAP::Data....) to - value ( SOAP::Data....) . I
    Message 1 of 1 , Jul 19, 2002
    • 0 Attachment
      I tried enough combinations and eventually, I got this to work. The
      key was I changed "->name( 'User' => \SOAP::Data....)" to "->value
      (\SOAP::Data....)".

      I believe this is the last test I need to succeed for the API I am
      defining using Sun's JWSDK.

      The only combination I haven't tried yet is passing in an array of
      structs.

      Nate


      //////////////////////////////////
      // Working Perl Client

      #!perl -w
      #!d:\perl\bin\perl.exe

      use SOAP::Lite;

      my $attask_ns = 'http://www.attask.com/api';

      my $api_server = SOAP::Lite
      -> soapversion(1.2)
      -> uri('http://www.attask.com/api')
      -> service('http://63.228.219.51:8080/attask/APIService.wsdl');

      $api_server->serializer->maptype->{User}
      = 'http://www.attask.com/api';

      my $sessionID = $api_server->login("admin","testing");
      print "sessionID:$sessionID\n";

      # build the call parameters

      my $uf2 = SOAP::Data->type('User')->value(\SOAP::Data->value
      (SOAP::Data->name('hasError' => SOAP::Data->type(boolean => 0)),

      SOAP::Data->name('state' => 'CA'),

      SOAP::Data->name('zip' => 'null'),

      SOAP::Data->name('primaryContact' => 'null'),

      SOAP::Data->name('city' => 'null'),

      SOAP::Data->name('username' => 'null'),

      SOAP::Data->name('emailAddr' => 'null'),

      SOAP::Data->name('groupID' => -1),

      SOAP::Data->name('address' => 'null'),

      SOAP::Data->name('firstName' => 'null'),

      SOAP::Data->name('password' => 'null'),

      SOAP::Data->name('lastName' => 'null'),

      SOAP::Data->name('companyName' => 'null'),

      SOAP::Data->name('userID' => -1),

      SOAP::Data->name('phoneNumber' => 'null'),
      ));



      my $userlist = $api_server->getUsersByUserFilter($sessionID, $uf2);
      print "\nusername:" . $$userlist[0]->{'username'} . "\n";

      $api_server->logout($sessionID);
    Your message has been successfully submitted and would be delivered to recipients shortly.