soap-client

I am consuming a WCF service that requires headers from a .NET 2 website. How can I programmatically add the headers to the messages?

自闭症网瘾萝莉.ら 提交于 2019-12-08 07:02:37
问题 I have a WCF service that uses a custom instance provider (implements IInstanceProvider) for which the GetInstance method expects a message that contains a few headers, like this: public object GetInstance(InstanceContext instanceContext, Message message) { string token = null; if (message != null) { token = message.Headers.GetHeader<string>("Token", "urn:userinfo"); } Bootstrapper bootstrapper = new Bootstrapper(); bootstrapper.InitialiseSession(token); return new MyServiceHost(bootstrapper

PHP Parse Soap Response Issue - SimpleXMLElement

随声附和 提交于 2019-12-08 05:00:33
问题 I'm having problems using PHP SimpleXMLElement and simpleSMLToArray() function to parse a SOAP Response. I'm getting the SOAP response from my SOAP Server just fine. I'm writing both the SOAP Client and Server in this case. I'm using NuSoap for the server. To me, the soap response looks perfect, but the PHP5 Soap Client doesn't seem to parse it. So, as in the past, I'm using SimpleXMLElement and the function simpleXMLToArray() from PHP.NET (http://php.net/manual/en/book.simplexml.php), but

How can I pass in an array as a value into a PHP soapclient request?

[亡魂溺海] 提交于 2019-12-08 02:07:36
问题 How can I pass in an array as a value into a PHP soapclient request? I have a soapclient instantiated and connected already. I then try to make a call to a webservice method that expects 3 parameters (string, string, hashmap). Here is what I expected to work below. But when viewing the xml output, the params node is empty. soapclient->doSomething(array('id' => 'blah', 'page' => 'blah', 'params' => array('email' => 'test@test.com', 'password' => 'password', 'blah' => 'blah'))); The soap body

Why does the order of SOAP parameters matter in PHP SOAP, and how to fix it?

橙三吉。 提交于 2019-12-08 01:07:56
问题 A comment on the PHP manual states: If you are using this method, remember that the array of arguments need to be passed in with the ordering being the same order that the SOAP endpoint expects. e.g //server expects: Foo(string name, int age) //won't work $args = array(32, 'john'); $out = $client->__soapCall('Foo', $args); //will work $args = array('john', 32); $out = $client->__soapCall('Foo', $args); I'm building a SOAP client that dynamically assigns the argument values, which means that

How can I get SoapClient to respect a session?

爱⌒轻易说出口 提交于 2019-12-07 18:12:19
问题 I am working with a SOAP API for an e-commerce shopping cart and I can't seem to be able to get the session to persist through different pages. As an example, I have some test code below (with a bunch of debug messages) which adds an item to the cart and then views the cart. When I run this in my browser it works perfectly, but if I refresh the page, I am expecting there to then be two items in the cart (one from each of the two page calls). However, it doesn't seem to remember anything from

SOAP authentication fails when running a c# app on a linux box

☆樱花仙子☆ 提交于 2019-12-07 17:11:11
问题 I'm trying to connect to a third-party SOAP service via a c# app. The following code works when running the app on a Windows machine: var ws = new MyWebServiceClient(); ws.ClientCredentials.Windows.ClientCredential = new System.Net.NetworkCredential("myusername", "mypassword", "mydomain"); var response = ws.SomeEndpoint(); Element xmlResult = response.Result.SomeEndpoint; ... But if I run the same code from Linux or Mac OS, it fails with: The HTTP request is unauthorized with client

soapclient Parsing Schema: can't import schema from

妖精的绣舞 提交于 2019-12-07 15:57:06
问题 Example Script : try { $client = new SoapClient("http://webservices.sabre.com/wsdl/sabreXML1.0.00/GHT/HotelDirectUpdate.wsdl", array("trace" => 0)); } catch (Exception $ex) { var_dump($ex->faultcode, $ex->faultstring, $ex->faultactor, $ex->detail, $ex->_name, $ex->headerfault); } Output : string(4) "WSDL" string(216) "SOAP-ERROR: Parsing Schema: can't import schema from 'http://webservices.sabre.com/wsdl/sabreXML1.0.00/GHT/HotelDirectUpdateRQ.xsd', unexpected 'targetNamespace'='http:/

PHP Parse Soap Response Issue - SimpleXMLElement

大兔子大兔子 提交于 2019-12-06 15:49:34
I'm having problems using PHP SimpleXMLElement and simpleSMLToArray() function to parse a SOAP Response. I'm getting the SOAP response from my SOAP Server just fine. I'm writing both the SOAP Client and Server in this case. I'm using NuSoap for the server. To me, the soap response looks perfect, but the PHP5 Soap Client doesn't seem to parse it. So, as in the past, I'm using SimpleXMLElement and the function simpleXMLToArray() from PHP.NET ( http://php.net/manual/en/book.simplexml.php ), but can't seem to get an array. <SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap

SOAP call works in SoapUI but fails in PHP using soapclient - Object reference issue

有些话、适合烂在心里 提交于 2019-12-06 12:27:51
问题 Trying to query a .NET webservice hosted on an IIS server using PHP 5.x $wsdl_path = "http://192.168.1.1/TestSite/TestService.asmx?wsdl"; $soapClient = new SoapClient($wsdl_path, array('trace' => 1)); $dump=var_export($soapClient->__getFunctions(), true); echo htmlentities($dump); produces array ( 0 => 'ProcessTransactionResponse ProcessTransaction(ProcessTransaction $parameters)', 1 => 'ProcessTransactionResponse ProcessTransaction(ProcessTransaction $parameters)', ) which would indicate it

How do I add additional attributes to XML Elements with the SoapClient Class in PHP

时间秒杀一切 提交于 2019-12-06 12:25:25
I cannot work out how to add additional attributes to an xml doc using php. To request a report from the Bing Ads Api I need to pass the information with SOAP. I don't have any SOAP experience so I am working through Ewan Hemmings Example here - http://www.ewanheming.com/bing-ads-api-campaign-download . I need to make some subtle changes that will pass the LastSyncTimeInUTC as Null. I have looked at simpleXML extension but I would prefer to continue using the SoapClient Class used in the Bing Documentation. I have been messing around with \SoapVar - http://www.php.net/manual/en/soapvar.soapvar