Four Js Development Tools Forum

Discussions by product => Genero BDL => Topic started by: Jos? V. on January 29, 2020, 06:39:04 pm



Title: fglwsdl client stub for policy
Post by: Jos? V. on January 29, 2020, 06:39:04 pm
Hi everyone,
I'm currently using fglwsdl to generate the client stubs for a Soap WS that declares a security policy using wsp:Policy.

But the produced code makes no mention of globals that represent the possible headers so that I can fulfill my request.
The WSDL declares the following:
Quote
<wsp:Policy wsp:Description="GEOS Security"
             wsu:Id="geos_business_level_server_policy"
             xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
             xmlns="http://schemas.xmlsoap.org/ws/2004/09/policy"
             xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xmlns:pol="http://schemas.xmlsoap.org/ws/2004/09/policy">
  <wsp:ExactlyOne>
   <wsp:All/>
   <wsp:All>
    <sp:SupportingTokens xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
     <wsp:Policy>
      <sp:UsernameToken sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient">
       <wsp:Policy>
        <sp:WssUsernameToken10/>
       </wsp:Policy>
      </sp:UsernameToken>
     </wsp:Policy>
    </sp:SupportingTokens>
   </wsp:All>
   <wsp:All>
    <orasp:GEOSAnonymousAuthentication xmlns:orasp="http://schemas.oracle.com/ws/2006/01/securitypolicy"/>
   </wsp:All>
  </wsp:ExactlyOne>
 </wsp:Policy>

Since UsernameToken is requested, the soapheader for a request should send a wsse:Security inside.
But the client stub makes no mention of any way to do this other than editing the _g function and manually adding the apropriate xml.Serializer.VariableToStax calls.

It this the only way to go, or am I missing any fglwsdl parameter that allows me to leave the client stub alone?

Thank you!


Title: Re: fglwsdl client stub for policy
Post by: Sisavanh S. on January 30, 2020, 05:29:35 pm
Hi,

May I let your review this page:
https://4js.com/online_documentation/fjs-fgl-manual-html/#fgl-topics/c_gws_ssl_security_how_to_001.html

If you need more explanations, please see with your local support center.

Best regards,
Sisa.


Title: Re: fglwsdl client stub for policy
Post by: Reuben B. on January 30, 2020, 11:33:24 pm
Read Sisa's link so that you get a good overall view. 

I think by tone of your question, the answer you were looking for is the -domHandler argument which generates a call to a callback function.  This function is the place where  you can alter the XML and not have to modify any generated code like you fear.  In case you don't find it from Sisa's link, see here   https://4js.com/online_documentation/fjs-fgl-manual-html/#fgl-topics/c_gws_handlers_client_006.html


Title: Re: fglwsdl client stub for policy
Post by: Jos? V. on February 04, 2020, 06:19:06 pm
This was exactly what I needed.
I went over my head as I read the manual the first time. Terribly sorry!
Thank you Reuben and Sisavanh!