[英]Simple SOAP progam
I have to do a simple scritp (unix/linux target) to close log_file of a print spooler program 我必须做一个简单的scritp(unix / linux目标)来关闭打印后台处理程序的log_file
the spooler program give the chances to call the function over soap, but I know nothing of it 后台打印程序程序有机会通过soap调用该函数,但我对此一无所知
this is the function: 这是功能:
- <!-- VPSX System Close Account file Command request
-->
- <message name="VPSX_SystemCloseAcct">
<part name="SessID" type="xsd:string" />
<part name="VPSID" type="xsd:string" />
</message>
- <!-- VPSX System close account file Command request/response
-->
- <operation name="VPSX_SystemCloseAcct">
<input message="lrs:VPSX_SystemCloseAcct" />
<output message="lrs:VPSX_SystemCmdResponse" />
</operation>
<!-- VPSX System close account file Command request/response
-->
- <operation name="VPSX_SystemCloseAcct">
<soap:operation soapAction="" />
- <input>
<soap:body use="encoded" namespace="http://www.lrs.com"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</input>
- <output>
<soap:body use="encoded" namespace="http://www.lrs.com"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</output>
</operation>
is there a simple way (python?php?java?) to do this? 有没有一种简单的方法(python?php?java?)来做到这一点?
I've tryed in perl 我尝试过Perl
#!/usr/bin/perl
use SOAP::Lite;
my $WSDL= 'http://myserver:81/lrs/webconnect/vpsx?trid=vpsx';
my $soap = SOAP::Lite->on_fault(\&SoapFault)
->service($WSDL);
my $logon = $soap->Logon
(
SOAP::Data->type('string')->name('Server')->value("VSVK1"),
SOAP::Data->type('string')->name('UserID')->value("serv"),
SOAP::Data->type('string')->name('Password')->value("serv")
);
$sessionID = $logon->result();
#my $chiusura = $soap->VPSX_SystemCloseAcct
#(
# SOAP::Data->type('string')->name('SessID')->value($sessionID),
# SOAP::Data->type('string')->name('VPSID')->value("")
#);
my $logoff = $soap->Logoff
(
SOAP::Data->type('string')->name('SessID')->value($sessionID)
);
but obtain this error 但是得到这个错误
String value expected instead of SOAP::Data reference
Try this URL
http://www.soapui.org/Test-Automation/integrating-with-junit.html
JUnit Integration
It is fairly easy to invoke the testrunner from your own JUnit-tests;
public void testRunner() throws Exception
{
SoapUITestCaseRunner runner = new SoapUITestCaseRunner();
runner.setProjectFile( "src/dist/sample-soapui-project.xml" );
runner.run();
}
The runner.run() call will throw an exception if an error occurs. If you want more control over your integration / error-reporting, a specific TestCase could be run as follows:
public void testTestCaseRunner() throws Exception
{
WsdlProject project = new WsdlProject( "src/dist/sample-soapui-project.xml" );
TestSuite testSuite = project.getTestSuiteByName( "Test Suite" );
TestCase testCase = testSuite.getTestCaseByName( "Test Conversions" );
// create empty properties and run synchronously
TestRunner runner = testCase.run( new PropertiesMap(), false );
assertEquals( Status.FINISHED, runner.getStatus() );
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.