Jump to content

Implementing Shipping Web Services


 Share

This topic is 4324 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies

I have to develop a FM solution that uses the online services of UPS and FedEx to validate addresses, calculate shipping costs, submit shipments, and track packages. I am well versed in PHP and have worked with FM for a few years now. I am new to using online web services, however, and I could use a few pointers to get started. I would imagine that others have tried to do this already and would like to learn from them.

Thanks for any help you can provide.

-matt

Link to comment
Share on other sites

  • Newbies

I have been using the smartpill plugin from Scodigo.com to directly call php functions within FileMaker with some amount of success. I can generate the xml with the simplexml function and have been calling the UPS url ('https://wwwcie.ups.com/webservices/XAV') with the curl object functions. I can't seem to get a valid xml to the service, however, and keep getting a "10001" error.

Any ideas?

//////////////// XML Request ////////////////

<?xml version="1.0"?>

<AccessRequest>

<AccessLicenseNumber>$accessLicenseNumber</AccessLicenseNumber>

<UserId>$userName</UserId>

<Password>$passwd</Password>

</AccessRequest>

<?xml version="1.0"?>

<AddressValidationRequest xml:lang="en-US">

<Request>

<TransactionReference>

<CustomerContext>Customer Data</CustomerContext>

<XpciVersion>1.0001</XpciVersion>

</TransactionReference>

<RequestAction>AV</RequestAction>

</Request>

<Address>

<City>MIAMI</City>

<StateProvinceCode>FL</StateProvinceCode>

</Address>

</AddressValidationRequest>




Which is the example XML from the UPS Address Validation.zip from their developer's website.  I get the following response back



///////////////  Response  ////////////////




HTTP/1.1 200 OK



Server: Apache



Content-Length: 660



X-Powered-By: Servlet/2.5 JSP/2.1



Content-Type: text/xml



Expires: Wed, 06 Apr 2011 20:38:57 GMT



Cache-Control: max-age=0, no-cache, no-store



Pragma: no-cache



Date: Wed, 06 Apr 2011 20:38:57 GMT



Connection: keep-alive







<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Header/><soapenv:Body><soapenv:Fault><faultcode>Client</faultcode><faultstring>An exception has been raised as a result of client data.</faultstring><detail><err:Errors xmlns:err="http://www.ups.com/schema/xpci/1.0/error"><err:ErrorDetail><err:Severity>Hard</err:Severity><err:PrimaryErrorCode><err:Code>10001</err:Code><err:Description>The XML document is not well formed</err:Description><err:Digest>Unexpected element: XML_DOC_DECL</err:Digest></err:PrimaryErrorCode><err:Location/></err:ErrorDetail></err:Errors></detail></soapenv:Fault></soapenv:Body></soapenv:Envelope>

Any ideas?

Link to comment
Share on other sites

This topic is 4324 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.