Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use BeSimpleBundle with authentification? #85

Open
anacicconi opened this issue Apr 25, 2016 · 0 comments
Open

How to use BeSimpleBundle with authentification? #85

anacicconi opened this issue Apr 25, 2016 · 0 comments

Comments

@anacicconi
Copy link

anacicconi commented Apr 25, 2016

Hello,

I've been trying to connect to a Soap webservice using BeSimpleBundle. This webservice has an Api Key, a username and a password. I'm not able to make it work. Has anybody already used it with authentication?

My goal is to have a Soap Envelope header like this:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.mrted.com/">
   <soapenv:Header>
    <wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
         <wsse:UsernameToken wsu:Id="UsernameToken-1" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
            <wsse:Username>XXXXXX</wsse:Username>
            <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">XXXXX</wsse:Password>
         </wsse:UsernameToken>
      </wsse:Security>
   </soapenv:Header>
   <soapenv:Body>
   </soapenv:Body>
</soapenv:Envelope>

I've already used this bundle with a webservice that does not require authentication and it works well.

Here is my configuration:

be_simple_soap:
    clients:
test:
    wsdl: XXXXX?api_key=XXXXXX

And in my controller:

$soapClientBuilder = $this->get('besimple.soap.client.builder.test');
$soapClientBuilder->withBasicAuthentication('XXXX', 'XXXX');
$soapClient = $soapClientBuilder->build();
$soapClient->testMethod();

I tried many things but the last error I got with this exact configuration is:

Wrong Version 500 Internal Server Error - SoapFault

I even tried to override the version hardcoded on the bundle to see if this was the problem but it isn't.

Obs: I am able to make requests to this webservice using apps like Soap.ui.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant