SOAP::WSDL complexType extension element and xsi:type

D

den

wsdl2perl is a great tool, but I'm not very experienced with it. May
be somebody can help. I want to invoke my service from perl, but faced
troubles with Element types that are extensions to complexType. Trying
to play smart and use sub-classing in my .wsdl description.

arg0 parameter of placeOrder() has basicDocument type. fancyDocument
is its subclass which has one more attribute - fancyAttr and declared
as
<xs:complexType name="fancyDocument">
<xs:complexContent>
<xs:extension base="tns:basicDocument">
<xs:element name="fancyAttr" type="xsd:string"/>


wsdl2perl client code generates with no errors. Simple invocation
works great.
my $por = $service->placeOrder({arg0 => {
document => ELDSTypes::basicDocument->new({
docId => "1"
})
});

### But I need to have subclassing working
my $por = $service->placeOrder({arg0 => {
document => ELDSTypes::fancyDocument->new({
docId => "1",
fancyAttr => "X"
})
});

It doesn't go through because on the wire I get
<basicDocument xmlns="">...
whereas needed
<basicDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="ns1:fancyDocument" >...
The latter was discovered after tcpmon soap body editing.

What is the right way of dealing with extended elements in SOAP::WSDL?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,149
Members
46,695
Latest member
StanleyDri

Latest Threads

Top