0

I'm using eclipse bpel designer and trying to invoke a external service which requires authentication headers to be passed.

Here is what I have done
1. Created a headers.endpoint file with the following content

*alias.sample_ns="http://sample.com"  
sample_ns.serviceName.portName.ode.http.default-headers.username=system
sample_ns.serviceName.portName.ode.http.default-headers.password=admin*
  1. Placed it in ..\webapps\ode\WEB-INF\processes\$process folder

When I invoke the service I'm getting the following error
"Error sending message (mex={PartnerRoleMex#hqejbhcnphrckf492s9n9b [PID {http://createReservation}CreateReservation-1541] calling org.apache.ode.bpel.epr.WSAEndpoint@1e1f4b8.saveRecord(...) Status ASYNC}): Transport error: 401 Error: Unautho".

I think I need to add header information when invoking the service in BPEL process as well. But couldn't find the way to do it. How can it be done, if this is actually what I'm missing? Or is there something else to be done?

Thanks in advance

Arun
  • 1
  • 1

1 Answers1

0

Note: HTTP Auth information cannot be set in the *.endpoint files.

For invoking HTTP Service

Testcase will show you how to do it
https://github.com/apache/ode/tree/ode-1.3.x/axis2-war/src/test/resources/TestEndpointProperties

Add message part in WSDL as shown here
https://github.com/apache/ode/blob/ode-1.3.x/axis2-war/src/test/resources/TestEndpointProperties/Echo.wsdl#L66

Assign credentials in Process
https://github.com/apache/ode/blob/ode-1.3.x/axis2-war/src/test/resources/TestEndpointProperties/test-endpoint-properties.bpel#L73

For invoking Soap Service

http://ode.apache.org/http-authentication.html

Sathwik
  • 193
  • 8
  • I'm using third party wsdl which requires authentication and modifying the wsdl is not an option. – Arun Aug 31 '17 at 10:05
  • Adding an additional dummy Message Part to the input message which doesn't get mapped to soap body or the soap header is not going to affect the WSDL whether its internal/external WSDL document. But if you are reluctant to take that path then you can raise a [JIRA](https://issues.apache.org/jira/secure/RapidBoard.jspa?rapidView=7&projectKey=ODE) for it. – Sathwik Sep 01 '17 at 05:31
  • I tried adding dummy Message part to input message, but still the problem persists, any other solution? – Arun Sep 11 '17 at 05:58
  • Update your questions with these details 1. ODE version? 2. Which server ODE is deployed? 3. HTTP Service/ Soap Service? 4. Need to see your changes done to the WSDL and bpel – Sathwik Sep 11 '17 at 07:24
  • I have updated my answer with a Note. With one line information its not possible to analyse the problem. We need to see the complete stacktrace and changes that you have done to WSDL & BPEL in order to correct any misconfiguration. I urge you to approach the ODE User mailing list with all the details and will be able to analyse and help you there. Stackoverflow is not the forum for that. – Sathwik Sep 11 '17 at 12:27
  • Thanks Sathwik, I'll share the details on the ODE user mailing list. Also, I found a possible solution for my problem here http://ode.apache.org/assign.html#variable-extension-variant-non-standard-extension. But I'm not able to assign header value to request variable extension. Will appreciate if someone can share the example of how it is done. – Arun Sep 11 '17 at 13:30
  • Hi Sathwik, I have posted on ODe user mailing list. Please find the required details here "http://markmail.org/message/irtwrnoflj27jqyn – Arun Sep 12 '17 at 09:10