FedEx error: Special service invalid 8200 - fedex

I'm trying to connect to FedEx International WebServices API for Ship Service.
I'm using WSDL of v13.
Below is my SOAP Content:
<ns:ProcessShipmentRequest xmlns:ns="http://fedex.com/ws/ship/v13">
<ns:WebAuthenticationDetail>
<ns:UserCredential>
<ns:Key>GHmnVXAyWqWUemqD</ns:Key>
<ns:Password>1VYHs6O1vhKA3xPVAExhx1vUB</ns:Password>
</ns:UserCredential>
</ns:WebAuthenticationDetail>
<ns:ClientDetail>
<ns:AccountNumber>510087666</ns:AccountNumber>
<ns:MeterNumber>100115929</ns:MeterNumber>
</ns:ClientDetail>
<ns:Version>
<ns:ServiceId>ship</ns:ServiceId>
<ns:Major>13</ns:Major>
<ns:Intermediate>0</ns:Intermediate>
<ns:Minor>0</ns:Minor>
</ns:Version>
<ns:RequestedShipment>
<ns:ShipTimestamp>2015-04-17T12:51:03.404660Z</ns:ShipTimestamp>
<ns:DropoffType>REGULAR_PICKUP</ns:DropoffType>
<ns:ServiceType>INTERNATIONAL_PRIORITY</ns:ServiceType>
<ns:PackagingType>FEDEX_25KG_BOX</ns:PackagingType>
<ns:TotalWeight>
<ns:Units>LB</ns:Units>
<ns:Value>40.0</ns:Value>
</ns:TotalWeight>
<ns:Shipper>
<ns:Contact>
<ns:CompanyName>Your Company</ns:CompanyName>
<ns:PhoneNumber>4354454365746</ns:PhoneNumber>
</ns:Contact>
<ns:Address>
<ns:StreetLines>3121 W Government Way</ns:StreetLines>
<ns:StreetLines>Seattle</ns:StreetLines>
<ns:City>Seattle</ns:City>
<ns:StateOrProvinceCode>WA</ns:StateOrProvinceCode>
<ns:PostalCode>98199</ns:PostalCode>
<ns:CountryCode>US</ns:CountryCode>
<ns:CountryName>United States</ns:CountryName>
<ns:Residential>false</ns:Residential>
</ns:Address>
</ns:Shipper>
<ns:Recipient>
<ns:Contact>
<ns:PersonName>Agrolait</ns:PersonName>
<ns:PhoneNumber>3210588558</ns:PhoneNumber>
</ns:Contact>
<ns:Address>
<ns:StreetLines>1010 EASY ST</ns:StreetLines>
<ns:StreetLines>Apt# 11</ns:StreetLines>
<ns:City>OTTAWA</ns:City>
<ns:StateOrProvinceCode>ON</ns:StateOrProvinceCode>
<ns:PostalCode>K1A0B1</ns:PostalCode>
<ns:CountryCode>CA</ns:CountryCode>
<ns:Residential>false</ns:Residential>
</ns:Address>
</ns:Recipient>
<ns:ShippingChargesPayment>
<ns:PaymentType>SENDER</ns:PaymentType>
<ns:Payor>
<ns:ResponsibleParty>
<ns:AccountNumber>510087666</ns:AccountNumber>
<ns:Contact>
<ns:PersonName>Your Company</ns:PersonName>
<ns:CompanyName>Your Company</ns:CompanyName>
<ns:PhoneNumber>4354454365746</ns:PhoneNumber>
</ns:Contact>
<ns:Address>
<ns:CountryCode>US</ns:CountryCode>
</ns:Address>
</ns:ResponsibleParty>
</ns:Payor>
</ns:ShippingChargesPayment>
<ns:CustomsClearanceDetail>
<ns:ClearanceBrokerage>BROKER_UNASSIGNED</ns:ClearanceBrokerage>
<ns:DutiesPayment>
<ns:PaymentType>SENDER</ns:PaymentType>
<ns:Payor>
<ns:ResponsibleParty>
<ns:AccountNumber>510087666</ns:AccountNumber>
<ns:Contact>
<ns:PersonName>Your Company</ns:PersonName>
<ns:CompanyName>Your Company</ns:CompanyName>
<ns:PhoneNumber>4354454365746</ns:PhoneNumber>
</ns:Contact>
</ns:ResponsibleParty>
</ns:Payor>
</ns:DutiesPayment>
<ns:DocumentContent>NON_DOCUMENTS</ns:DocumentContent>
<ns:CustomsValue>
<ns:Currency>USD</ns:Currency>
<ns:Amount>100.0</ns:Amount>
</ns:CustomsValue>
<ns:FreightOnValue>OWN_RISK</ns:FreightOnValue>
<ns:CommercialInvoice>
<ns:TaxesOrMiscellaneousChargeType>TAXES</ns:TaxesOrMiscellaneousChargeType>
<ns:Purpose>SOLD</ns:Purpose>
<ns:TermsOfSale>FOB_OR_FCA</ns:TermsOfSale>
</ns:CommercialInvoice>
<ns:Commodities>
<ns:NumberOfPieces>1</ns:NumberOfPieces>
<ns:Description>[CARD] Graphics Card</ns:Description>
<ns:CountryOfManufacture>US</ns:CountryOfManufacture>
<ns:Weight>
<ns:Units>LB</ns:Units>
<ns:Value>10.0</ns:Value>
</ns:Weight>
<ns:Quantity>1</ns:Quantity>
<ns:QuantityUnits>Unit(s)</ns:QuantityUnits>
<ns:UnitPrice>
<ns:Currency>USD</ns:Currency>
<ns:Amount>100.0</ns:Amount>
</ns:UnitPrice>
<ns:CustomsValue>
<ns:Currency>USD</ns:Currency>
<ns:Amount>100.0</ns:Amount>
</ns:CustomsValue>
</ns:Commodities>
</ns:CustomsClearanceDetail>
<ns:LabelSpecification>
<ns:LabelFormatType>COMMON2D</ns:LabelFormatType>
<ns:ImageType>PNG</ns:ImageType>
<ns:LabelStockType>PAPER_4X6</ns:LabelStockType>
<ns:LabelPrintingOrientation>BOTTOM_EDGE_OF_TEXT_FIRST</ns:LabelPrintingOrientation>
</ns:LabelSpecification>
<ns:ShippingDocumentSpecification>
<ns:ShippingDocumentTypes>CERTIFICATE_OF_ORIGIN</ns:ShippingDocumentTypes>
</ns:ShippingDocumentSpecification>
<ns:RateRequestTypes>ACCOUNT</ns:RateRequestTypes>
<ns:EdtRequestType>ALL</ns:EdtRequestType>
<ns:PackageCount>1</ns:PackageCount>
<ns:RequestedPackageLineItems>
<ns:SequenceNumber>1</ns:SequenceNumber>
<ns:Weight>
<ns:Units>LB</ns:Units>
<ns:Value>40.0</ns:Value>
</ns:Weight>
<ns:Dimensions>
<ns:Length>17</ns:Length>
<ns:Width>12</ns:Width>
<ns:Height>3</ns:Height>
<ns:Units>IN</ns:Units>
</ns:Dimensions>
<ns:PhysicalPackaging>BOX</ns:PhysicalPackaging>
</ns:RequestedPackageLineItems>
</ns:RequestedShipment>
</ns:ProcessShipmentRequest>
When I send the request I get Below Response:
(reply){
HighestSeverity = "ERROR"
Notifications[] =
(Notification){
Severity = "ERROR"
Source = "ship"
Code = "8200"
Message = "Special service is invalid."
LocalizedMessage = "Special service is invalid."
},
(Notification){
Severity = "WARNING"
Source = "ship"
Code = "7037"
Message = "Harmonized code is missing or invalid for commodity (COMMODITY_INDEX}; estimated duties and taxes were not returned."
LocalizedMessage = "Harmonized code is missing or invalid for commodity (COMMODITY_INDEX}; estimated duties and taxes were not returned."
MessageParameters[] =
(NotificationParameter){
Id = "COMMODITY_INDEX"
Value = "1"
},
},
Version =
(VersionId){
ServiceId = "ship"
Major = 13
Intermediate = 0
Minor = 0
}
}
Warning I can have fixed but the Special Service Invalid Error Persists. Please let me know If I'm passing some wrong value or if I'm missing some Value.
Note: I tried adding the special services like COD, but the issue is same.

Since you don't have a special service defined, this error is really odd. You need to email websupport at fedex dot com for resolution. FedEx error responses are terrible.

Related

Kafka sink to InfluxDB

I'm trying to get data from my kafka topic into InfluxDB using the Confluent/Kafka stack. At the moment, the messages in the topic have a form of {"tag1":"123","tag2":"456"} (I have relatively good control over the message format, I chose the JSON to be as above, could include a timestamp etc if necessary).
Ideally, I would like to add many tags without needing to specify a schema/column names in the future.
I followed https://docs.confluent.io/kafka-connect-influxdb/current/influx-db-sink-connector/index.html (the "Schemaless JSON tags example") as this matches my use case quite closely. The "key" of each message is currently just the MQTT topic name (the topic's source is an MQTT connector). So I set the "key.converter" to "stringconverter" (instead of JSONconverter as in the example).
Other examples I've seen online seem to suggest the need for a schema to be set, which I'd like to avoid. Using InfluxDB v1.8, everything on Docker/maintained on Portainer.
I cannot seem to start the connector and never get any data to move across.
Below is the config for my InfluxDBSink Connector:
{
"name": "InfluxDBSinkKafka",
"config": {
"key.converter.schemas.enable": "false",
"value.converter.schemas.enable": "false",
"name": "InfluxDBSinkKafka",
"connector.class": "io.confluent.influxdb.InfluxDBSinkConnector",
"tasks.max": "1",
"key.converter": "org.apache.kafka.connect.storage.StringConverter",
"value.converter": "org.apache.kafka.connect.json.JsonConverter",
"topics": "KAFKATOPIC1",
"influxdb.url": "http://URL:PORT",
"influxdb.db": "tagdata",
"measurement.name.format": "${topic}"
}
}
The connector fails, and each time I click "start" (the play button) the following pops up in the connect container's logs:
[2022-03-22 15:46:52,562] INFO [Worker clientId=connect-1, groupId=compose-connect-group]
Connector InfluxDBSinkKafka target state change (org.apache.kafka.connect.runtime.distributed.DistributedHerder)
[2022-03-22 15:46:52,562] INFO Setting connector InfluxDBSinkKafka state to STARTED (org.apache.kafka.connect.runtime.Worker)
[2022-03-22 15:46:52,562] INFO SinkConnectorConfig values:
config.action.reload = restart
connector.class = io.confluent.influxdb.InfluxDBSinkConnector
errors.deadletterqueue.context.headers.enable = false
errors.deadletterqueue.topic.name =
errors.deadletterqueue.topic.replication.factor = 3
errors.log.enable = false
errors.log.include.messages = false
errors.retry.delay.max.ms = 60000
errors.retry.timeout = 0
errors.tolerance = none
header.converter = null
key.converter = class org.apache.kafka.connect.storage.StringConverter
name = InfluxDBSinkKafka
predicates = []
tasks.max = 1
topics = [KAFKATOPIC1]
topics.regex =
transforms = []
value.converter = class org.apache.kafka.connect.json.JsonConverter
(org.apache.kafka.connect.runtime.SinkConnectorConfig)
[2022-03-22 15:46:52,563] INFO EnrichedConnectorConfig values:
config.action.reload = restart
connector.class = io.confluent.influxdb.InfluxDBSinkConnector
errors.deadletterqueue.context.headers.enable = false
errors.deadletterqueue.topic.name =
errors.deadletterqueue.topic.replication.factor = 3
errors.log.enable = false
errors.log.include.messages = false
errors.retry.delay.max.ms = 60000
errors.retry.timeout = 0
errors.tolerance = none
header.converter = null
key.converter = class org.apache.kafka.connect.storage.StringConverter
name = InfluxDBSinkKafka
predicates = []
tasks.max = 1
topics = [KAFKATOPIC1]
topics.regex =
transforms = []
value.converter = class org.apache.kafka.connect.json.JsonConverter
(org.apache.kafka.connect.runtime.ConnectorConfig$EnrichedConnectorConfig)
I am feeling a little out of my depth and would appreciate any and all help.
The trick here is getting the data in the right format to Kafka in the first place. My MQTT source stream needed to have the value converter set to Bytearray with e schema url and schema = true. Then the Influx Sink started working when I used the jsonconverter, with schema=false. Then it started working. This is deceptive because the message queue looks the same with different valueconverters for the MQTT source connecter, so it took a while to figure out that was the problem.
After getting this working, and realising the confluent stack was perhaps a little overkill for this task, I went with the (much) easier route of pushing MQTT directly to Telegraf and having Telegraf push into InfluxDB. I would recommend this.

Cant load real-time data from tws

I can't get real-time tick with API for GBP.CHF#IDEALPRO/ My log:
0:53:36:282 <- 9-8-1073741829-0-GBP-CASH--0-----CHF---0---
10:53:36:282 <- 1-11-1073741830-0-GBP-CASH--0-----CHF---0-233,236,258-0-0--
10:53:36:282 -> ---R4-2-1073741830-321-Error validating request.-'bX' : cause - Please enter exchange-
10:53:36:283 <- 1-11--1073741830-0-GBP-CASH--0-----CHF---0--1-0--
10:53:36:283 -> ---S4-2--1073741830-321-Error validating request.-'bX' : cause - Please enter exchange-
10:53:36:318 <- 9-8-1073741831-0-GBP-CASH--0-----CHF---0---
Nothing incoming from tws. Please help.
Here's your log compared to my log.
1-11-1073741830-0-GBP-CASH--0 --- --CHF---0-233,236,258-0-0--
1-11-1 -0-GBP-CASH--0.0---IDEALPRO--CHF---0-233-0-0--
You just forgot the exchange.
contract = Contract()
contract.symbol = "GBP"
contract.secType = "CASH"
contract.exchange = "IDEALPRO"
contract.currency = "CHF"
app.reqMktData(1, contract, "233", False, False, None)
I'm not sure about your generic tick list, not all type are available for forex. I just threw in 233 to see if it would cause an error but it worked.

creating learner in mlr3: Error in sprintf(msg, ...) : too few arguments

I want to create a learner in mlr3, using the distRforest package.
my code:
library(mlr3extralearners)
create_learner( pkg = "." ,
classname = 'distRforest',
algorithm = 'regression tree',
type = 'regr',
key = 'distRforest',
package = 'distRforest',
caller = 'rpart',
feature_types = c("logical", "integer", "numeric","factor", "ordered"),
predict_types = c('response'),
properties = c("importance", "missings", "multiclass",
"selected_features", "twoclass", "weights"),
references = FALSE,
gh_name = 'CL'
)
gives the following error : Error in sprintf(msg, ...) : too few arguments
in fact, replicating the code in the tutorial https://mlr3book.mlr-org.com/extending-learners.html throws the same error.
Any ideas? Thanks a lot - c
thanks for your interest in extending the mlr3 universe!
Couple of things, firstly the example in the book works fine for me, and secondly your example cannot work because you are including classif properties for a regr learner. As I am unable to reproduce your error it's hard for me to debug what's going wrong, it would be helpful if you could run the following:
reprex::reprex({
create_learner(
pkg = ".",
classname = "Rpart",
algorithm = "decision tree",
type = "classif",
key = "rpartddf",
package = "rpart",
caller = "rpart",
feature_types = c("logical", "integer", "numeric", "factor", "ordered"),
predict_types = c("response", "prob"),
properties = c("importance", "missings", "multiclass", "selected_features", "twoclass", "weights"),
references = TRUE,
gh_name = "CL"
)
}, si = TRUE)
If you're still getting an error and the output is too long to print here then head over to the GitHub and open an issue there.

LSXLC ODBC Stored Procedure

I'm trying to connect to an Oracle RDB database using LSXLC (ODBC Connector).
But when it comes to stored procedures I'm having a hard time getting it to work.
The code below always results in "Error: Parameter name not supplied: fnl_date, Connector 'odbc2', Method -Call-". The error is triggered on "count = connection.Call(input, 1, result)"
Can anyone tell me what I'm doing wrong?
Public Function testLsxlcProc()
On Error GoTo handleError
Dim connection As LCConnection("odbc2")
connection.Server = "source"
connection.Userid = "userid"
connection.Password = "password"
connection.procedure = "proc_name"
connection.Connect
If connection.IsConnected Then
Dim input As New LCFieldList()
Dim result As New LCFieldList()
Dim break As LCField
Set break = input.Append("fnl_date", LCTYPE_TEXT)
break.Text = "2014-07-01"
Dim agrNo As LCField
Set agrNo = input.Append("fnl_agreement_no", LCTYPE_TEXT)
agrNo.Text = "123456"
Dim curr As LCField
Set curr = input.Append("fnl_currency_code", LCTYPE_TEXT)
curr.Text = "SEK"
Dim stock As LCField
Set stock = input.Append("fnl_stock_id", LCTYPE_TEXT)
stock.Text = "01"
connection.Fieldnames = "status, value"
Dim count As Integer
count = connection.Call(input, 1, result)
Call logger.debug("Count: " & count)
Else
Error 2000, "Unable to connect to database."
End If
handleExit:
connection.Disconnect
Exit Function
handleError:
On Error Resume Next
Call logger.error(Nothing)
Resume handleExit
End Function
Thanks in advance!
I had made a stupid mistake and had a mismatch between the name of the input parameter in Domino and the name of the input parameter in the stored procedure.
Make sure all names match up and there shouldn't be a problem.
Stored-Procedure "mylib.MyStoredProc" wird aufgerufen ...
LcSession.Status = 12325: LC-Error: errCallStoredProc 12325 (Error: Parameter name not supplied: P_S651_AC, Connector 'odbc2', Method -Call-)
Solution: changed "mylib" into "MYLIB" and all was well.
Check not only Parameter-Names, but also the Search-Path.

OAuth authentication, invalid signature

I tired to port the request-oauth library (based on python-request) to Python 3 (with help of 2to3) but I have problems to validate a signature with StatusNet (same API as Twitter).
When I do a request to oauth/request_token, I have no problem but to oauth/access_token I have an error 401 Invalid signature. I don't understand why because it seems to me that what I sign is correct.
For example, with the python 2 code, cf hook.py and auth.py (original from the git repo), I get :
signing_key = '0de1456373dfc9349dd38a48e61fc844&136d6b9a597ee57d4338254812681acd',
signing_raw = 'POST&http%3A%2F%2Fstatus2.dotzero.me%2Fapi%2Foauth%2Faccess_token&oauth_consumer_key%3Dec3ad931b294b51a5ff595c732acb7a5%26oauth_nonce%3D33448267%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1332279747%26oauth_token%3D2131043f3516bcb730d391ed2033a880%26oauth_verifier%3D8816492%26oauth_version%3D1.0'
oauth_hook.token.key = '2131043f3516bcb730d391ed2033a880'
oauth_hook.token.secret = '136d6b9a597ee57d4338254812681acd'
request.data_and_params = {'oauth_version': '1.0', 'oauth_signature': 'xyjxH5QcfZXnG111L7qANZ+ahRI=',
'oauth_token': '2131043f3516bcb730d391ed2033a880', 'oauth_nonce': '33448267',
'oauth_timestamp': '1332279747', 'oauth_verifier': '8816492',
'oauth_consumer_key': 'ec3ad931b294b51a5ff595c732acb7a5',
'oauth_signature_method': 'HMAC-SHA1'}
and with my python 3 port, cf hook.py and auth.py, I get :
signing_key = '0de1456373dfc9349dd38a48e61fc844&136d6b9a597ee57d4338254812681acd',
signing_raw = 'POST&http%3A%2F%2Fstatus2.dotzero.me%2Fapi%2Foauth%2Faccess_token&oauth_consumer_key%3Dec3ad931b294b51a5ff595c732acb7a5%26oauth_nonce%3D52360702%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1332278837%26oauth_token%3D2131043f3516bcb730d391ed2033a880%26oauth_verifier%3D8816492%26oauth_verifier%3D8816492%26oauth_version%3D1.0'
oauth_hook.token.key = '2131043f3516bcb730d391ed2033a880'
oauth_hook.token.secret = '136d6b9a597ee57d4338254812681acd'
request.data_and_params = {'oauth_nonce': '52360702', 'oauth_timestamp': '1332278837',
'oauth_verifier': '8816492', 'oauth_consumer_key': 'ec3ad931b294b51a5ff595c732acb7a5',
'oauth_signature_method': 'HMAC-SHA1', 'oauth_version': '1.0',
'oauth_token': '2131043f3516bcb730d391ed2033a880',
'oauth_signature': 'BRsb11dk++405uaq5pRS+CMUzbo='}
Both looks good to me but the first one succeed and the second returns a 401 error, invalid signature.
In both cases, I get the token.key and token.secret as the result of :
OAuthHook.consumer_key = self.ckey
OAuthHook.consumer_secret = self.csecret
oauth_hook = OAuthHook()
client = requests.session(hooks={'pre_request': oauth_hook})
response = client.post('%soauth/request_token' % (self.url), {'oauth_callback': 'oob'})
# new oauth_hook with the request token
oauth_hook = OAuthHook(response[b'oauth_token'][0],response[b'oauth_token_secret'][0])
Them, I go to oauth/authorize?oauth_token=%s" % oauth_hook.token.key to get authorize the app and get a pincode. After that I can do the problematic request
...
response = client.post('%soauth/request_token' % (self.url), {'oauth_callback': 'oob'})
oauth_hook = OAuthHook(response[b'oauth_token'][0],response[b'oauth_token_secret'][0])
# get the pincode from %soauth/authorize?oauth_token=%s" % (self.url, oauth_hook.token.key)
oauth_hook.token.set_verifier(pincode)
client = requests.session(hooks={'pre_request': oauth_hook})
response = client.post("%soauth/access_token" % (self.url),
{'oauth_verifier': pincode})
The signature code from the auth.py file is
def sign(self, request, consumer, token):
"""Builds the base signature string."""
key, raw = self.signing_base(request, consumer, token)
hashed = hmac.new(key.encode(), raw.encode(), sha1)
# Calculate the digest base 64.
return binascii.b2a_base64(hashed.digest())[:-1]
Any idea why it doesn't work with the py3k code ?
Thank you
Found the answer ! There were two oauth_verifier in the POST request, leading to a wrong signature...
You may need to verify the Authorization header string in your request. Normally it would be of the format:
'Authorization' => 'OAuth
realm="",oauth_timestamp="1243392158",oauth_nonce="VsaPHb",oauth_consumer_key="xxxxxxxxxxxxxxxxxx",oauth_token="xxxxxx-xxxx-xxxxxxxxxxxxxx",oauth_version="1.0",oauth_signature_method="HMAC-SHA1",oauth_signature="xxxxxxxxxxxxxxxxxxxx"'
In the above header value, check that the "oauth_signature" is decoded properly. That is, it should not contain values like: %3D. You can use this tool to decode the string.
This has worked for me. Hope it helps someone.

Resources