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

C# client throws XML exception, perl client works (SOAP::Lite perl CGI server)

Expand Messages
  • jakeryder3344
    I m integrating a C# client with a perl cgi soap server. Using perl as the client, I am able to access the web service via WSDL with no problem. Using, C#,
    Message 1 of 1 , Feb 28, 2004
    • 0 Attachment
      I'm integrating a C# client with a perl cgi soap
      server. Using perl as the client, I am able to access
      the web service via WSDL with no problem. Using, C#,
      however, I get this message:

      "System.Xml.XmlException: The data at the root level
      is invalid. Line 1, position 1."

      I'm not sure if this is a problem with my WSDL file or
      not (http://www.simplepics.com/soap/SimplePics.wsdl)

      -------------------------
      The response that I get from my perl client to this
      web service (using +trace) is:
      -------------------------
      <?xml version="1.0"
      encoding="UTF-8"?><SOAP-ENV:Envelope
      xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
      SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
      xmlns:xsd="http://www.w3.org/1999/XMLSchema"><SOAP-
      ENV:Body><namesp1:verifyUserResponse
      xmlns:namesp1="http://www.simplepics.com/SimplePics"><s-gensym3
      xsi:type="xsd:int">1</s-gensym3></namesp1:verifyUserResponse></SOAP-
      ENV:Body></SOAP-ENV:Envelope>

      -------------------------
      perl client code is:
      -------------------------
      #!perl -w
      use SOAP::Lite +trace;
      print SOAP::Lite
      -> uri('http://www.simplepics.com/SimplePics')
      ->
      proxy('http://www.simplepics.com/cgi-bin/soap.cgi')
      -> verifyUser('a','b')
      -> result;

      -------------------------
      CGI server code is:
      -------------------------
      #!/usr/bin/perl -w

      print "content-type: text/xml\n\n";
      use SOAP::Transport::HTTP;


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

      package SimplePics;

      sub verifyUser(){

      my ($username, $password) = @_;

      if($username && $password){
      return (1);
      }else{
      return (0);
      }

      }



      Any help would be appriciated.
    Your message has been successfully submitted and would be delivered to recipients shortly.