Note 1362987.1 How to manipulate xml namespace prefix in SOAP Request of Outbound Web Service?

Comments
-
Hi,
The sample code is missing, without that this post is useless.
Please update.
0 -
Hi,
The sample code is missing, without that this post is useless.
Please update.
Hi,
I reviewed the document and the following is included in the Fix section:
To make your solution behave in 8.x similar to 7.7.2 you may consider to use a Web Service filter approach decribed
in the Siebel Bookshelf document: "Integration Platform Technologies: Siebel Enterprise Application Integration" (EAI Volume 2) > chapter: "Web Services" > section: "About Custom SOAP Filter"* * *
Following example of custom WS request filter Business Service method (eScript) could be considered as illustration of the approach to:
1. copy the input property set (which is read-only) hierarchy with outgoing SOAP Request into output property set (can be updated)
2. amend the output property set to replace the implicit name space prefix declaration with explicit.
WARNING: All solution examples provided from Oracle Customer Support are given only for illustration purpose without responsibility for potential production data damage or loss. Therefore we suggest get a short by very efficient assistance of Siebel Experts from either Oracle Advanced Customer Support Oracle CRM Consulting Groups to ensure the most qualified and targeted solution for each certain case.
1. Populate outputs property set by inputs:
//
// Copy source into destination ps container to make basis for a filter operation
//
function xCopy( psSrc : PropertySet, psDst: PropertySet )
{
/*
Copy name-value pairs (attributes):
*/
for( var sN = psSrc.GetFirstProperty(); sN != ""; sN = psSrc.GetNextProperty() )
psDst.SetProperty( sN, psSrc.GetProperty( sN ) );
/*
Copy 1st level child nodes (elements):
*/
for( var ii=0,nn=psSrc.GetChildCount(); ii<nn; ii++ )
psDst.AddChild( psSrc.GetChild( ii ).Copy() );
};
2. Correct data in the Populate outputs property set:
//
// Correct xmlns prefix for a given node (once or for all ones) of given URI
// by turning default name space declaration (w/o xmlns prefix)
// into explicit one (with the given xmlns prefix ).
// Remove the default name space declaration if desired
//
function xChangeNS( psTree: PropertySet, sNode, sURI, sPfx, bOneEntry: Boolean, bRemoveDefault : Boolean )
{
/*
Inputs check
*/
if( sNode == "" || sURI == "" || sPfx == "" ) return (false);
/*
Check the Node
*/
var sT = psTree.GetType();
var sX = psTree.GetFirstProperty();
/*
Node Name and default name space declaration check
*/
if( sT == sNode && sX == "xmlns" ) //...get node name with default ns declaration
{
var sV = psTree.GetProperty( sX ); //...get URI
/*
Name Space Check
*/
if( sV == sURI )//...must match exactly
{
/*
Correct the Node Name
*/
psTree.SetType( sPfx + ":" + sT );
/*
Remove default Name Space declaration (if required)
*/
if( bRemoveDefault ) psTree.RemoveProperty( sX );
/*
Add the explicit Name Space declaration
*/
psTree.SetProperty(sX + ":" + sPfx, sV );
/*
Done for single entry
*/
if( bOneEntry ) return (false);
}; //end-if: Name Space
}; //end-if: Node Name
/*
Continue for all child nodes in the tree
*/
for( var ii=0,nn=psTree.GetChildCount(); ii<nn; ii++ )
if( ! xChangeNS( psTree.GetChild(ii), sNode, sURI, sPfx, bOneEntry, bRemoveDefault ) ) return (false);
/*
Done
*/
return( true );
}
3. Implement the WS-filter method (e.g. "m1Filter"):
//
// WS-filter BS
//
function Service_PreInvokeMethod (MethodName, Inputs, Outputs)
{
var nRC = CancelOperation;
/*
Prepare the Output for Filter
*/
xCopy( Inputs, Outputs);
/*
Apply Filter to Output
*/
switch( MethodName )
{
case "m1Filter": xChangeNS( Outputs, "m1", "http://my.ws,com", "ns", true, false ); break; //apply filter method
default: nRC = ContinueOperation;
};
return ( nRC );
};
Is this the sample code that you're looking for?
If this response was useful, can you mark it as correct or helpful?
0