Can I get a list of available methods when using SOAP::Lite in Perl? - perl

I found that, after pointing SOAP::Lite at a WSDL file, if I tried calling an incorrectly-named method, I got an error:
Unrecognized method 'foobar'. List of available method(s): aaaaa bbbbb ccccc...
Is there a 'proper' way I can get the library to output a list of available methods created using the WSDL and, ideally, the parameters they accept? It would just be a better initial source of documentation than wading through the WSDL itself..

Related

S3 signature mismatch with Amazon::S3 perl

When I try to generate the request header along with the signature, I'm getting a signature mismatch error.
I used Amazon::S3 Perl module to generate the request. And when analyzed the difference in approach on how the signature is calculated between this module and AWS CLI, I found out that when I comment out the below line from S3.pm inside _make_request() method, makes the signature matches.
$self->_add_auth_header($http_headers, $method, $path)
unless exists $headers->{Authorization};
Am I referring it correctly or is there any other module I can use just for generating the signature alone or at the last option, I can write my own module which inherits the actual module (if possible or mimic the actual module with the custom change).

How do I Call SMSFormatMessageCtl.FormatModuleMessage?

I'm attempting to query the server for particular status messages and build the string format of them. The status message data doesn't contain the translated strings. They appear to be stored in srvmsgs.dll in the install directory for the console.
I see some "documentation" (proof that it exists, not help for using it) about the FormatModuleMessage method of SMSFormatMessageCtl. Sadly, there are no examples that I can find. This guy mentions that he has gotten it to work, but he doesn't provide details. In fact, I cannot even find the DLL referenced (FormatMessageCtl.dll) on my computer. StatView.EXE (the status message viewer app that comes with the client) exists, but running the dependency walker on it doesn't reveal any overt reference the desired .DLL.
Can this be done in VBScript or, preferably, PowerShell? I'm actually using Perl, but this is probably less common and nearly impossible to find meaningful code examples for. A working VBScript or PowerShell example would be a good place to start.
“About Configuration Manager Component Status Messages” has an example, but I think it’s in C# or C++.
Any suggestions on how to accomplish this?
I'm that guy. It's been 2 years, but I think the way I did it was that first I did a regsvr32.exe for the dll to register it, and then I just created an SMSFormatMessageCtl object through COM
For PowerShell that would be
New-Object -COMObject SMSFormatMessageCTL
For Perl, it's been even longer, but if I recall correctly, that would be
Win32::OLE->DispatchEx('SMSFormatMessageCtl');
Once you have the object you can call the FormatModuleMessage method, and don't forget the part about doing a bitwise OR of the Severity and MessageID from the WMI objects.

Understanding WSDL's, SOAP, REST, etc

I'm trying to learn how to use WSDL's to call web services from a Grails project. I've been provided with the WSDL and some XML results for reference.
I've been able to generate Java code from the WSDL, and everything seems to be working correctly.
Here's the WSDL: http://www.restfulwebservices.net/rest/USAZipCodeService.svc?wsdl
And here is the XML: http://api.geonames.org/postalCodeSearch?placename=MN&username=demo
I am receiving this exception in my project:
ERROR client.WebServiceClientFactoryImpl$WSClientInvocationHandler - No namespace on "geonames" element.
javax.xml.ws.soap.SOAPFaultException: No namespace on "geonames" element.
It seems like it is saying that the XML returned isn't valid for SOAP? Am I missing/misunderstanding some pieces the puzzle here? It is all pretty new to me.
Edit:
I am trying to use a Grails plugin called cxf client: https://github.com/ctoestreich/cxf-client
It is configured with the following in Config.groovy (something could be wrong/missing here?):
wsdl = "http://www.restfulwebservices.net/wcf/USAZipCodeService.svc?wsdl"
namespace = "cxf.client.postalcode"
clientInterface = "cxf.client.postalcode.IPostalCodeService"
serviceEndpointAddress = "http://api.geonames.org/postalCodeSearch"
I guess you just sent the XML returned from http://api.geonames.org/postalCodeSearch?placename=MN&username=demo as a parameter to the web service. Obviously, from the WSDL description returned you can see there is no such element named geonames, so the SOAPFaultException exception is quite a fair result.
To fix it, you have to refer to the WSDL description carefully, to make sure the invoke method has the right parameters work with whatever defined in the USAZipCodeService WSDL description tags like <wsdl:operation> and <wsdl:message>.
Another issue: 2 different WSDLs were metioned in your invoker and Config.groovy. The former is a RESTful service, and the later is a SOAP one. They work with different invoke methods and parameters, so make sure your code has consistent invoker and parameters, too.

Cant locate multiple methods from Apache2::RequestRec

I'm getting multiple errors from Apache2::RequestRec apache, here they are:
Can't locate object method "args" via package "Apache2::RequestRec" at /usr/lib/perl5/Apache2/Status.pm line 112.
OR
Can't locate object method "uri" via package "Apache2::RequestRec" at /usr/lib/perl5/ModPerl/RegistryCooker.pm line 123.
I'm using mod_perl this way:
LoadModule perl_module /usr/lib/apache2/modules/mod_perl.so
Any suggestions please?
Does your code do:
use Apache2::RequestRec;
The mod_perl2 API is split into multiple modules. This has the advantage that you can chose to load only the parts you need and save on memory. It has the disadvantage that you have to load all the parts you need :-)
See also ModPerl::MethodLookup

Extracting function call list from DOxygen XML Output

I posted a question on the DOxygen forums and also am posting it here for a better response.
I have a moderately sized C project of about 2,900 functions. I am using DOxygen 1.5.9 and it is successfully generating a call graph for the functions. Is there a way to extract this out for further analysis? A simple paired list would be sufficient, e.g.
Caller,Callee
FunctionX, FunctionY
...
I am comfortable with XSLT but I must say that the DOxygen XML output is complex. Has anyone done this before and can provide some guidance on how to parse the XML files?
Thanks in advance!
Based on what I see in the contrived example that I created,
Parse files with a name similar to ^_(.+)\d+(c|cpp|h|hpp)\.xml$, if my regex-foo is right.
Find all <memberdef kind="function">. It has a unique id attribute. I believe the XPath for this is //memberdef[#kind='function'].
Within that element, find all <references>.
For each of those tags, the refid attribute uniquely refers to the id attribute of the corresponding <memberdef> that is being called.
The text node within each <references> corresponds to the <name> of the corresponding <memberdef> that is being called.
This seems like a nice, straightforward way to express call graphs. You should have no trouble using XSLT or any other sane XML-parsing suite to get the desired results.