Click here to Skip to main content
15,892,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi everybody,

I am developing an Asp.Net application with Fedex web services. When i assign value to the Fedex weight information i get some problem.

C#
decimal packweight = 10.5M;
request.RequestedShipment.RequestedPackageLineItems[0].Weight.Value = packweight;


In the above code i set packweight decimal variable value to the fedex Weight. But its getting some error. Schema validation failed to request.

C#
request.RequestedShipment.RequestedPackageLineItems[0].Weight.Value = 10.5M;


In the above code i directly assign the Weight value. Its working fine and i get the rerponse from the Fedex Rate services. In my application i want to dynamically get the weight value and set to the Fedex. Kindly assist me to fix the error.
Posted
Comments
Sebastian T Xavier 27-Jul-12 3:34am    
what M stands for in the following line?
decimal packweight = 10.5M;

Did you receive any error, while executing this line...
Christian Graus 27-Jul-12 3:46am    
M makes the number a decimal. To the OP - you need to give us the exact error message, because if this is the only difference between the two code versions, that makes no sense at all.
ksbalamurali 27-Jul-12 6:32am    
Error: Schema validation failed to request.
This is the error response which i get from the Fedex rate service. I did't get any error in the visual studio.
pradiprenushe 27-Jul-12 5:54am    
Give full error code.
Christian Graus 28-Jul-12 2:07am    
So you need to read their documentation or contact them.

1 solution

Have you tried to use float instead??
 
Share this answer
 
Comments
ksbalamurali 27-Jul-12 6:34am    
In Fedex web service they get the decimal value only. So i can't assign the float.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900