walmartlabs / partnerapi_sdk_dotnet

Walmart Partner API SDK for .NET
Other
14 stars 16 forks source link

Can't Provide shipping Updates for orders #13

Closed nafberger closed 5 years ago

nafberger commented 5 years ago

Hi, I am using your sample application to send shipping updates to Walmart, the code does not work. here is the error:

{ "errors": { "error": [ { "code": "INVALID_REQUEST_CONTENT.GMP_ORDER_API", "description": "com.sun.istack.SAXParseException2; lineNumber: 2; columnNumber: 1; unexpected element (uri:\"\", local:\"orderShipment\"). Expected elements are <{}Cause>,<{}Error>,<{}GatewayError>,<{}Orders>,<{}ServiceHeader>,<{}ServiceResponse>,<{}entity>,<{http://walmart.com/}error>,<{http://walmart.com/}errors>,<{}list>,<{http://walmart.com/mp/orders}list>,<{http://walmart.com/mp/v3/orders}list>,<{}order>,<{http://walmart.com/mp/orders}order>,<{http://walmart.com/mp/v3/orders}order>,<{http://walmart.com/mp/orders}orderCancellation>,<{http://walmart.com/mp/v3/orders}orderCancellation>,<{http://walmart.com/mp/orders}orderRefund>,<{http://walmart.com/mp/v3/orders}orderRefund>,<{http://walmart.com/mp/orders}orderShipment>,<{http://walmart.com/mp/v3/orders}orderShipment>,<{}ordersList>", "info": "Request content is invalid.", "severity": "ERROR", "category": "DATA", "causes": [], "errorIdentifiers": { "entry": [] } } ] } }

nafberger commented 5 years ago

Here is the XML I am using which is exactly like the XML sample file you provided in this place

C:\Desktop\partnerapi_sdk_dotnet-master\partnerapi_sdk_dotnet-master\Sample\bin\Debug\netcoreapp2.0\resources\requestExamples\v3\shippingOrder.xml

test (3).txt

nafberger commented 5 years ago

image

nafberger commented 5 years ago

Roman, Please, can u help me on this, or can you please put me in touch with the IT guys in Walmart

weirdian2k3 commented 5 years ago

@nafberger hey, I'm just a random dude also using this library, but from the error message, it looks like it's not happy with the namespace for the root element.

Could you try changing line 2 from <orderShipment xmlns:ns2="http://walmart.com/mp/v3/orders" xmlns:ns3="http://walmart.com/"> to <orderShipment xmlns="http://walmart.com/mp/v3/orders" xmlns:ns3="http://walmart.com/"> and see what happens?

nafberger commented 5 years ago

I Will Try Your Solution And I Will Report Back, Thanks For Trying To Help me

nafberger commented 5 years ago

And You are able to send shipping notification updates to Walmart?

weirdian2k3 commented 5 years ago

Not yet. I'm working through the integration but haven't gotten to the part where I test the order.

I just read the error message and it said it was reading a (uri:"", local:"orderShipment") element that it didn't want and that <{http://walmart.com/mp/v3/orders}orderShipment> was what it was looking for, so it seemed sound to attach the http://walmart.com/mp/v3/orders namespace to orderShipment

nafberger commented 5 years ago

Huge Thanks for trying to help me. your solution got me halfway thru. but it's still not solved.

let me explain. as indicated in the documentation, you can submit the payload in XML or JSON format.

the JSON format used to throw a different funny error so I abandoned it. now, with your advice, I fixed the XML by removing the ":ns2" string. Now, the XML got validated and accepted,, but now it's back to that same error coming up when using the JSON way.

here is the error

{ "errors": { "error": [ { "code": "INVALID_REQUEST_CONTENT.GMP_ORDER_API", "field": "data", "description": "Unable to process this request. Trying to Ship shipped Line(s) or The Line: 3 of PO: 1786494620194 doesn't have enough quantity to ship requested quantity :: 1 qtyAvailableToShip :: 0", "info": "Request content is invalid.", "severity": "ERROR", "category": "DATA", "causes": [], "errorIdentifiers": { "entry": [] } } ] } }

weirdian2k3 commented 5 years ago

That appears to be indicating that there are no items left to ship for line 3 of that order. I would confirm via the portal that the order is not already shipped and has not been cancelled

On Oct 9, 2018, at 9:44 PM, nafberger notifications@github.com<mailto:notifications@github.com> wrote:

Huge Thanks for trying to help me. your solution got me halfway thru. but it's still not solved.

let me explain. as indicated in the documentation, you can submit the payload in XML or JSON format.

the JSON format used to throw a different funny error so I abandoned it. now, with your advice, I fixed the XML by removing the ":ns2" string. Now, the XML got validated and accepted,, but now it's back to that same error coming up when using the JSON way.

here is the error

{ "errors": { "error": [ { "code": "INVALID_REQUEST_CONTENT.GMP_ORDER_API", "field": "data", "description": "Unable to process this request. Trying to Ship shipped Line(s) or The Line: 3 of PO: 1786494620194 doesn't have enough quantity to ship requested quantity :: 1 qtyAvailableToShip :: 0", "info": "Request content is invalid.", "severity": "ERROR", "category": "DATA", "causes": [], "errorIdentifiers": { "entry": [] } } ] } }

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/walmartlabs/partnerapi_sdk_dotnet/issues/13#issuecomment-428409636, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AGMZjQBBVNwmvFLziB8zbEgPdewatxFTks5ujVEOgaJpZM4XMC9g.

nafberger commented 5 years ago

U might be right. I will try tomorrow the same with an unshipped order. will update you

nafberger commented 5 years ago

Thank God, it works now. Huge thanks for helping me out