I am newbie to fedex web-services API.
I want to print the return label with the out bound shipment. I tried including below tag under RequestedShipment/SpecialServicesRequested tag. but i am getting the error "Alternate sender not allowed with return shipments".
Here is my request look like..
<RequestedShipment>
.
.
<SpecialServicesRequested>
.
.
<ReturnShipmentDetail>
<ReturnType>PRINT_RETURN_LABEL</ReturnType>
</ReturnShipmentDetail>
.
.
</SpecialServicesRequested>
.
.
</RequestedShipment>
Thanks in advance...
Update : I am using fedex API 10.
When requesting return label, it should not have following two elements in request body.
LabelSpecification/ PrintedLabelOrigin/ Contact,
LabelSpecification/ PrintedLabelOrigin/ Address
Above elements are used to override return address from default value of shipping address.:)
Related
If you can help me I will be very grateful.
My problem is i send a request via google chrome like that :
http://localhost:8080/Webservise/rest/getinfo?user=user1&pwd=rdd#en&sscc=009
and whene i test the url he return :
user = user1
pwd=rdd
sscc= null
Because the # is an special caracter
any proposition ?
Thanks a lot.
Yes # is a fragment identifier. To ensure its interpreted as part of a query string you must URL encode it (to %23) - You should be doing this as routine for all query string values.
I am currently in a need of a Load test for a web-solution, which requires for a user authentication in Homepage (Welcome Page).
When I seek for the POST SignIn parameters which are passing along with the login credentials using FireBug in FireFox,
i found out that Password, TenantName, UserName, __RequestVerificationToken are the parameters which are passing along with their values for a successful login.
I needed to simulate this process using the JMETER.
Therefore i have made a HTTP REQUEST (Visit Login Page) to Navigate to the page using JMETER, which successfully work.
Within the HTTP REQUEST (Visit Login Page) I have added a Regular Expression Extractor, to Extract the token,
since it is necessary to pass the token along with the sign in.
Reference Name : REQUEST_VERIFICATION_TOKEN
Reg Expression : input name="__RequestVerificationToken" type="hidden" value="([A-Za-z0-9+=/-\ _]+?)"
Template : $1$
Match No. : 1
Default Value : (blank)
And I have added a separate HTTP Request (Login to Web) for signin along with the Parameters as follows;
Password : ${Password}
TenantName : ${TenantName}
Username : ${Username}
__RequestVerificationToken : ${REQUEST_VERIFICATION_TOKEN}
But When I Run it, under the View Results Tree,
the Response Data is generating as "The anti-forgery token could not be decrypted..."
When i check for the Request displays under View Result Tree,
it displays as
POST data:
Password=123456&TenantName=tenant&Username=admin&__RequestVerificationToken=%24%7BREQUEST_VERIFICATION_TOKEN%7D*
Where in the Request I realized the value for the RequestVerificationToken is not getting initialized.
I was searching for a solution through blogs for two days, where ultimately without a proper assistance I tend to post this question over here.
This is one reference link which is usefully for a extent, from which i used :
http://build-failed.blogspot.com/2012/07/load-testing-aspnet-mvc-part-3-jmeter.html?showComment=1417672985397#c6427302313332055578
Can someone assist me of Why the RequestVerificationToken is not extracting properly, or getting initialized to the variable?
( Ps : please be kind enough to assume that I'm a beginner in JMeter, to be honest, when you are providing your precious reply )
In Regular expression '-' has a meaning & it has to be escaped properly if it is expected in your __RequestVerificationToken value.
So, the correct regular expression would be
input name="__RequestVerificationToken" type="hidden" value="([A-Za-z0-9+=/\-\_]+?)"
I created a temp variable & verified above regular expression. It works fine. If it does not work for you, Please provide the HTTP response if possible.
I am using web2py and builing a REST api and have one of my URLs set up like this:
routes_in (
('/myapp/something/{?P<id>.*)/myfunction', /myapp/default/myfunction/\g<id>')
)
routes_out = (
('/myapp/default/myfunction/\g<id>', '/myapp/something/{?P<id>.*)/myfunction')
)
If my app is setup this way my function is not even entered into and I get an invalid request if I remove the id argument from the url that my url is being mapped to i.e. remove g<id> from above, I enter my function but the argument is not being captured.
I cannot change the structure of the URL as per my requirements and I am not sure how to go about this.
I would appreciate any pointers.
Thanks,
nav
The above does work in web2py I found that some other area of my code was breaking.
I was looking to find an answer to my question, but so far I got this:
https://graph.facebook.com/the_user_id?fields=name,picture
I need to be able to display/print first,last name and picture of a set list of users for which I know their ID. What code is required to get this data and then to publish it on a php/html page? Of course, this will means that if I want to show 10 users, I will input 10 different IDs (read smtg about an array list?). Notice that I DO NOT require for this to work for the current user.
Thanks in advance for your replies.
You need to use file_get_contents ( http://uk3.php.net/file_get_contents ) or curl in php and issue a request to the url such as follows:
https://graph.facebook.com/?ids=id1,id2,id3&fields=name,picture
(replacing id1,id2 with your ids)
this will then return you a json object. You then need to decode ( http://uk3.php.net/json_decode ) and loop through this and access the information
this should get you started
// people array uses the users id as the key and the dessert as the value. The id is then used in the query to facebook to select the corresponding value from this array
$people = array("id1"=>"favourite "dessert", "id2"=>"favourite dessert", "id3"=>"apple pie");
$json = file_get_contents('https://graph.facebook.com/?ids=id1,id2,id3&fields=id,name,picture');
$json = json_decode($json);
foreach($json as $key=>$person){
echo '<p><img src="'.$person->picture.'" alt="'.$person->name.'" />';
echo $person->name.'\'s favourite dessert is '.$people[$person->id'];
echo '</p>';
}
I've batched the requests here, alternatively you could perform 10 separate queries for each user, but that would be a bit pointless and inefficient
The easiest way is with an FQL query:
SELECT first_name, last_name, pic, uid FROM user WHERE uid IN
(Known_ID_1, Known_ID_2, ... Known_ID_n)
The easiest, if you're using PHP is to install the PHP SDK, though you can also make a call directly to https://graph.facebook.com/fql?q=URL_ENCODED_QUERY
data = form.cleaned_data
rad1=form.cleaned_data['point']
I want to display both the data and rad1 , so as to know what is my form capturing . One way to do it send it as a value to the template to be displayed on the page . But I think there would be an easier way out . If I give a print 'data' . It doesn't print the data anywhere .
Text sent to stderr will appear in the web server's error log; it is best to use either logging or a logger supplied by the WSGI container for this.
If you want the text to appear in the browser then you will need to send it in the response, either as raw text or via a template.