jhyland87 has asked for the wisdom of the Perl Monks concerning the following question:

Hello, so im pretty new to SOAP in Perl, im trying to call to a smartermail server to add a user, just for testing purposes, heres the code I have so far
#!c:/perl/bin use SOAP::WSDL; use strict; use warnings; my %data = ( 'AuthUserName' => 'xxxxxx@testdomain.com', 'AuthPassword' => 'xxxxxxx', 'NewUsername' => 'johndoe', 'NewPassword' => 'test', 'DomainName' => 'testdomain.com', 'FirstName' => 'john', 'LastName' => 'doe', 'IsDomainAdmin' => 0 ); my $soap = SOAP::WSDL->new( wsdl => 'http://xxxxxxxxxxxxxx.com/services/svcUserAdmin.asmx?WSDL +', ); my $result = $soap->call('AddUser', %data); print $result;
Ive been looking through smartermails PDF doc on automating the web services, I know the PW/UN im using is right, but its still not returning anything at all, or adding the user. http://www.smartertools.com/downloads/documents/smartermail/SmarterMail6x_Automation_with_WebServices.pdf Anyone here use soap::wsdl that can see any obvious errors in my above code? I printed result out with data dumper, this is what it returns..

'detail' => '', 'faultcode' => 'soap:Client', 'faultstring' => 'System.Web.Services.Protocols.SoapException: Se rver was unable to read request. ---> System.InvalidOperationException: There is an error in XML document (1 , 205). ---> System.FormatException: The string \'\' is not a valid Boolean value. at System.Xml.XmlConvert.ToBoolean(String s) at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read21_AddUser() at Microsoft.Xml.Serialization.GeneratedAssembly.ArrayOfObjectSerializer.Deserialize(XmlSerializationRead er reader) at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeser ializationEvents events) --- End of inner exception stack trace --- at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeser ializationEvents events) at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle) at System.Web.Services.Protocols.SoapServerProtocol.ReadParameters() --- End of inner exception stack trace --- at System.Web.Services.Protocols.SoapServerProtocol.ReadParameters() at System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()' }, '{http://schemas.xmlsoap.org/soap/envelope/}Fault',

Replies are listed 'Best First'.
Re: SOAP::WSDL Module
by Anonymous Monk on Mar 31, 2010 at 01:41 UTC
      So you believe its a bug in perl?
        So you believe its a bug in perl?

        No, that would be absurd.

        Your Java-ish error message basically says your SOAP::WSDL program generated something the server couldn't understand.

        You need to turn tracing on, so you can see exactly what your program sends to the server (real XML).

        Then you need to compare the XML sent to see how it differs from what the server expects, so you can figure out what SOAP::WSDL isn't translating (that pdf summary of the WSDL won't help ).