Perl Lite将参数作为类传递
我有下一个模式:Perl Lite将参数作为类传递,perl,soaplite,Perl,Soaplite,我有下一个模式: <xs:schema xmlns:tns="http://common.balance.contract.kernel.bgbilling.bitel.ru/" xmlns:ns1="http://common.bitel.ru" xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0"targetNamespace="http://common.balance.contrac
<xs:schema xmlns:tns="http://common.balance.contract.kernel.bgbilling.bitel.ru/" xmlns:ns1="http://common.bitel.ru" xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0"targetNamespace="http://common.balance.contract.kernel.bgbilling .bitel.ru/">
<xs:import namespace="http://common.bitel.ru" s chemaLocation="http://xxx:8080/bgbilling/executer/ru.bitel.bgbilling.kernel.contract.balance/PaymentService?xsd=1"/>
<xs:element name="BGException" type="tns:BGException"/>
…
<xs:element name="paymentUpdate" type="tns:paymentUpdate"/>
<xs:element name="paymentUpdateResponse" type="tns:paymentUpdateResponse"/>
<xs:complexType name="BGException">
<xs:sequence>
<xs:element name="message" type="xs:string" minOccurs="0"/>
<xs:element name="tag" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="payment">
<xs:complexContent>
<xs:extension base="tns:abstractBalanceBean">
<xs:sequence/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="abstractBalanceBean" abstract="true">
<xs:complexContent>
<xs:extension base="ns1:id">
<xs:sequence>
<xs:element name="comment" type="xs:string" minOccurs="0"/>
</xs:sequence>
<xs:attribute name="contractId" type="xs:int" use="required"/>
<xs:attribute name="date" type="xs:dateTime"/>
<xs:attribute name="sum" type="xs:decimal"/>
<xs:attribute name="summa" type="xs:decimal"/>
<xs:attribute name="timeChange" type="xs:dateTime"/>
<xs:attribute name="typeId" type="xs:int" use="required"/>
<xs:attribute name="userId" type="xs:int" use="required"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="paymentUpdate">
<xs:sequence>
<xs:element name="payment" type="tns:payment" minOccurs="0"/>
<xs:element name="distribution" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
写什么?
如何创建和发送所需类型(paymentUpdate)?使用属性,以下是解决方案:
$wsdl = "http://xxxxxxxxxxxxxx:8080/bgbilling/executer/ru.bitel.bgbilling.kernel.contract.balance/PaymentService?wsdl";
@comment = ("<comment>$comment</comment>");
$authoriz = 'Basic '.encode_base64('login:password');
#$SOAP::Constants::PREFIX_ENV = 'SOAP-ENV';
#$SOAP::Constants::PREFIX_ENC = "SOAP-ENC";
$client = SOAP::Lite->new(service=>$wsdl);
$client->proxy($wsdl);
$client->ns("http://common.balance.contract.kernel.bgbilling.bitel.ru/","ns1");
$client->outputxml('true');
$client->transport->http_request->headers->push_header('Authorization' => $authoriz );
$soap = $client->service($wsdl.'?wsdl');
my $pm = SOAP::Data->new(name=>"payment");
$pm->type("ts:payment");
$pm->attr({ id => "$id", contractId=>"$cid", date=>"$dt", sum=>"$sum", summa=>"$sum", typeId=>"3", userId=>"0"});
$pm->value(@comment);
print $client->call('paymentUpdate',$pm);
$wsdl=”http://xxxxxxxxxxxxxx:8080/bgbilling/executer/ru.bitel.bgbilling.kernel.contract.balance/PaymentService?wsdl";
@注释=(“$comment”);
$authorize='Basic'.encode_base64('login:password');
#$SOAP::Constants::PREFIX_ENV='SOAP-ENV';
#$SOAP::Constants::PREFIX_ENC=“SOAP-ENC”;
$client=SOAP::Lite->new(服务=>$wsdl);
$client->proxy($wsdl);
$client->ns(“http://common.balance.contract.kernel.bgbilling.bitel.ru/“,“ns1”);
$client->outputxml('true');
$client->transport->http\u请求->headers->push\u头('Authorization'=>$Authorization);
$soap=$client->service($wsdl'.?wsdl');
my$pm=SOAP::Data->new(name=>“payment”);
$pm->类型(“ts:付款”);
$pm->attr({id=>“$id”,constractd=>“$cid”,date=>“$dt”,sum=>“$sum”,summa=>“$sum”,typeId=>“3”,userId=>“0”});
$pm->value(@comment);
打印$client->call('paymentUpdate',$pm);
$wsdl = "http://xxxxxxxxxxxxxx:8080/bgbilling/executer/ru.bitel.bgbilling.kernel.contract.balance/PaymentService?wsdl";
@comment = ("<comment>$comment</comment>");
$authoriz = 'Basic '.encode_base64('login:password');
#$SOAP::Constants::PREFIX_ENV = 'SOAP-ENV';
#$SOAP::Constants::PREFIX_ENC = "SOAP-ENC";
$client = SOAP::Lite->new(service=>$wsdl);
$client->proxy($wsdl);
$client->ns("http://common.balance.contract.kernel.bgbilling.bitel.ru/","ns1");
$client->outputxml('true');
$client->transport->http_request->headers->push_header('Authorization' => $authoriz );
$soap = $client->service($wsdl.'?wsdl');
my $pm = SOAP::Data->new(name=>"payment");
$pm->type("ts:payment");
$pm->attr({ id => "$id", contractId=>"$cid", date=>"$dt", sum=>"$sum", summa=>"$sum", typeId=>"3", userId=>"0"});
$pm->value(@comment);
print $client->call('paymentUpdate',$pm);