goma smile Posted July 21, 2015 Report Share Posted July 21, 2015 Sveiki ir soapClients: $soapClient = new SoapClient('https://example/Service.asmx?WSDL',[]); $auth = [ "UserName" => 'demo', "Password" => 'demo' ]; $header = new SoapHeader('http://soapinterop.org/echoheader/', 'SoapHeaderCredentials', $auth, false); $soapClient->__setSoapHeaders($header); Kartē tas laikam izskatās šādi.. <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <SOAP-ENV:Header> <SoapHeaderCredentials> <Password>demo</Password> <UserName>demo</UserName> </SoapHeaderCredentials> </SOAP-ENV:Header> <SOAP-ENV:Body> <AvailRQ> <Services> <Service Id="pcl-departure" OriginPOIType="AIRP" Origin="ALICANTE (ALC)" DestinationPOIType="CITY" Destination="LA MANGA DEL MAR MENOR" DateTime="2013-09-20T10:00:00" Currency="EUR"> <PaxInfo Adults="2" Childs="0" Bags="0"> <Passengers> </Passengers> </PaxInfo> </Service> </Services> </AvailRQ> </SOAP-ENV:Body> </SOAP-ENV:Envelope> Bet man galīgi nesanāk pieslēgties... visu laiku rāda System.Security.SecurityException: Invalid SoapHeaderCredentials at Orca.Transfers.Core.API10.SOAP.AvailService.Avail (Orca.Transfers.Core.API10.AvailRQ.AvailRQ AvailRQ) [0x00000] in :0 at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&) at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] Ko es daru nepareizi... ? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.