[Xml-compile] What to do when the WSDL namespaces are wrong
Kit Peters
Kit.Peters at broadbean.com
Fri Apr 1 15:57:43 GMT 2016
I misspoke earlier - it was only "ns2011_05” I had to change, not “tns”.
I tried your suggestion (see attached sketch):
my $wsdl = XML::Compile::WSDL11->new(
$wsdlfn,
prefixes => {
ns2011_05 => 'http://www.taleo.com/ws/integration/toolkit/2005/07'
}
);
I got the following XML (note the change from “ns2011_05” to “ns2011_050":
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header>
<wsa:MessageID xmlns:wsa="http://www.w3.org/2005/03/addressing">Export-Test-0000</wsa:MessageID>
<wsa:ReplyTo xmlns:wsa="http://www.w3.org/2005/03/addressing">
<wsa:Address>http://www.taleo.com/ws/integration/toolkit/2005/07/addressing/queue</wsa:Address>
</wsa:ReplyTo>
<wsa:Action xmlns:wsa="http://www.w3.org/2005/03/addressing">http://www.taleo.com/ws/integration/toolkit/2005/07/action/export</wsa:Action>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<tns:submitDocument xmlns:ns2011_050="http://www.taleo.com/ws/integration/toolkit/2011/05" xmlns:tns="http://www.taleo.com/ws/integration/toolkit/2011/05/management" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ns2011_050:Document>
<ns2011_050:Attributes>
<ns2011_050:Attribute name="locale">en</ns2011_050:Attribute>
<ns2011_050:Attribute name="version">http://www.taleo.com/ws/tee800/2009/01</ns2011_050:Attribute>
<ns2011_050:Attribute name="mode">T-XML</ns2011_050:Attribute>
<ns2011_050:Attribute name="largegraph">true</ns2011_050:Attribute>
</ns2011_050:Attributes>
<Content xmlns="http://www.taleo.com/ws/integration/toolkit/2005/07">
<ExportQuery>
<query xmlns="http://www.taleo.com/ws/integration/query" projectedClass="Candidate" alias="Query-Candidate-2F52C01E-E25D-11E5-B311-DF6053E18CB9" preventDuplicates="false">
<projections>
<projection>
<field path="FirstName"/>
</projection>
<projection>
<field path="LastName"/>
</projection>
<projection>
<field path="EmailAddress"/>
</projection>
<projection>
<field path="Number"/>
</projection>
</projections>
<filterings>
<filtering>
<equal>
<field path="Number"/>
<integer>28423</integer>
</equal>
</filtering>
</filterings>
</query>
</ExportQuery>
</Content>
</ns2011_050:Document>
</tns:submitDocument>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Kit Peters
Doer of Things, ATS Integrations
D: 8162000279 M: 8162000279
On 3/31/16, 23:58, "Mark Overmeer" <solutions at overmeer.net> wrote:
>* Kit Peters (Kit.Peters at broadbean.com) [160331 22:27]:
>> However, when I change the namespaces with prefix “ns2011_05” and
>> “tns”, the server accepts the request. At present, I’m modifying
>> the namespaces in the transport_hook, but is there a better / more
>> elegant way to handle this?
>
>This sometimes happens: when the implementors of the server do
>not understand namespaces.
>
>You can do this:
>
> my $wsdl = XML::Compile::WSDL11->new($wsdlfn,
> prefixes => { tns => $somens, ... } );
>
>You must set your prefix preference before you read the XSD or WSDL.
>addPrefixes() is too late.
>--
>success,
> MarkOv
>
>------------------------------------------------------------------------
> Mark Overmeer MSc MARKOV Solutions
> Mark at Overmeer.net solutions at overmeer.net
>http://Mark.Overmeer.net http://solutions.overmeer.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: submit_document_wsdl2.pl
Type: text/x-perl-script
Size: 3998 bytes
Desc: submit_document_wsdl2.pl
URL: <http://lists.scsys.co.uk/pipermail/xml-compile/attachments/20160401/ee45d6be/attachment.bin>
More information about the Xml-compile
mailing list