Michael

Can I please ask you to do us a favour?

Can you raise a JIRA for an enhancement and then attach this code to
the JIRA entry? That is the formal way for a non-committer to
contribute code to an Apache project.

Thanks very much - and nice work! Got any other mediators you need?

Paul

On 1/7/07, Michael Buchholz <[EMAIL PROTECTED]> wrote:
Hi,

thanks again for your help, Paul. I´m done writing the mediator and
attached it with an example synapse.xml.

The dev-team (and everyone else) may use this code, change package
name... feel free to do whatever you like with this :)

The class must be used in a <try> tag. Here´s a snippet from the
attached synapse.xml:

[--- snip ---]
     <sequence name="authProxySeq">
       <try>
         <sequence>
           <class name="de.subnatural.synapse.BasicAuthenticationMediator">
             <property name="reqUsername" value="foo"/>
             <property name="reqPassword" value="bar"/>
           </class>
         </sequence>
         <onError>
           <makefault>
             <code value="tns:Receiver"
xmlns:tns="http://www.w3.org/2003/05/soap-envelope"/>
             <reason value="Authorization failed!"/>
           </makefault>
           <send/>
         </onError>
       </try>
       <send>
         <endpoint
address="http://localhost:9000/axis2/services/SimpleStockQuoteService"/>
       </send>
     </sequence>
[--- snap ---]

It´s based on one of the proxy examples.

Michael


Paul Fremantle schrieb:
> Michael
>
> That is kind of tricky :-)
>
> I was expecting that you would have programmed your service client to
> send user-auth headers. It is possible to force Axis2 to ask for user
> auth but its not easy. But that is usually a trick you need to play
> with browsers/human clients. For service clients there it is usually
> programmed. For example with Axis2 its very easy to get it to pass
> HTTP uid/pw.
>
> As for the property, I made a mistake. You need to do this:
>
> org.apache.axis2.context.MessageContext mc =
> ((Axis2MessageContext)msgCtx).getAxis2MessageContext();
>
> and then look in there.
>
> Paul


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Paul Fremantle
VP/Technology, WSO2 and OASIS WS-RX TC Co-chair

http://bloglines.com/blog/paulfremantle
[EMAIL PROTECTED]

"Oxygenating the Web Service Platform", www.wso2.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to