I need to add some localclaim's under claims in wso2 using a SOAP request.
I have added the localclaim successfully but needs some fields in soap request
display Name
description
Supported by Default
Required
read only
The Display Name, description, supported by Default, required and read-only attributes need to as claimProperties. Here is the sample SOAP request
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://org.apache.axis2/xsd" xmlns:xsd1="http://dto.mgt.metadata.claim.identity.carbon.wso2.org/xsd">
<soapenv:Header/>
<soapenv:Body>
<xsd:addLocalClaim>
<!--Optional:-->
<xsd:localClaim>
<!--Zero or more repetitions:-->
<xsd1:attributeMappings>
<!--Optional:-->
<xsd1:attributeName>email</xsd1:attributeName>
<!--Optional:-->
<xsd1:userStoreDomain>primary</xsd1:userStoreDomain>
</xsd1:attributeMappings>
<!--Zero or more repetitions:-->
<xsd1:claimProperties>
<!--Optional:-->
<xsd1:propertyName>DisplayName</xsd1:propertyName>
<!--Optional:-->
<xsd1:propertyValue>email2</xsd1:propertyValue>
</xsd1:claimProperties>
<xsd1:claimProperties>
<!--Optional:-->
<xsd1:propertyName>Description</xsd1:propertyName>
<!--Optional:-->
<xsd1:propertyValue>email2 local cliam</xsd1:propertyValue>
</xsd1:claimProperties>
<xsd1:claimProperties>
<!--Optional:-->
<xsd1:propertyName>SupportedByDefault</xsd1:propertyName>
<!--Optional:-->
<xsd1:propertyValue>true</xsd1:propertyValue>
</xsd1:claimProperties>
<xsd1:claimProperties>
<!--Optional:-->
<xsd1:propertyName>Required</xsd1:propertyName>
<!--Optional:-->
<xsd1:propertyValue>true</xsd1:propertyValue>
</xsd1:claimProperties>
<xsd1:claimProperties>
<!--Optional:-->
<xsd1:propertyName>Required</xsd1:propertyName>
<!--Optional:-->
<xsd1:propertyValue>true</xsd1:propertyValue>
</xsd1:claimProperties>
<xsd1:claimProperties>
<!--Optional:-->
<xsd1:propertyName>ReadOnly</xsd1:propertyName>
<!--Optional:-->
<xsd1:propertyValue>true</xsd1:propertyValue>
</xsd1:claimProperties>
<!--Optional:-->
<xsd1:localClaimURI>http://example.org/email</xsd1:localClaimURI>
</xsd:localClaim>
</xsd:addLocalClaim>
</soapenv:Body>
</soapenv:Envelope>
Related
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.
I have to insert the security tag in all the request inside the header. How do I automate? because for every request I have to copy past manually which takes time to do for all the request
Below is the Actual Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ws="http://ws.test.sample.com/" xmlns:ws1="http://ws.test.sample.com/">
<soapenv:Header>
</soapenv:Header>
After adding the security tag:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ws="http://ws.test.sample.com/" xmlns:ws1="http://ws.test.sample.com/">
<soapenv:Header>
<wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://doc.test.xsd">
<wsse:UsernameToken wsu:Id="UsernameToken-1" xmlns:wsu="http://doc.test.xsd">
<wsse:Username>test</wsse:Username>
<wsse:Password Type="http://doc.test.xsd">o9j1/hA/mkFTG0ODti</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header>
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>
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
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)