PHP SOAP Request with Header Authentication -


I'm trying to use the code given below to request a web server's SOAP request: < / P>

  $ client = New SOAP client ('http://my.domain.com/wsdl/GuestService.WSDL', array ('connection_timeout' => 15, 'trace' = & Gt; 1)); $ Ns = 'http://vendor.domain.com/'; $ Headbody = array ('brand' = & gt; 'BRAND1', 'locale' = & gt; 'en_us',' security credential '=> array (' applicationId '= & gt;' ABCDEF ',' token '= & Gt;' 123456789123456789123456789 ')); $ Header = New Soldier ($ ns, 'Header', $ HeaderBody); $ Customer & gt; __setSoapHeaders ($ header); $ Result = $ client- & gt; GetGuest (array ('guestID' = & gt; '000787'));  

However, I'm getting an error that no credentials were given, so I should do something wrong. Error Message: Unkoot Sapfalft Exception: [SOPNVI: NO_CREDENTIALS]

I contacted the seller and they sent me an XML sample how they were expecting to receive the data:

  & lt; Soapenv: envelope xmlns: soapenv = "http://schemas.xmlsoap.org/soap/envelope/" xmlns: prox = "http://vendor.domain.com" xmlns: gues = "http: //vendor.domain .com / guest "& gt; & Lt; Soapenv: header & gt; & Lt; Prox: Brand & gt; BRAND1 & lt; / Prox: Brand & gt; & Lt; Prox: Location & gt; En_us & lt; / Prox: Place & gt; & Lt; Prox: securityCredentials & gt; & Lt; Prox: applicationId> ABCDEF & lt; / Prox: applicationId> & Lt; Prox: Token & gt; 123456789123456789123456789 & lt; / ProX: Token & gt; & Lt; / Proxy: securityCredentials & gt; & Lt; / Soapenv: Header & gt; & Lt; Soapenv: body & gt; & Lt; Gues: getGuest & gt; & Lt; GuestID & gt; 000,787 & lt; / GuestID & gt; & Lt; / Gues: getGuest & gt; & Lt; / Soapenv: Body & gt; & Lt; / Soapenv: envelope & gt;  

I thought I am responsible for all of the above things but maybe I'm seeing something clear. Really appreciate any help!

UPDATE: I have downloaded Sopundi so that I can see what is happening. It is revealed that XML is generating is almost perfect with a small problem .... inside header XML and lt; Item & gt; and & lt; Key & gt; Tagging:

What do I need:

  & lt; Security credentials & gt; & Lt; ApplicationId> ABCDEF & lt; / ApplicationId> & Lt; Token & gt; 123456 & lt; / Token & gt; & Lt; / SecurityCredentials & gt;  

If I could end the tag, then the XML would be correct, I did the research and could not find a specific flag or setting, so what's still stuck on.


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -