Skip Menu |

This queue is for tickets about the XML-Compile-WSS CPAN distribution.

Report information
The Basics
Id: 105343
Status: resolved
Priority: 0/
Queue: XML-Compile-WSS

People
Owner: Nobody in particular
Requestors: mitchell.ianj [...] yahoo.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: tag `Usage' not used at wsse:SecurityTokenReference
Date: Thu, 18 Jun 2015 16:41:40 +0000 (UTC)
To: "bug-XML-Compile-WSS [...] rt.cpan.org" <bug-XML-Compile-WSS [...] rt.cpan.org>
From: Ian Mitchell <mitchell.ianj [...] yahoo.com>
First, thank you for dedicating the time and energy in creating this extensive suite of Perl Modules. They are impressive. I ran across an issue while attempting to sign and timestamp a request using XML::Compile::WSS in a SOAP 1.2 request. The script returns the following error messages: Errors:mistake: tag `Usage' not used at wsse:SecurityTokenReference Use of uninitialized value $ns in hash element at /usr/lib/perl/site_perl/5.10.1/XML/Compile/Translate/Writer.pm line 993. Relevant code:use strict; use XML::Compile qw(initParser); use XML::Compile::WSDL11; use XML::Compile::SOAP12; use XML::Compile::SOAP::WSS; use XML::Compile::SOAP::Trace; use XML::Compile::Transport::SOAPHTTP; use XML::Compile::WSS::SecToken::X509v3; use XML::Compile::WSS::Signature; use Crypt::OpenSSL::X509; my $wss = XML::Compile::SOAP::WSS->new; my $wsdl = XML::Compile::WSDL11->new('myschema.wsdl'); my @features = ($wss->signature(token => XML::Compile::WSS::SecToken::X509v3->new( id => 'username', certificate => Crypt::X509->new_from_file('cert.pem')), private_key => 'private.pem')); my $call = $wsdl->compileClient('myOperation'); my ($answer, $trace) = $call-> (     wsse_Security => \@features,     .... other data .... ); The resulting request does appear to be adding a time stamp and a signature, but the web service on the other end is returning a 415 Unsupported Media Type error that may or may not be related to the errors above. Any ideas?
Subject: Re: [rt.cpan.org #105343] tag `Usage' not used at wsse:SecurityTokenReference
Date: Thu, 18 Jun 2015 18:51:22 +0200
To: Ian Mitchell via RT <bug-XML-Compile-WSS [...] rt.cpan.org>
From: Mark Overmeer <solutions [...] overmeer.net>
* Ian Mitchell via RT (bug-XML-Compile-WSS@rt.cpan.org) [150618 16:42]: Show quoted text
> Thu Jun 18 12:42:13 2015: Request 105343 was acted upon. > Transaction: Ticket created by mitchell.ianj@yahoo.com > Queue: XML-Compile-WSS > > The resulting request does appear to be adding a time stamp and a > signature, but the web service on the other end is returning a 415 > Unsupported Media Type error that may or may not be related to the > errors above.
SOAP11 used media-type 'text/xml', SOAP12 uses 'application/soap+xml' There was a bug in this respect, fixed recently. Do you have the latest releases of XML::Compile::SOAP11 and SOAP12? When you call my ($answer, $trace) = $wsdl->call(...) you can have a look in $trace->printRequest(pretty_print => 1) You can find the media type in the Content-Type HTTP header. -- success, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
Subject: Re: [rt.cpan.org #105343] tag `Usage' not used at wsse:SecurityTokenReference
Date: Thu, 18 Jun 2015 17:20:41 +0000 (UTC)
To: "bug-XML-Compile-WSS [...] rt.cpan.org" <bug-XML-Compile-WSS [...] rt.cpan.org>
From: Ian Mitchell <mitchell.ianj [...] yahoo.com>
I am using the following: XML-Compile-SOAP12-3.03XML-Compile-WSDL11-3.03XML-Compile-1.48XML-Compile-WSS-Signature-2.01 I do not have SOAP11 installed, but do have XML::Compile::SOAP-3.08 installed but not used. The trace is returning "text/xml" as the Content-Type. I can look into adding a hook into the process to override that if there's not an easier way. Thank you. From: Mark Overmeer via RT <bug-XML-Compile-WSS@rt.cpan.org> To: mitchell.ianj@yahoo.com Sent: Thursday, June 18, 2015 12:06 PM Subject: Re: [rt.cpan.org #105343] tag `Usage' not used at wsse:SecurityTokenReference <URL: https://rt.cpan.org/Ticket/Display.html?id=105343 > * Ian Mitchell via RT (bug-XML-Compile-WSS@rt.cpan.org) [150618 16:42]: Show quoted text
> Thu Jun 18 12:42:13 2015: Request 105343 was acted upon. > Transaction: Ticket created by mitchell.ianj@yahoo.com >        Queue: XML-Compile-WSS > > The resulting request does appear to be adding a time stamp and a > signature, but the web service on the other end is returning a 415 > Unsupported Media Type error that may or may not be related to the > errors above.
SOAP11 used media-type 'text/xml', SOAP12 uses 'application/soap+xml' There was a bug in this respect, fixed recently.  Do you have the latest releases of XML::Compile::SOAP11 and SOAP12? When you call   my ($answer, $trace) = $wsdl->call(...) you can have a look in $trace->printRequest(pretty_print => 1) You can find the media type in the Content-Type HTTP header. -- success,               MarkOv ------------------------------------------------------------------------       Mark Overmeer MSc                                MARKOV Solutions       Mark@Overmeer.net                          solutions@overmeer.net http://Mark.Overmeer.net                   http://solutions.overmeer.net
Subject: Re: [rt.cpan.org #105343] tag `Usage' not used at wsse:SecurityTokenReference
Date: Thu, 18 Jun 2015 19:35:51 +0200
To: Ian Mitchell via RT <bug-XML-Compile-WSS [...] rt.cpan.org>
From: Mark Overmeer <solutions [...] overmeer.net>
* Ian Mitchell via RT (bug-XML-Compile-WSS@rt.cpan.org) [150618 17:21]: Show quoted text
> Queue: XML-Compile-WSS > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=105343 > > > I am using the following:
All the latest versions, as far as I can see. Probably there still is something wrong with the patch I made recently. Hum. I do not have a SOAP12 server to test against. I will to and play volleybal in a few minutes, so have no time to investigate it this evening. But if you want to have a go: in lib/XML/Compile/SOAP.pm sub init() , we default $self->{XCS_mime} to the value you need. For some reason, the SOAP11 module gets used. -- success, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
Subject: Re: [rt.cpan.org #105343] tag `Usage' not used at wsse:SecurityTokenReference
Date: Fri, 19 Jun 2015 09:52:39 +0200
To: Ian Mitchell via RT <bug-XML-Compile-WSS [...] rt.cpan.org>
From: Mark Overmeer <solutions [...] overmeer.net>
* Ian Mitchell via RT (bug-XML-Compile-WSS@rt.cpan.org) [150618 16:42]: Show quoted text
> Thu Jun 18 12:42:13 2015: Request 105343 was acted upon. > Transaction: Ticket created by mitchell.ianj@yahoo.com > Queue: XML-Compile-WSS > Subject: tag `Usage' not used at wsse:SecurityTokenReference
Show quoted text
> Errors:mistake: tag `Usage' not used at wsse:SecurityTokenReference
Could you try to change in XML/Compile/WSS/KeyInfo.pm sub _make_sectokref($$$) { my ($self, $wss, $args) = @_; ... sub { my ($doc, $token, $sec, $payload) = @_; - my $ref = $refw->($doc, +{wsu_Id => $refid, Usage => $usage + my $ref = $refw->($doc, +{wsu_Id => $refid, wsse_Usage => $usage , cho_any => $payload}); +{ 'wsse:SecurityTokenReference' => $ref }; Also, when you run your script with "use Log::Report mode => 'DEBUG'", it will show which tags it expects on that location. Please show me. Show quoted text
> Use of uninitialized value $ns in hash element at > /usr/lib/perl/site_perl/5.10.1/XML/Compile/Translate/Writer.pm line 993.
Can you send me your WSDL? (mark@overmeer.net) Show quoted text
> The resulting request does appear to be adding a time stamp and a > signature, but the web service on the other end is returning a 415 > Unsupported Media Type error that may or may not be related to the > errors above.
Have you traced this, as I showed yesterday? -- Regards, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
Subject: Re: [rt.cpan.org #105343] tag `Usage' not used at wsse:SecurityTokenReference
Date: Thu, 24 Dec 2015 19:56:57 +0000 (UTC)
To: "bug-XML-Compile-WSS [...] rt.cpan.org" <bug-XML-Compile-WSS [...] rt.cpan.org>
From: Cheolgoo Kang <appler [...] yahoo.com>
It seems like changing "Usage => $usage" to "wsse_Usage => $usage" did the trick for me. The mistake message doesn't show up anymore. FYI, trace before changing it to wsse_Usage was like this: trace: received 200 OK trace: using preparsed XML document with element <{http://schemas.xmlsoap.org/soap/envelope/}Envelope> trace: using preparsed XML node <{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}Security> trace: rewrote type {http://www.w3.org/2000/09/xmldsig#}Signature to ds_Signature trace: auto-convert known type for 'any': {http://www.w3.org/2000/09/xmldsig#}Signature trace: using preparsed XML node <{http://www.w3.org/2000/09/xmldsig#}Signature> trace: rewrote type {http://www.w3.org/2001/10/xml-exc-c14n#}InclusiveNamespaces to c14n_InclusiveNamespaces trace: auto-convert known type for 'any': {http://www.w3.org/2001/10/xml-exc-c14n#}InclusiveNamespaces trace: using preparsed XML node <{http://www.w3.org/2001/10/xml-exc-c14n#}InclusiveNamespaces> trace: rewrote type {http://www.w3.org/2001/10/xml-exc-c14n#}InclusiveNamespaces to c14n_InclusiveNamespaces trace: auto-convert known type for 'any': {http://www.w3.org/2001/10/xml-exc-c14n#}InclusiveNamespaces trace: using preparsed XML node <{http://www.w3.org/2001/10/xml-exc-c14n#}InclusiveNamespaces> trace: rewrote type {http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}SecurityTokenReference to wsse_SecurityTokenReference trace: auto-convert known type for 'any': {http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}SecurityTokenReference trace: using preparsed XML node <{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}SecurityTokenReference> trace: rewrote type {http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}Reference to wsse_Reference trace: auto-convert known type for 'any': {http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}Reference trace: using preparsed XML node <{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}Reference> trace: rewrote type {http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}BinarySecurityToken to wsse_BinarySecurityToken trace: auto-convert known type for 'any': {http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}BinarySecurityToken trace: using preparsed XML node <{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}BinarySecurityToken> trace: available tags are: cho_any, wsu_Id, wsse_Usage mistake: tag `Usage' not used at wsse:SecurityTokenReference at /code/local/lib/perl5/XML/Compile/Translate/Writer.pm line 532 Cheers!
Fix included in distribution XML::Compile::WSS::Signature release 2.02, over a year ago.