[Xml-compile] Error tag `wsu_Id' not processed at {...}BinarySecurityToken

Craig M Talbert craig.talbert at Colorado.EDU
Wed May 28 17:52:05 GMT 2014


Hey all,

I'm trying to use XML::Compile::WSS to create and sign SOAP requests.  I've spent a lot of time go through the test examples and poking around in the perl debugger to try and get the right values everywhere, but it looks like I'm still doing something wrong and I'm really at a loss for what it could be.

I'm getting the error (full output following code below):

error: tag `wsu_Id' not processed at {http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}BinarySecurityToken

I'm able to communicate with the server using SoapUI and have attached it's output to the email as well as the WSDL.

Any ideas?

#!/usr/bin/perl -w

use warnings;
use strict;

use Log::Report mode => 'DEBUG';

use XML::Compile::WSDL11;
use XML::Compile::SOAP11;
use XML::Compile::Transport::SOAPHTTP;
use XML::Compile::SOAP::WSS;
use XML::Compile::WSS::Util qw/:dsig :utp11 :xtp10 :wsm10/;
use XML::Compile::C14N::Util qw/:c14n/;
use XML::Compile::WSS::SecToken::X509v3;
use XML::Compile::WSS::KeyInfo;
use XML::Compile::WSS::SignedInfo;
use XML::Compile::WSS::BasicAuth;
use Crypt::OpenSSL::X509;
use Crypt::OpenSSL::RSA;
use File::Slurp   qw(read_file);
use Data::Dumper;
$Data::Dumper::Indent    = 1;
$Data::Dumper::Quotekeys = 0;

# Local Public Key
my $lcertfn         = '/home/talbert/keytool_crt.pem';
my $lcert             = Crypt::OpenSSL::X509->new_from_file($lcertfn);
my $ltoken         = XML::Compile::WSS::SecToken::X509v3->new
                                                                                (              id          => 'x509cert00',
                                                                                                certificate => $lcert
                                                                                );
# Remote Public Key
my $rcertfn        = '/home/talbert/servicenow.pem';
my $rcert             = Crypt::OpenSSL::X509->new_from_file($rcertfn);
my $rtoken         = XML::Compile::WSS::SecToken::X509v3->new
                                                                                (              id          => 'whatever', #do I need this?
                                                                                                certificate => $lcert
                                                                                );

# Remote Private Key
my $pcertfn  = '/home/talbert/nocryptout.pem';
my $key_text = read_file( $pcertfn );
my $rsa_key = Crypt::OpenSSL::RSA->new_private_key($key_text);
$rsa_key->use_pkcs1_padding();

my $wsdlfn = '/home/talbert/HIPPOIPApp.wsdl';
my $user = 'hippo';
my $password = 'appnootmies';

my %stuff = (     remoteuser => "talbert",
                                hostname => "lukto",
                                resperson => "jo mama",
                                physphone => "303 735 4709"
                );

# strict order of instantiation!
my $wss  = XML::Compile::SOAP::WSS->new; # hooks WSDL parser
my $wsdl = XML::Compile::WSDL11->new($wsdlfn);

my $auth = $wss->basicAuth               # add Security record
  ( username => $user
  , password => $password
  );

my $ki = XML::Compile::WSS::KeyInfo->new
(
    keyinfo => 'KI-1', #does this matter?
                publish_token => 'INCLUDE_BY_REF',
                #publish_token => 'SECTOKREF_URI', #is there a difference?
                sectokref_id => 'STR-2', #does this matter?
                keyid_value => XTP10_X509v3,
                keyid_encoding => WSM10_BASE64,
                keyident_id => 'KIDENT-1', #does this matter?
                sectokref_uri  => '#x509cert00'
);

my $si = XML::Compile::WSS::SignedInfo->new
(
    #c14n => $c14n, #do I need to create my own c14n object?
                canon_method => C14N_EXC_NO_COMM,
                digest_method => DSIG_SHA1,
                #prefix_list => qw/tns SOAP-ENV',
                prefix_list => 'tns SOAP-ENV', #is this the right format?
                wss => $wss
);

my $sig = $wss->signature
(
                key_info => $ki,
                prepare => 'WRITER',
                #remote_token => $rtoken,
                schema => $wsdl,
                signed_info => $si,
                signer =>
                {
                                #put remote_token here?
                                #remote_token => $rtoken,
                                sign_method => DSIG_RSA_SHA1,
                                private_key => $rsa_key
                },
                sign_types => 'SOAP-ENV:Body',
                #signed_type (aka Parts) empty in SoapUI http://www.soapui.org/SOAP-and-WSDL/applying-ws-security.html
                sign_put => 'wsse:SecurityHeaderType', #what to put here?
                sign_when => 'SOAP-ENV:Envelope', #what to put here?
                #BinarySecurityToken
                token => $ltoken
);

# Will include all defined security features
my $call     = $wsdl->compileClient('execute');
my ($answer, $trace) = $call->(%stuff);
#$wsdl->compileCalls; #is this the correct way to call?
#my $answer = $wsdl->call('execute', wsse_Security => $auth, %stuff); #but data here?
# same, because "all" defined is default, $auth is in 'all'
# my $answer = $wsdl->call($operation, %stuff);
# $wsdl->compileCalls;
# my $answer = $wsdl->call('execute', wsse_Security => $auth, %stuff);

print $answer;
print Dumper $answer;

code output
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scsys.co.uk/pipermail/xml-compile/attachments/20140528/752d23c3/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: HIPPOIPApp.wsdl
Type: application/octet-stream
Size: 3577 bytes
Desc: HIPPOIPApp.wsdl
URL: <http://lists.scsys.co.uk/pipermail/xml-compile/attachments/20140528/752d23c3/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: example02.xml
Type: text/xml
Size: 4885 bytes
Desc: example02.xml
URL: <http://lists.scsys.co.uk/pipermail/xml-compile/attachments/20140528/752d23c3/attachment-0001.bin>


More information about the Xml-compile mailing list