I am trying to use a module XML::Compile::WSDL11to create a SOAP message in the base of a wsdl file. In the definitions of xsd there is a parameter called UserArea, which should contain arbitrary fields (extensions):
<xsd:element name="UserArea" type="UserAreaType"/>
<xsd:complexType name="UserAreaType">
<xsd:sequence>
<xsd:any namespace="##any" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
So, I can manually create a valid xml:
<ProcessAssessmentOrder>
...
<DataArea>
...
<AssessmentOrder>
...
<UserArea xmlns:xxx="http://example.com">
<xxx:someURL>http://someurl.example.com</xxx:someURL>
</UserArea>
</AssessmentOrder>
</DataArea>
</ProcessAssessmentOrder>
This works and is being tested. However, trying to use XML::Compile::WSDL11, I got an error:
mistake: tag `xxx:SomeURL' not used at {http:
And the parameter is not in the generated xml.
So far, this is my Perl code:
use strict;
use warnings;
use DateTime;
use XML::Compile::Transport::SOAPHTTP;
use XML::Compile::SOAP11;
use XML::Compile::WSDL11;
my %args = (
releaseID => '3.3',
ApplicationArea => {
CreationDateTime => DateTime->now,
},
DataArea => {
Process => {},
AssessmentOrder => {
UserArea => {
'xxx:SomeURL' => 'www.example.com',
},
},
},
);
my $wsdl_path = '/home/david/HR-XML-3_3/Assessments/org_hr-xml/3_3/WebServices/WSDL/AssessmentOrder.wsdl';
my $wsdl = XML::Compile::WSDL11->new($wsdl_path);
import_definitions($wsdl, '/home/david/HR-XML-3_3/Assessments/');
$wsdl->compileCalls(
port => 'AssessmentOrder_Port',
endpoint => 'http://127.0.0.1/xxx',
);
my($response, $trace) = $wsdl->call('ProcessAssessmentOrder', %args);
sub import_definitions {
my($wsdl, $path) = @_;
opendir (my $dh, $path);
while (my $file = readdir($dh)) {
next if ($file eq '.' || $file eq '..');
if (-d "$path/$file") {
import_definitions($wsdl, "$path/$file");
}
elsif ($file =~ m
$wsdl->importDefinitions("$path/$file");
}
}
closedir($dh);
};
How to make it work to get xml with line
<xxx:someURL>http://someurl.example.com</xxx:someURL>
ยฟยท _ ยท?