I'm having a problem getting a particular SOAP call to work -most of them work fine, but this one is giving me a headache.
The WSDL is http://fibre.venus.ispwebhost.com/FibreClassTest/colt.wsdl, and the request I am generating is:
$result = $soap->checkConnectivity(
array('checkConnectivityRequest' =>
array(
'requestType' => 'SITE',
'requestMode' => array(
'requestId' => date("Ymdhis"),
'siteAddress' => array(
'postalZipCode' => $this->postcode,
'connectivityType' => 'COLT FIBRE',
'bandwidth' => '2M',
),
)
)
)
);
However I'm getting a SOAP error back (which I believe means it's not even passing it to the web service), so not sure if I'm mis-reading the WSDL?
Thanks!
If you search in the content of http://fibre.venus.ispwebhost.com/FibreClassTest/colt.wsdl you will notice that there is not wsdl:operation named checkConnectivityRequest. The closest i saw was checkConnectivity so, try to replace checkConnectivityRequest with checkConnectivity and let me know.
Happy coding
Related
We began seeing these DocuSign exceptions 09/24/2019:
DocuSign \ eSign \ ApiException (401)
[401] Error connecting to the API (https://NA3.docusign.net/restapi/v2/login_information)
None of the code surrounding our DocuSign logic has been touched for almost six months. So I'm at a loss as to why this exception is being thrown.
We're using the following packages (relating to this):
laravel/framework v5.8.35
docusign/esign-client 3.0.1
tucker-eric/docusign-rest-client 1.0.0
tucker-eric/laravel-docusign 0.1.1
I've tried to update the packages with composer thinking they might have made updates to fix something, but it didn't change anything other than throw USER_AUTHENTICATION_FAILED instead of the exceptions' message above.
As I said, no code has been touched, and I have very little experience with the DocuSign API, and making matters worse this was an old developer's code...
I am able to hit the endpoint, and authenticate with our credentials, using Postman and it seems to work fine. So again, I'm not sure how this just started happening.
The code from our controller:
$parcel = request('parcel_id');
$subdivision = $user->subdivision_id;
$subEmail = Subdivision::where('id', $user->subdivision_id)->pluck('email')->first();
$move = Move::create([
'full_name' => request('full_name'),
'email' => request('email'),
'phone_number' => request('phone_number'),
'parcel_id' => $parcel,
'direction' => request('direction'),
'action_date' => request('action_date'),
'user_id' => auth()->id(),
'subdivision_id' => $subdivision
]);
$residentTabs = array(
array(
'tabLabel' => env('MOVE_IN_ADDRESS_FIELD'),
'value' => $move->parcel->MailingAddress
),
array(
'tabLabel' => env('MOVE_IN_DATE_RESIDENT_FIELD'),
'value' => $move->action_date->format('m/d/Y')
),
array(
'tabLabel' => env('MOVE_IN_EMAIL_FIELD'),
'value' => $move->email
),
array(
'tabLabel' => env('MOVE_IN_PRIMARY_PHONE_FIELD'),
'value' => $move->phone_number
),
array(
'tabLabel' => env('MOVE_IN_FULL_NAME_FIELD'),
'value' => $move->full_name
)
);
$pmTabs = array(
array(
'tabLabel' => env('MOVE_IN_PM_ADDRESS_FIELD'),
'value' => $move->parcel->MailingAddress
),
array(
'tabLabel' => env('MOVE_IN_PM_DATE_FIELD'),
'value' => $move->action_date->format('m/d/Y')
),
);
$templateRoles = array(
array(
'email' => $move->email,
'name' => $move->full_name,
'roleName' => 'Resident',
'tabs' => array(
'textTabs' => $residentTabs
)
),
array(
'email' => $subEmail,
'name' => $user->name,
'roleName' => 'Property Manager',
'tabs' => array(
'textTabs' => $pmTabs
)
)
);
$envelopeDefinition = array(
'status' => 'sent',
'templateId' => env("DOCUSIGN_TEMPLATE_ID"),
'templateRoles' => $templateRoles
);
$contract = DocuSign::get('envelopes')->createEnvelope($envelopeDefinition);
The last line is where the exception is thrown, and the function throwing the exceptions is:
vendor/docusign/esign-client/src/ApiClient.php::callApi
We expect it to work as it has, throwing no exceptions and creating the envelope successfully.
However, we have been seeing USER_AUTHENTICATION_FAILED and general 401 exceptions.
Any help is appreciated!
Your token may have expired. Not sure how it was created and what authentication mechanism you are using. You need to check where is the token and the header in the REST API calls that is using it. It may be that was hardcoded, or was there a refresh token used to keep obtaining new tokens and that process broke.
If you're getting an Authentication failure while trying to hit the login_information endpoint, it's likely that your application is using Legacy Header authentication with an invalid password.
I'd recommend the following:
Try to log in to the web console at www.docusign.net, and perform a Password Reset if necessary
Once you are able to log in, update the stored credentials in the application
2FA or forced Single Sign-On will both block Legacy Header auth. If either is in place, they will need to be disabled, or you will need to switch to one of the Account Server auth workflows.
OK I am stumped.
I have tried numerous different approaches and I've spent the best part of a good few hours searching to no avail to my exact situation, that or I am tired and blind.
Here is the raw json pulled from a URI using file_get_contents():
{"id":"XXX","name":"Customer1","os":"CentOS Linux 7.3.1611 Core","cpu_type":"Intel(R) Xeon(R) CPU E3-1245 V2 # 3.40GHz","networking_v4":[{"addr":"xxx.xxx.xxx.xxx","if":"eth0"}],"networking_v6":[{"addr":"xxxx","if":"eth0"},{"addr":"xxxx","if":"eth0"}],"agent_version":0.96,"status":"up","last_update":1505949230,"first_update":1500588943,"notifications_count":8,"ip_whois":{"ip":"xxx.xxx.xxx.xxx","hostname":"xxx","city":"Garwood","region":"New Jersey","country":"US","loc":"xxx","org":"AS20473 Choopa, LLC","postal":"xxx"},"additional_fields":[{"value":"xxx","key":"Datacenter"},{"value":"","key":""},{"value":"","key":""},{"value":"","key":""},{"value":"","key":""},{"value":"","key":""},{"value":"","key":""},{"value":"","key":""},{"value":"","key":""}]}
As you can see its a pretty simple request and I have every bit of data except those nested within networking_v4 and networking_v6.
I tried to access those like so:
'ipv4' => $json->networking_v4->addr,
'ipv4dev' => $json->networking_v4->if,
'ipv6' => $json->networking_v6->addr,
'ipv6dev' => $json->networking_v6->if,
Here is the full snapshot of code in its entirety:
$content = file_get_contents($url);
$json = json_decode($content);
$server_lastupd = $json->last_update;
$server_firstupd = $json->first_update;
$server = array(
'id' => $json->id,
'name' => $json->name,
'os' => $json->os,
'cputype' => $json->cpu_type,
'ipv4' => $json->networking_v4->addr,
'ipv4dev' => $json->networking_v4->if,
'ipv6' => $json->networking_v6->addr,
'ipv6dev' => $json->networking_v6->if,
'status' => $json->status,
'lastupd' => $json->$server_lastupd,
'firstupd' => $json->$server_firstupd,
'notifications' => $json->notifications_count,
'ip' => $json->ip_whois->ip,
'hostname' => $json->ip_whois->hostname,
'city' => $json->ip_whois->city,
'region' => $json->ip_whois->region,
'country' => $json->ip_whois->country,
'loc' => $json->ip_whois->loc,
'org' => $json->ip_whois->org,
'postal' => $json->ip_whois->postal,
'dctag' => $json->additonal_fields->dctag,
'source' => "XXX"
);
return $server;
So my issue is I appear to be unable to access the child content within networking_v4 and networking_v6.
Any help on this would be massively appreciated, its stumped me for the best part of 6 hours last night and a few more today, so I give in, someone please show me the light!
Many thanks :)
It looks like those are nested in arrays from the [{"key':"value"},{"key":"value"}] square brackets. have you tried
ipv4 => $json->networking_v4[0]->addr,
Try $json->networking_v4[0]->addr.
Both the networking_v4 and the networking_v6 keys point to arrays, so you need to pick which index you want to look at. The former only has one element, so it's easy to pick index 0, but the latter has multiple elements, so you'll need to figure out which one you want.
I have a MongoDB query that is verified as 100% working ( Using MongoHub I have connected to the Replica Set and run the query and received results ), but when converting this query to PHP and attempting to run it through MongoCollection->aggregate(), I fail to get a return/result of any kind whatsoever ... not even an error.
Here is the query, as put into a PHP Array ( as MongoCollection requires ):
$query = array(
'$match' => array(
'$and' => array(
'make' => $props[0],
'model' => $props[1],
'makeYear' => (integer)$props[2],
'status' => 'Active'
)
),
'$group' => array(
'_id' => null,
'marketTotal' => array('$sum' => '$price'),
'count' => array('$sum' => 1)
)
);
The code to run the query is a simple one-liner calling aggregate.
As I don't get errors ... or a log showing any sort of error ... I'm kind of at a total loss here. Is anyone familiar with using PHP w/ MongoDB able to see what I might be doing wrong?
Turns out I was simply missing a layer of arrays ... wrapping each piece of the '$and' array in its own array ... so array('make' => $props[0]), etc ... made it work.
Fun stuff. MongoDB queries are easy. Translating them into PHP-compatible arrays is apparently very difficult and requires a lot of guesswork because it's not 1-to-1
I know this type of question has been asked a number of times. I have spent several hours reading and trying the offered solutions - but none appear to work for my situation.
I need to send a SOAP request to an API that can contain an element that repeats like so:
<operationNumbers>
<operationNumber>1234</operationNumber>
<operationNumber>1235</operationNumber>
<operationNumber>1236</operationNumber>
<operationNumber>1237</operationNumber>
</operationNumbers>
I did read that perhaps I could do this:
$buildRequest = Array(
'myheader' => Array(
'date' => MY_DATE,
'id' => Array(
'client' => CLIENT,
'clientRef' => MYREF
)
),
'operationNumbers' => Array (
Array('operationNumber' => '1234'),
Array('operationNumber' => '1235')
)
);
$request = $client->__soapCall( 'getMultiOpDets', array($buildRequest) );
Sadly this does not work and results in 'invalid request', if I send in a single operation number eg:
...
'operationNumbers' => Array (
'operationNumber' => '1234'
)
...
The request is successful. I've tried soapVars/soapParams but cannot get it working using this approach. Any hints/tips/help appreciated.
So, I solved it.
$operationNumbersArray = array('1234','1235');
...
'operationNumbers' => array(
'operationNumber' => $operationNumbersArray
)
During my testing and fiddling about, I had inadvertently removed another value that was mandatory. The API did not give warning of it's omission (sadly).
Here is the code I use:
$wsdl = 'https://your.api/path?wsdl';
$client = new SoapClient($wsdl);
$multipleSearchValues = [1, 2, 3, 4];
$queryData = ['yourFieldName' => $multipleSearchValues];
$results = $client->YourApiMethod($queryData);
print_r($results);
I'm working off this documentation: http://docs.amazonwebservices.com/AWSSDKforPHP/latest/#m=AmazonEC2/modify_instance_attribute
This is the best I can make sense of the docs:
$instance_id = 'i-XXXXXXXX';
$volume_id = 'vol-XXXXXXXX';
$ec2->modify_instance_attribute ( $instance_id, array(
'Attribute' => 'blockDeviceMapping',
'BlockDeviceMapping' => array(
array(
'DeviceName' => '/dev/sdh',
'Ebs' => array(
array(
'VolumeId' => $volume_id,
'DeleteOnTermination' => true
)
)
)
)
));
But the call returns with
[Error] => CFSimpleXML Object
(
[Code] => InvalidParameterCombination
[Message] => No attributes specified.
)
Your code is correct as such: I copied it verbatim, changed nothing but $instance_id and $volume_id (as well as DeviceName to an existing one on an Amazon EC2 test instance) and it returns properly with HTTP status 200.
Are you sure you are running the latest AWS SDK for PHP (not that I'd be aware of a specific issue, but that's the one which is working for me right now)?