Asked  7 Months ago    Answers:  5   Viewed   32 times

So, I'm working on integrating Fedex's Address Validation into a site I'm working on. Fedex web services are SOAP-based, so we're in the magical land of WSDLs here. I'm not fluent with web services yet, so bear with me.

One can only consume the Address Validation service at a production level; I've got my production credentials situated, and a production URL in the port section of my WSDL.

In testing the service integration, I'm receiving this provocative message:

Fault Code:VersionMismatch String:Wrong Version

Fedex support thus far seems unable to answer this, so I'm gonna ask it here: why am I getting this fault? Am I right in suspecting that perhaps the SOAP version on our server is outdated, and, if so, is there any workaround anyone knows for this?

 Answers

68

A common reason for this error seems to be a wrong namespace used for the envelope. See http://www.w3.org/TR/soap12-part1/#faultcodes and http://www.w3.org/TR/soap12-part1/#vmfault

Wednesday, March 31, 2021
 
altexpape
answered 7 Months ago
47

A simple request for the web service's available functions solved the problem.

$functions = $client->__getFunctions ();
var_dump ($functions);

EchoTestRequest was not a valid function call. The proper function call was EchoTest, which is illustrated by the functions variable dump.

array(1) { [0]=> string(54) "EchoTestResponse EchoTest(EchoTestRequest $parameters)" } 
Wednesday, March 31, 2021
 
cyber_truite
answered 7 Months ago
70

SOLVED

in soap_client.php, in catch, i added "echo $client->__getLastResponse();" which gave me the following output:

Deprecated: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set 'always_populate_raw_post_data' to '-1' in php.ini and use the php://input stream instead. in Unknown on line 0

Warning: Cannot modify header information - headers already sent in Unknown on line 0
Dale Cooper, Harry Truman, Shelly Johnson, Bobby Briggs, Donna Hayward, Audrey Horne, James Hurley, Lucy Moran, Tommy Hill, Andy Brennan, John Smith

that last line is the string i passed to the client.

so what i tried was to uncomment "always_populate_raw_post_data = -1" in php.ini as the error suggested & restarted my Apache2.4 web-server and now it works, getting my string with no errors:

Dale Cooper, Harry Truman, Shelly Johnson, Bobby Briggs, Donna Hayward, Audrey Horne, James Hurley, Lucy Moran, Tommy Hill, Andy Brennan, John Smith

hope i helped someone with this, as i saw alot of unanswered questions about this error.

Saturday, May 29, 2021
 
Andres
answered 5 Months ago
62

outer(0:5, 0:6, sum) don't work because sum is not "vectorized" (in the sense of returning a vector of the same length as its two arguments). This example should explain the difference:

 sum(1:2,2:3)
  8
 1:2 + 2:3
 [1] 3 5

You can vectorize sum using mapply for example:

identical(outer(0:5, 0:6, function(x,y)mapply(sum,x,y)),
          outer(0:5, 0:6,'+'))
TRUE

PS: Generally before using outer I use browser to create my function in the debug mode:

outer(0:2, 1:3, function(x,y)browser())
Called from: FUN(X, Y, ...)
Browse[1]> x
[1] 0 1 2 0 1 2 0 1 2
Browse[1]> y
[1] 1 1 1 2 2 2 3 3 3
Browse[1]> sum(x,y)
[1] 27          ## this give an error 
Browse[1]> x+y  
[1] 1 2 3 2 3 4 3 4 5 ## this is vectorized
Friday, June 18, 2021
 
Akarun
answered 5 Months ago
74

Its called a parameter pack and refers to zero or more template parameters:

http://en.cppreference.com/w/cpp/language/parameter_pack

std::size_t ...Rs

is the parameter pack of type std::size_t. A variable of that type (e.g. Rs... my_var) can be unpacked with:

my_var... 

This pattern is heavily used in forwarding an (unknown) amount of arguments:

template < typename... T >
Derived( T&&... args ) : Base( std::forward< T >( args )... )
{
}
Sunday, August 8, 2021
 
Elijah W. Gagne
answered 3 Months ago
Only authorized users can answer the question. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :