Authenticating SOAP based webservices

Authenticating SOAP based webservices

  
Hi All,

I have consumed an external webservice in outsystems.I need to pass credentials to webservice and I have used an an action:"SetWebReferenceCredencials" of externsion "EnhancedWebReferences" and called a web method of this serviceervice method.But I am recieving authentication error:"Invalid Usernem or password".I have tested this service in SOAP UI and I was able to get the xml response successfully.

But when calling the service from SOAP UI i am setting an extra parameter "Wss-Password type" as seen in attachment .

So I want to know how to set the value to parameter "Password type"  in outsystems when using "EnhancedWebReferences" extension.I dont see any methods of this extension has this paramter.

Thanks,
Prashanth 


prashanth charl wrote:
Hi All,

I have consumed an external webservice in outsystems.I need to pass credentials to webservice and I have used an an action:"SetWebReferenceCredencials" of externsion "EnhancedWebReferences" and called a web method of this serviceervice method.But I am recieving authentication error:"Invalid Usernem or password".I have tested this service in SOAP UI and I was able to get the xml response successfully.

But when calling the service from SOAP UI i am setting an extra parameter "Wss-Password type" as seen in attachment .

So I want to know how to set the value to parameter "Password type"  in outsystems when using "EnhancedWebReferences" extension.I dont see any methods of this extension has this paramter.

Thanks,
Prashanth 

 
 Hello,

Does any one have idea on above post?

Thanks,
Prashanth
 
Hi Pashanth,

Have you tried to use the SetWebServiceSoapHeaders action from the same extension?

Cheers
André Vieira wrote:
Hi Pashanth,

Have you tried to use the SetWebServiceSoapHeaders action from the same extension?

Cheers
 Hi,

I tried to call SetWebServiceSoapHeaders  by setting its input paramter value with SOAP header information as you can find in attachment.But I am receving error as:"Invalid Username or password." But credentials  are valid since I was able to get the reponse from service using SOAP UI.

Am I doing in right way  in setting the header information to this method or anything wrong from attachment.

Thanks,
Prashanth

 
I think we're almost there. The action receives a record list of SOAPHeader structures. So you need the assign to fill in the Element attribute but you'll need a local variable of data type Record of SOAPHeader, use it in the assign and the ListAppend it to another variable, in this case record list of SOAPHeader. This last one is the one you use as input for the action.
André Vieira wrote:
I think we're almost there. The action receives a record list of SOAPHeader structures. So you need the assign to fill in the Element attribute but you'll need a local variable of data type Record of SOAPHeader, use it in the assign and the ListAppend it to another variable, in this case record list of SOAPHeader. This last one is the one you use as input for the action.
 Hi Andre,

Thanks for the response.I did the same way as you said by using ListAppend action. For this action I have set  RecordList as:SOAPHeaders(reclist) and Record as:SOAPHeaderRecord(record).After that I was calling the web method and again I recieve authentication error:Invalid username or password.

I am getting same authentication error using SOAP UI if I do not pass PasswordType(value:PasswordText).But if I pass this password type ,then I was able to see the xml resposne.Any furthur help on this issue.

Thanks,
Prashanth





Thanks,
Prashanth 
 
Hi All,

How to set WSS-PasswordType(PasswordText or PassowrdDigest) if we use the extension:EnhancedWebReferences while consuming webservices?.

SOAP UI has this property which can be set while consuming a webservices

Thanks,
Prashanth Reddy
Hi All,

Is there way to set the property "PasswordType" in extension EnhacedWebReferences?

Thanks,
Prashanth
Hi,

Anyone has idea on how to set this paramter?

Thanks,
Prashanth

Hi Prashanth,

Have you tried importing the webservice via Integration Studio? This topic might be helpful for that.
Is this web service public avaible so that other people can try to connect to it and help you?

Cheers
André Vieira wrote:
Hi Prashanth,

Have you tried importing the webservice via Integration Studio? This topic might be helpful for that.
Is this web service public avaible so that other people can try to connect to it and help you?

Cheers
 Hi Andre,

I have tried to import the webservice as .net assembly via integration studio.But when I tried to call one of its methods then again I see same authentication error."INvalid username or password."

Before calling web method I used "SetWebReferenceCredencials" of externsion "EnhancedWebReferences" to set the credentials for webservices.

The webservice is not public and others cannot connect to it.But I would like to know what are the necessary steps to consume webservice using the extension:"EnhancedWebReferences".

Here are the steps I am following to consume the webservice.

1.Add refernce to webservice(wsdl).After adding reference I was able to see all the required structures generated automatically by platform.

2.Use "SetWebReferenceCredencials" action to set credentials.

3.Assign required input parameters to web method and call the web method.

Please let me know whether I am doing right.

As I said earlier,I dont see any issues when i tried to consume through SOAP UI tool provided when I set the input request paramater:Wss-Password type(value:PasswordText) and if i dont set this parameter I see the authentication error similar to outsystem error.


Thanks,
Prashanth



 
 
Hi Prashanth,

I'm sorry I guess I wasn't clear. Using the SetWebReferenceCredentials won't work in this case since the credentials are sent on the header.

My suggestion is as follows. Try to use the SetWebReferenceSOAPHeaders as before, using the variables and the listAppend. On the assign try not to include the <soapenv:header> in the header value. If you can use fiddle on the server machine to determine the whole soap envelope content and compare it with SOAP UI.

Without having access to the webservice it is hard to be more helpful :(

I hope you get this working...
 submit.txt
Hello,
I'm getting a error when posting data to the third party .Please find my error below

<Result xmlns=""><MajorType>Failure</MajorType><MinorType>NoDataProvided</MinorType><ResultMessage>authentication failure</ResultMessage><Errors><Error>CustomerInfoHeader SOAP header is missing</Error></Errors></Result>.

Can anyone suggest what i have to do .I have attached my request file for your reference.
Hi,

Is that attachment your current request or an example of what you need to send?

Also, please don't reply to old topics that are unrelated with your problem. Next time just start a single new topic.

Regards,
João Rosado
Hi,
No this is the current request which i have send.

Regards,
ChandrasekarRadhakrishnan
Can you get an example of how a correct one should look?
It's impossible to help without knowing what the service is expecting.

Regards,
João Rosado
Hi,

I'm using SOAP SERVICE if i post this xml i should get an output like this 

<Result>
<MajorType>Success</MajorType>
<MinorType>Complete</MinorType>
<ResultMessage></ResultMessage>
<EncryptedURL></EncryptedURL>
<TransactionIdentifiers>
<!-- .. .. .. -->
</TransactionIdentifiers>
<TransactionData>
<!-- .. .. .. -->
</TransactionData>
<Warnings>
<!-- .. .. .. -->
</Warnings>
<Errors>
<!-- .. .. .. -->
</Errors>
</Result>

Regards,
ChandrasekarRadhakrishnan

Ok, so if you post that using a tool like SoapUI it replies correctly?

What did you already try to do in your eSpace to make it work?

Regards,
João Rosado
Hi,
I have atttach my OML file.If you see i would have used submit action which i imported 
through third party website using SOAP.

Regards,
ChandrasekarRadhakrishnan
See if this works,

To send a Header in a web refence you need to call the SetWebReferenceSoapHeaders with the header you need. The first parameter that method is the name of the web reference, so this case "LoanServices".

I created on your espace on a action called SetLocalServicesAuthentication so you can reuse it before every call on the service.

Regards,
João Rosado
Also not sure what you were trying to do with REST API that you created (the ServicesOptimalblue) ...that is just wrong, I sugest you to delete it and don't try to use REST to call a SOAP service.
Hi,
But still i'm getting the same error if u publish that file click optimal blue.
<Result xmlns=""><MajorType>Failure</MajorType><MinorType>NoDataProvided</MinorType><ResultMessage>authentication failure</ResultMessage></Result>.

Regards,
ChandrasekarRadhakrishnan
Hi,
<Result xmlns=""><MajorType>Failure</MajorType><MinorType>NoDataProvided</MinorType><ResultMessage>authentication failure</ResultMessage></Result>

Still this is what i'm getting.By the By inside the Setwebreferencesoapheaders what expression
you would give for SoapHeaders.

Regards,
ChandrasekarRadhakrishnan
Actually it works a bit better now.

Before the response was like this:

            <Result xmlns="">
               <MajorType>Failure</MajorType>
               <MinorType>NoDataProvided</MinorType>
               <ResultMessage>authentication failure</ResultMessage>
               <Errors>
                  <Error>CustomerInfoHeader SOAP header is missing</Error>
               </Errors>
            </Result>


Now it's:
            <Result xmlns="">
               <MajorType>Failure</MajorType>
               <MinorType>NoDataProvided</MinorType>
               <ResultMessage>authentication failure</ResultMessage>
            </Result>

So as you can see the "CustomerInfoHeader SOAP header is missing" message disappeared and my code is working.

Now you need to figure out what is missing in your request.
I tested calling it directly in SoapUI and it gives the same error, so it's missing something on your example that is causing that error.


Also replying to the "By the By inside the Setwebreferencesoapheaders what expression
you would give for SoapHeaders." question:
Check the action that I created in your eSpace, it is already calling it with the header value that you posted here.




Regards,
João Rosado
Hi,
This is the login details i have and this is the request parameter.I need to get a response from the optimal blue server.Can you suggest me what might be the error.

Regards,
ChandrasekarRadhakrishnan
Hi,
Might be the login details they have given it might be wrong.But anyhow joao thanks 
for the help it was very helpfull.

Regards,
ChandrasekarRadhakrishnan
No idea, you may need to ask the provider of the web service for more support.
They should be able to tell you want is wrong.
Hi Joao,
Good Morning.
Hope u remember me speaking about the web service issue.
This is the issue 
url:"https://services.optimalblue.com/loanservices/loanservices.asmx?version=allwesternmortgage.v1"
I need to post my data to these url .I tried using soap ui and it works.In OS i'm using setwebreferenceurl to post this url at run time.Cn u plz look at this.
I have attached my OML for your reference.
Regards,
ChandrasekarRadhakrishnan
Hi Everybody,

has anyone succedeed on setting a soapheader with PasswordDigest?
I'm trying to call a webservice by setting the "SetWebReferenceSoapHeaders" soapheader like this:
....
 <wsse:Password Type=""http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest"">" + Password + "</wsse:Password>
....
where the password is a variable, eg site property

cheers,

Frank