Closed aixi88 closed 4 years ago
Hello @aixi88,
I have no idea what you mean, what you are trying to do, what works, what does not work and what you expect for the end result to be.
Your code cannot be read because it is not formatted at all.
I am closing this ticket - feel free reopen after rectifying these matters.
Regards.
@dsuch sorry ,My English is not good, so the expression is not very clear, the following code upload can not be found in the service, unless you change the class so_dispatchlist (Base) to class so_dispatchlist (object)
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
from zato.server.service import Service
class so_dispatchlist(Base):
__tablename__ = 'so_dispatchlist'
ccode = Column(String(200), unique=True, nullable=False)
ccuscode = Column(String(200), nullable=False)
cinvcode = Column(String(1000), nullable=True)
fh_iquantity = Column(Numeric(), nullable=False)
class CustomerConsignmentService(Service):
class SimpleIO:
input_required = ('ccuscode')
output_required = ('ccode', 'so_dispatchlist_list')
def handle(self):
pass
Ok, but I do not understand what does not work exactly, what do you mean by "cannot be found"?
This is an SQLAlchemy class, not a Zato one, and I do not know how they work like exactly.
@dsuch thanks! cannot be found on : http:// 8183/zato/service/?cluster=1 ,after upload services
Do you know that there is a file called server.log which contains various details, including exceptions or errors?
@dsuch thank you.I'll find it myself.
I see - let me explain. A file called server.log is one of the log files that exist for each server. This one is the main one where you will likely find an explanation, a Python traceback, with details that prevent Zato from deploying your service.
You need to somehow SSH into your server and find the file. I am not really familiar with Docker so I do not know how to use SSH with Swarm.
@dsuch I found out why, because there was no primary_key,thank you!
class so_dispatchlist(Base):
__tablename__ = 'so_dispatchlist'
ccode = Column(String(200), primary_key=True)
ccuscode = Column(String(200), nullable=False)
cinvcode = Column(String(1000), nullable=True)
fh_iquantity = Column(Numeric(), nullable=False)
OK, this is good to hear.
The following code changes Base to object that can be uploaded,why? thanks!
from sqlalchemy import Numeric, String, Column from sqlalchemy.ext.declarative import declarative_base Base = declarative_base() from zato.server.service import Service
class so_dispatchlist(Base):
class CustomerConsignmentService(Service): class SimpleIO: input_required = ('ccuscode') output_required = ('ccode', 'so_dispatchlist_list')