WSO2 Identitiy Server Password change, getting issue “Can not access the directory service for user” - soap

I am attempting a password reset feature in wso2 identity server where I'm using LDAP as secondary storage.
I'm using this( https://docs.wso2.com/display/IS530/Configuring+Users#ConfiguringUsers-UpdateuserusingSOAP) link as documentation to update user details by calling https://localhost:9443/services/RemoteUserStoreManagerService?wsdl admin service.
I'm using LDAP as secondary storage. but, when I'm trying to update the password by the updateCredential() method getting the below issue
getting this error response
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:Server</faultcode>
<faultstring>Can not access the directory service for user : yellow#xyz.com</faultstring>
<detail/>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
where I'm sending this request to updateCredential() method
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://service.ws.um.carbon.wso2.org">
<soapenv:Header/>
<soapenv:Body>
<ser:updateCredential>
<!--Optional:-->
<ser:userName>USERS/yellow#xyz.com</ser:userName>
<!--Optional:-->
<ser:newCredential>123456</ser:newCredential>
<!--Optional:-->
<ser:oldCredential>123456789</ser:oldCredential>
</ser:updateCredential>
</soapenv:Body>
</soapenv:Envelope>

Related

Is it correct that a namespace prefix in a soap request be fixed?

When calling a web service, the client is expected to send a specific prefix for a namespace. Otherwise, a fault code is returned.
Here's the request that returns a fault code:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://service.connector.uut.cs.com.tr/">
<soapenv:Header>
<se:Security xmlns:se="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<se:UsernameToken>
<se:Username>XXXX</se:Username>
<se:Password>XXXX</se:Password>
</se:UsernameToken>
</se:Security>
</soapenv:Header>
<soapenv:Body>
<ser:kayitliKullaniciListeleExtended>
<urun>EFATURA</urun>
<gecmisEklensin></gecmisEklensin>
</ser:kayitliKullaniciListeleExtended>
</soapenv:Body>
</soapenv:Envelope>
Whereas this request works:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://service.connector.uut.cs.com.tr/">
<soapenv:Header>
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<wsse:UsernameToken>
<wsse:Username>XXXX</wsse:Username>
<wsse:Password>XXXX</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header>
<soapenv:Body>
<ser:kayitliKullaniciListeleExtended>
<urun>EFATURA</urun>
<gecmisEklensin></gecmisEklensin>
</ser:kayitliKullaniciListeleExtended>
</soapenv:Body>
</soapenv:Envelope>
Only difference between the two requests is the namespace prefix (the one that works is wsse, every other prefix fails). Is it a correct implementation to ask the client to pass a specific prefix for the namespace?
I expected that the prefix names can be anything as long as the uri identified by xmlns: is correct.

Change Namespace URI in Spring SOAP WS

We have some legacy systems that consume the same #Endpoint however each with a different namespace. The payload, implementation and functionality are the same except for the namespace of the SOAPBody's first child element.
How would I replace the namespace of the incoming SOAP request to a generic one before it reaches the Endpoint? Tried playing with the EndpointInterceptor however unable to find a method to replace the namespace.
Legacy System 1:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header/>
<soapenv:Body>
<GetRecordsRequest xmlns="http://www.test.com/system1">
<maxRecords>100</maxRecords>
<GetRecordsRequest>
</soapenv:Body>
</soapenv:Envelope>
Legacy System 2:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header/>
<soapenv:Body>
<GetRecordsRequest xmlns="http://www.abctest.com/system2">
<maxRecords>100</maxRecords>
<GetRecordsRequest>
</soapenv:Body>
</soapenv:Envelope>

Sabre HotelRateDescriptionLLSRQ error ERR.SWS.PROVIDER.REQUEST_HANDLER_ERROR

I am getting error Unexpected request processing error when trying to get rates in sabre soap api. Here is my request xml:
<soapenv:Body>
<ns:HotelRateDescriptionRQ ReturnHostCommand="false" Version="2.3.0">
<ns:AvailRequestSegment>
<!--Optional:-->
<ns:GuestCounts Count="2"/>
<!--Optional:-->
<ns:HotelSearchCriteria>
<ns:Criterion>
<ns:HotelRef HotelCode="46333"/>
</ns:Criterion>
</ns:HotelSearchCriteria>
<!--Optional:-->
<!--Optional:-->
<ns:RatePlanCandidates>
<ns:RatePlanCandidate CurrencyCode="USD"/>
</ns:RatePlanCandidates>
<!--Optional:-->
<ns:TimeSpan End="12-28" Start="12-25"/>
</ns:AvailRequestSegment>
</ns:HotelRateDescriptionRQ>
</soapenv:Body>
But i got error response:
<soap-env:Body>
<HotelRateDescriptionRS xmlns="http://webservices.sabre.com/sabreXML/2011/10" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:stl="http://services.sabre.com/STL/v01" Version="2.3.0">
<stl:ApplicationResults status="NotProcessed">
<stl:Error type="Application" timeStamp="2018-02-15T01:50:26-06:00">
<stl:SystemSpecificResults>
<stl:Message>Unexpected request processing error</stl:Message>
<stl:ShortText>ERR.SWS.PROVIDER.REQUEST_HANDLER_ERROR</stl:ShortText>
</stl:SystemSpecificResults>
</stl:Error>
</stl:ApplicationResults>
</HotelRateDescriptionRS>
</soap-env:Body>
so what am i doing wrong here?
I have fixed this problem, the problem because i use token from service TokenCreateRQ, it should use service SessionCreateRS
Possible Solutions:
1) have you set the ns: arrcordingly ?
xmlns="http://webservices.sabre.com/sabreXML/2011/10"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2) Did you set the service type in the header accordingly?
<eb:Service eb:type="OTA">HotelPropertyDescriptionLLSRQ</eb:Service>
<eb:Action>HotelPropertyDescriptionLLSRQ</eb:Action>
Let me know if this works for you

Missing wsse:Security header in request

I try to add rampart security to my axis 2 project using this tutorial page 19- 22
SO everything seems fine but when I switch to soapUI perspective to try to test the service
the request which I'm proposed is :
soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:axis="http://axis2wstest">
<soapenv:Header/>
<soapenv:Body>
<axis:testws>
<!--Optional:-->
<axis:x>5</axis:x>
</axis:testws>
</soapenv:Body>
</soapenv:Envelope>
and it gives me as a response:
faultstring>Missing wsse:Security header in request</fau
SO I add the security header and my request becomes the same as the one written in the tutorial
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:axis="http://axis2wstest">
<soapenv:Header>
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-
200401-wss-wssecurity-secext-1.0.xsd" soapenv:mustUnderstand="1">
<wsse:UsernameToken xmlns:wsu="http://docs.oasis-
open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="123">
<wsse:Username>test</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-
200401-wss-username-token-profile-1.0#PasswordText">pass</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header>
<soapenv:Body>
<axis:testws>
<!--Optional:-->
<axis:x>5</axis:x>
</axis:testws>
</soapenv:Body>
</soapenv:Envelope>
but the response is the same
soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<soapenv:Fault xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<faultcode>wsse:InvalidSecurity</faultcode>
<faultstring>Missing wsse:Security header in request</faultstring>
<detail/>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
Don't add the security header directly to your request!
Click on Aut at the bottom left. Then you can enter your username/password there.
For more information see: http://www.soapui.org/SOAP-and-WSDL/authenticating-soap-requests.html
As Authorisation type choose Preemptive. (Only in soapUI 4.5.1 as far as I know)

sudzc generates wrong soap request

I tried to use Sudzc to generate my SOAP requests. But the generated requests are wrong.
Below are the Sudzc generated soap request and the working SoapUI request of a very simple example request. Has anybody experienced the same problems?
Sudzc generated soap request:
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns="urn:sap-com:document:sap:soap:functions:mc-style">
<soap:Body>
<urn:ZcaptoSccMatDet>
<IvMatnr>D300</IvMatnr>
</urn:ZcaptoSccMatDet>
</soap:Body>
</soap:Envelope>
Working SoapUI generated message:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:sap com:document:sap:soap:functions:mc-style">
<soapenv:Header/>
<soapenv:Body>
<urn:ZcaptoSccMatDet>
<IvMatnr>D300</IvMatnr>
</urn:ZcaptoSccMatDet>
</soapenv:Body>
</soapenv:Envelope>
Kay,
If you need to change the output to soapenv take a look at the (Sudzc generated) code in Soap.m. In particular, check out the createEnvelope method. You can update the hardcoded references in this method from soap to soapenv.