我已将WSDL(http://services.cuberoute.com/axis2/services/ShipmentService.wsdl)导入Visual Studio中的.net项目中作为Web参考。我创建我的ShipmentRequest。当我尝试使用ShipmentService提交请求时,得到的响应为“ null java.lang.NullPointerException”。
Dim address As New Descartes.Address
address.addressLine1 = "1 North Road"
address.addressLine2 = ""
address.city = "Boston"
address.stateCode = "MA"
address.postalCode = "02115"
address.countryCode = "USA"
Dim item As New Descartes.Item()
item.description = "Item"
item.custom = "XS001-P9930"
item.pieceCount = 1
item.weight = 300
Dim invoice As New Descartes.Invoice
invoice.custom = "9991009"
invoice.comment = ""
invoice.name = ""
invoice.items = {item}
Dim requiredDate As New Descartes.Attribute
requiredDate.name = "RequiredDate"
requiredDate.value = "08/10/2019"
Dim transaction As New Descartes.ShipmentRequest()
transaction.operationCode = Descartes.Operation.Edit
transaction.address = address
transaction.customerFirstName = ""
transaction.customerFirstName = ""
transaction.customerCompanyName = "Company name"
transaction.customerID = "99999"
transaction.invoices = {invoice}
transaction.shipmentTypeSpecified = True
transaction.shipmentType = Descartes.ShipmentType.CustomerDelivery
transaction.scheduledDeliveryDate = "2019-08-10T12:00:00"
transaction.sellingStoreNumber = "100002"
transaction.fulfillingStoreNumber = "100002"
transaction.username = "XXXXX"
transaction.passwordHash = "XXXXX"
transaction.organizationKey = "XXXXX"
Dim ship As New Descartes.ShipmentService
Dim the_response As Descartes.ShipmentResponse()
the_response = ship.shipment({transaction})
Response.Write(the_response(0).response.responseCode & "<br>")
Response.Write(the_response(0).response.responseDescription & "<br>")
错误是:
responseCode = 1
responseDescription = null
java.lang.NullPointerException
at com.cuberoute.operation.oe.shipment.ShipmentRequestAdapter.getParameterValue(ShipmentRequestAdapter.java:1750)
at com.cuberoute.operation.oe.shipment.ShipmentRequestAdapter.getParameterValues(ShipmentRequestAdapter.java:1082)
at com.cuberoute.director.function.FunctionBase.getParts(FunctionBase.java:210)
at com.cuberoute.operation.oe.shipment.ShipmentPusher.push(ShipmentPusher.java:169)
at com.cuberoute.director.webservice.functions.shipment.ShipmentFunction.push(ShipmentFunction.java:51)
at com.cuberoute.director.webservice.functions.shipment.ShipmentFunction.run(ShipmentFunction.java:93)
at com.cuberoute.director.Director.demux(Director.java:488)
at com.cuberoute.director.webservice.functions.ShipmentFunction.run(ShipmentFunction.java:26)
at com.cuberoute.director.Director.service(Director.java:356)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.cuberoute.servlet.LabelThreadFilter.doFilter(LabelThreadFilter.java:30)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.cuberoute.servlet.DatabaseConnectionFilter.doFilter(DatabaseConnectionFilter.java:100)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:470)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:615)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:311)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:776)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:705)
at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:898)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
at java.lang.Thread.run(Thread.java:701)