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

SOAP::Lite server, VB .NET client only returns the first return value

Expand Messages
  • ebincar
    Hi, i have a SOAP::Lite service (currently it does not do much since i m testing this). The only method that is implemented is called AuthenticationRequest .
    Message 1 of 1 , Apr 17 9:50 AM
    • 0 Attachment
      Hi,

      i have a SOAP::Lite service (currently it does not do much since i'm
      testing this). The only method that is implemented is called
      "AuthenticationRequest". It takes two parameters, username and
      passwords and returns 4 parameters. (And it really does this, i have
      verified the response by using ethereal).

      The problem is with the Visual Basic .NET program that is supposed to
      use the SOAP::Lite service. All works fine, the VB program makes the
      request, sends the two parameters username and password which are
      received by the SOAP::Lite server, and the VB script receives the
      response. The first return value (statusmessage) gets returned OK, but
      none of the other return values get interpreted by .NET and are
      returned empty to my program.

      I would be most grateful if anyone have any experience in this field
      to share with me!

      See below for the wsdl, the SOAP::Lite program and the VB-stuff.

      --Kalle

      The SOAP::Lite server:
      ------------------------------------------
      #!/usr/bin/perl

      package PPic_MS_crap_net_interface;

      #use strict;
      use Encode;


      sub AuthenticationRequest {
      my( $self, $username, $password) = @_;

      print STDERR "AuthenticationRequest: username=".$username.",
      password=".$password."\n";

      #Encode::from_to( $text, "iso-8859-1", "utf16");

      my $status="OKIDOKI";
      my $errormessage = "Nothing wrong";
      my $session_key = "abc123";
      my $session_lifetime = "1200";

      my $r_status = SOAP::Data->new( type => 'xsd:string',
      name => 'status', value => $status, 'uri' =>
      'http://xxx/PPic/PPic_MS_crap_net_interface.wsdl');
      my $r_errormessage = SOAP::Data->new( type => 'xsd:string', name =>
      'errormessage', value => $errormessage, 'uri' =>
      'http://xxx/PPic/PPic_MS_crap_net_interface.wsdl');
      my $r_session_key = SOAP::Data->new( type => 'xsd:string', name =>
      'session_key', value => $session_key, 'uri' =>
      'http://xxx/PPic/PPic_MS_crap_net_interface.wsdl');
      my $r_session_lifetime = SOAP::Data->new( type => 'xsd:string', name
      => 'session_key', value => $session_key, 'uri' =>
      'http://xxx/PPic/PPic_MS_crap_net_interface.wsdl');

      return( $r_status, $r_errormessage, $r_session_key,
      $r_session_lifetime);
      }

      package main;

      use SOAP::Lite +debug => all;
      $SOAP::Constants::DO_NOT_USE_CHARSET = 1;

      use SOAP::Transport::HTTP;

      BEGIN {
      package SOAP::Serializer;
      sub gen_ns { '' }
      }

      SOAP::Transport::HTTP::CGI
      ->dispatch_to( 'PPic_MS_crap_net_interface')
      ->handle;

      1;



      The WSDL:
      -------------------------------------------------
      <?xml version="1.0" encoding="UTF-8"?>

      <definitions name="PPic_MS_crap_net_interface"
      targetNamespace="http://xxx/PPic/PPic_MS_crap_net_interface.wsdl"
      xmlns="http://schemas.xmlsoap.org/wsdl/"
      xmlns:tns="http://xxx/PPic/PPic_MS_crap_net_interface.wsdl"
      xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema">



      <message name="AuthenticationRequest_msg">
      <part name="username" type="xsd:string"/>
      <part name="password" type="xsd:string"/>
      </message>
      <message name="AuthenticationRequestResponse">
      <part name="statusmessage" type="xsd:string"/>
      <part name="errormessage" type="xsd:string"/>
      <part name="session_key" type="xsd:string"/>
      <part name="session_lifetime" type="xsd:string"/>
      </message>


      <portType name="AuthenticationRequest_PortType">
      <operation name="AuthenticationRequest">
      <input message="tns:AuthenticationRequest_msg"/>
      <output message="tns:AuthenticationRequestResponse"/>
      </operation>
      </portType>


      <binding name="PPic_Binding" type="tns:AuthenticationRequest_PortType">
      <soap:binding style="rpc"
      transport="http://schemas.xmlsoap.org/soap/http"/>

      <operation name="AuthenticationRequest">
      <soap:operation
      soapAction="urn:PPic_MS_crap_net_interface#AuthenticationRequest"/>
      <input>
      <soap:body
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      namespace="urn:PPic_MS_crap_net_interface" use="encoded"/>
      </input>
      <output>
      <soap:body
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      namespace="urn:PPic_MS_crap_net_interface" use="encoded"/>
      </output>
      </operation>

      </binding>



      <service name="PPic_MS_crap_net_Service">
      <documentation>PPic MS Crap Net Interface</documentation>
      <port binding="tns:PPic_Binding" name="PPic_MS_crap_net_Port">
      <soap:address
      location="http://xxx/PPic/PPic_MS_crap_net_interface.cgi"/>
      </port>
      </service>


      </definitions>


      The VB code:
      ------------

      Dim Auth_Req As New xxx.PPic_MS_crap_net_Service
      Dim status As String
      Dim errormessage As String = ""
      Dim session_key As String = ""
      Dim session_lifetime As String = ""

      Dim cred As NetworkCredential = New NetworkCredential
      cred.UserName = "test"
      cred.Password = "test"
      Auth_Req.Credentials = cred
      status = Auth_Req.AuthenticationRequest("username",
      "password", errormessage, session_key, session_lifetime)

      MsgBox("Status: " & status & ", ErrorMessage: " & errormessage
      & ", SessionKey: " & session_key)
    Your message has been successfully submitted and would be delivered to recipients shortly.