While Invoking OSM webservice from BPEL, we might get below error if we are not sending the username and password.
successfully due to: javax.xml.soap.SOAPException: javax.xml.soap.SOAPException: Bad response: 401 Unauthorized
we can resolve this error by adding the username,password and security policy to the reference adapter. While we are creating the reference adapter with OSM webservice, by default there will be 2 bindings(OrderManagementWebServiceJMSPort and OrderManagementWebServicePort). But we can ignore the OrderManagementWebServiceJMSPort and add the policy reference only to OrderManagementWebServicePort as shown below in composite.xml.
<reference name="OrderManagementWS"
ui:wsdlLocation="oramds:/{MDSURL}/OrderManagementWS.wsdl">
<interface.wsdl interface="http://xmlns.oracle.com/communications/ordermanagement#wsdl.interface(OrderManagementWSPort)"/>
<binding.ws port="http://xmlns.oracle.com/communications/ordermanagement#wsdl.endpoint(OrderManagementService/OrderManagementWebServicePort)"
location="{OSMURL}"
soapVersion="1.1">
<wsp:PolicyReference URI="oracle/wss_username_token_client_policy"
orawsp:category="security"
orawsp:status="enabled">
</wsp:PolicyReference>
<property name="javax.xml.ws.security.auth.password"
type="xs:string" many="false" override="may">osmpassword123</property>
<property name="javax.xml.ws.security.auth.username"
type="xs:string" many="false" override="may">osm-username</property>
<property name="weblogic.wsee.wsat.transaction.flowOption"
type="xs:string" many="false">WSDLDriven</property>
<property name="weblogic.wsee.wsat.transaction.version"
type="xs:string" many="false">DEFAULT</property>
</binding.ws>
</reference>
successfully due to: javax.xml.soap.SOAPException: javax.xml.soap.SOAPException: Bad response: 401 Unauthorized
we can resolve this error by adding the username,password and security policy to the reference adapter. While we are creating the reference adapter with OSM webservice, by default there will be 2 bindings(OrderManagementWebServiceJMSPort and OrderManagementWebServicePort). But we can ignore the OrderManagementWebServiceJMSPort and add the policy reference only to OrderManagementWebServicePort as shown below in composite.xml.
<reference name="OrderManagementWS"
ui:wsdlLocation="oramds:/{MDSURL}/OrderManagementWS.wsdl">
<interface.wsdl interface="http://xmlns.oracle.com/communications/ordermanagement#wsdl.interface(OrderManagementWSPort)"/>
<binding.ws port="http://xmlns.oracle.com/communications/ordermanagement#wsdl.endpoint(OrderManagementService/OrderManagementWebServicePort)"
location="{OSMURL}"
soapVersion="1.1">
<wsp:PolicyReference URI="oracle/wss_username_token_client_policy"
orawsp:category="security"
orawsp:status="enabled">
</wsp:PolicyReference>
<property name="javax.xml.ws.security.auth.password"
type="xs:string" many="false" override="may">osmpassword123</property>
<property name="javax.xml.ws.security.auth.username"
type="xs:string" many="false" override="may">osm-username</property>
<property name="weblogic.wsee.wsat.transaction.flowOption"
type="xs:string" many="false">WSDLDriven</property>
<property name="weblogic.wsee.wsat.transaction.version"
type="xs:string" many="false">DEFAULT</property>
</binding.ws>
</reference>
ReplyDeleteI am also facing this issue of fetching username and passowrd from csf-key.
In my project flow , we are associating policy oracle/wss_username_token_over_ssl_client_policy.In edit pane of this policy selected override value of csf-key to mwm.key(this key is created in oracle.wsm.security map).
Compiled the project and deployed.But during testing getting Bad response 401 unauthorised error.
I tried applying below properties in composite.xml source file but still same error.Can anyone help on this issue??
WSDLDriven
mwm.key
I am also facing this issue of fetching username and passowrd from csf-key.
ReplyDeleteIn my project flow , we are associating policy oracle/wss_username_token_over_ssl_client_policy.In edit pane of this policy selected override value of csf-key to mwm.key(this key is created in oracle.wsm.security map).
Compiled the project and deployed.But during testing getting Bad response 401 unauthorised error.
I tried applying policyreference and csf-key override property in composite.xml source file but still same error.Can anyone help on this issue??
Try using < wsp:PolicyReference URI="oracle/http_basic_auth_over_ssl_client_policy" orawsp:category="security" orawsp:status="enabled" / >
DeleteIf you still get unauthorized error, add "oracle.webservices.preemptiveBasicAuth=true" as well.
I recently found that instead of having URL in composite.xml, try set the URL in runtime using dynamic partnerlink. I was not getting that error(Bad response 401 unauthorised error) anymore.
ReplyDeletehttps://prabhasoablog.blogspot.com/2018/10/dynamic-partnerlink-in-bpel-soa.html