2 Replies Latest reply: Jul 8, 2009 5:14 AM by 843830 RSS

    BPEL to invoke a webservice secured by BASIC auth

    843830
      Hi

      I have been trying to write a simple BPEL process to invoke a remote webservice secured by basic authentication. I was able to build the BPEL process and then the composite application that I deployed successfully to glassfish, all within NetBeans IDE. As per the wiki notes: http://wiki.open-esb.java.net/Wiki.jsp?page=HTTPBasicAuthentication, I also added the Policy element to the wsdl for the service that I am trying to invoke as follows:
      <wsdl:service name="PMSDatabase">
              <wsdl:port name="PMSDatabaseSOAP11port_http" binding="ns2:PMSDatabaseSOAP11Binding">
                  <soap:address location="http://namadgi:9999/MessageCentre/services/PMSDatabase"/>
              </wsdl:port>
              <wsdl:port name="PMSDatabaseSOAP12port_http" binding="ns2:PMSDatabaseSOAP12Binding">
                  <soap12:address location="http://namadgi:9999/MessageCentre/services/PMSDatabase"/>
              </wsdl:port>
              <wsdl:port name="PMSDatabaseHttpport" binding="ns2:PMSDatabaseHttpBinding">
                  <http:address location="http://namadgi:9999/MessageCentre/services/PMSDatabase"/>
                  <wsp:PolicyReference URI="#HttpBasicAuthBindingBindingPolicy"/>
              </wsdl:port>
          </wsdl:service>
          
          <wsp:Policy wsu:Id="HttpBasicAuthBindingBindingRealmPolicy">
              <mysp:MustSupportBasicAuthentication on="true">
                  <mysp:BasicAuthenticationDetail>
                     <mysp:WssTokenCompare/>
                  </mysp:BasicAuthenticationDetail>
              </mysp:MustSupportBasicAuthentication>
              <mysp:UsernameToken mysp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient">
                 <wsp:Policy>
                      <sp:WssUsernameToken10>mcs_user</sp:WssUsernameToken10>
                      <sp:WssPassword>${pass_token}</sp:WssPassword>
                 </wsp:Policy>
            </mysp:UsernameToken>
          </wsp:Policy>
      When i try to run a testcase, the BPEL process fails during the invoke activity and I get the following error in the output:
      <detailText>BPCOR-6135:A fault was not handled in the process scope; Fault Name is {http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/ErrorHandling}systemFault; Fault Data is &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;jbi:message xmlns:sxeh=&quot;http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/ErrorHandling&quot; type=&quot;sxeh:faultMessage&quot; version=&quot;1.0&quot; xmlns:jbi=&quot;http://java.sun.com/xml/ns/jbi/wsdl-11-wrapper&quot;&gt;&lt;jbi:part&gt;HTTPBC-E00753: HTTP POST request failed, portType {http://service.messagecentre.dha.gov.au}PMSDatabaseHttpport
          URL: http://namadgi:9999/MessageCentre/services/PMSDatabase/deletePMSVoidPeriod
          QUERY: 
          PATH_INFO: 
          Exception detail: request requires HTTP authentication: User mcs_user not found in directory.&lt;/jbi:part&gt;&lt;/jbi:message&gt;. Sending errors for the pending requests in the process scope before terminating the process instance
         Caused by: BPCOR-6131:An Error status was received while doing an invoke (partnerLink=PartnerLink1, portType={http://service.messagecentre.dha.gov.au}PMSDatabasePortType, operation=deletePMSVoidPeriod)
      BPCOR-6129:Line Number is 48
      BPCOR-6130:Activity Name is Invoke1
         Caused by: HTTPBC-E00753: HTTP POST request failed, portType {http://service.messagecentre.dha.gov.au}PMSDatabaseHttpport
          URL: http://namadgi:9999/MessageCentre/services/PMSDatabase/deletePMSVoidPeriod
          QUERY: 
          PATH_INFO: 
          Exception detail: request requires HTTP authentication: User mcs_user not found in directory.
         Caused by: request requires HTTP authentication: User mcs_user not found in directory.</detailText>
      Where else do i need to configure the BASIC auth details to get this to work?