0 / 0 / 0
Регистрация: 12.10.2007
Сообщений: 522
|
|
1 | |
Web Service Consumer12.07.2012, 16:59. Показов 13993. Ответов 9
Метки нет (Все метки)
При вызове ошибка. Кто встречал?
Web Service ** method ** error Error invoking operation: javax.xml.rpc.JAXRPCException: number of parameters passed in (14) doesnt match the number of IN/INOUT parameters (16) from the addParameter() calls.
0
|
12.07.2012, 16:59 | |
Ответы с готовыми решениями:
9
WSDL-Web Service Consumer Проблема с web service consumer Lotus Web Service Consumer + Http Авторизация - Как? Web service consumer ошибка при отсылки больших пакетов |
0 / 0 / 0
Регистрация: 18.08.2008
Сообщений: 1,698
|
|
12.07.2012, 17:22 | 2 |
и?
Ну правильное кол-во входящих/исходящих параметров
0
|
0 / 0 / 0
Регистрация: 19.04.2009
Сообщений: 2,219
|
|
12.07.2012, 17:42 | 3 |
После импрота wsdl web-сервис не менялся?
0
|
0 / 0 / 0
Регистрация: 12.10.2007
Сообщений: 522
|
|
12.07.2012, 18:26 | 4 |
Сообщение от nvy
Причем через CreateObject("Microsoft.XMLHTTP") метод вызывается...(
0
|
0 / 0 / 0
Регистрация: 19.04.2009
Сообщений: 2,219
|
|
13.07.2012, 15:50 | 5 |
Недавно мучился с веб-сервисами — жабовый отказывался подключаться через ls2j, лс-скриптовый не позволял "развернуть" сложную структуру возвращаемых данных. В итоге остановился на варианте с жаба-агентом, который сохраняет полученные данные в документе-запросе. Дополнительный плюс такого решения в том, что можно скрыть от пользователя логин/пароль провайдера веб-сервиса в настроечном документе, видимом только серверу и админу.
0
|
0 / 0 / 0
Регистрация: 12.10.2007
Сообщений: 522
|
|
16.07.2012, 17:03 | 6 |
Сообщение от nvy
0
|
1 / 1 / 0
Регистрация: 07.12.2009
Сообщений: 1,197
|
|
16.07.2012, 22:01 | 7 |
Сообщение от susinmn
0
|
0 / 0 / 0
Регистрация: 12.10.2007
Сообщений: 522
|
|
17.07.2012, 12:15 | 8 |
Сообщение от VladSh
Код
[ATTACH]5199.IPB[/ATTACH] [ATTACH]5200.IPB[/ATTACH] Код
package com.sybase.ase.ws.udws1000.wsu_prc_f_credit_op_load3.ws; public class UdwsSoapBindingStub extends lotus.domino.websvc.client.Stub implements com.sybase.ase.ws.udws1000.wsu_prc_f_credit_op_load3.ws.Udws_Port { public UdwsSoapBindingStub(java.net.URL endpointURL, javax.xml.rpc.Service service) throws lotus.domino.types.Fault { super(endpointURL, service); } public com.sybase.ase.ws.producer.DataReturn[] us_wsu_prc_f_credit_op_load(java.lang.String f_contr_name, int c_addtype, java.lang.String op_date_time, java.lang.String op_date_begin, java.lang.String op_date_end, float op_value_od, float op_value_prc, float op_value_comis, java.lang.String ln_address, int chislo, float sum_credit, int rate_type, int month_count, float eg_plat, javax.xml.rpc.holders.StringHolder notice_descr, java.lang.String username, java.lang.String password) throws java.rmi.RemoteException { lotus.domino.websvc.client.Call _call = createCall("us_wsu_prc_f_credit_op_load"); java.lang.Object _resp = _call.invoke(new java.lang.Object[] {f_contr_name, new java.lang.Integer(c_addtype), op_date_time, op_date_begin, op_date_end, new java.lang.Float(op_value_od), new java.lang.Float(op_value_prc), new java.lang.Float(op_value_comis), ln_address, new java.lang.Integer(chislo), new java.lang.Float(sum_credit), new java.lang.Integer(rate_type), new java.lang.Integer(month_count), new java.lang.Float(eg_plat), username, password}); notice_descr.value = (java.lang.String) _call.convertOutputParam("", "notice_descr", java.lang.String.class); return (com.sybase.ase.ws.producer.DataReturn[]) _call.convert(_resp, com.sybase.ase.ws.producer.DataReturn[].class); } } Код
package com.sybase.ase.ws.udws1000.wsu_prc_f_credit_op_load3.ws; public class Udws_ServiceLocator extends lotus.domino.websvc.client.Service implements com.sybase.ase.ws.udws1000.wsu_prc_f_credit_op_load3.ws.Udws_Service { public Udws_ServiceLocator() { super("UrnWsWsu_prc_f_credit_op_load3Udws1000WsAseSybaseComudws"); } // Use to get a proxy class for udws private final java.lang.String udws_address = "http://xxx.xxx.xxx.xxx:xxxx/services/ws/wsu_prc_f_credit_op_load3"; public java.lang.String getUdwsAddress() { return udws_address; } // The WSDD service name defaults to the port name. private final java.lang.String UdwsWSDDServiceName = "udws.udws"; public com.sybase.ase.ws.udws1000.wsu_prc_f_credit_op_load3.ws.Udws_Port getUdws() throws javax.xml.rpc.ServiceException { java.net.URL endpoint; try { endpoint = new java.net.URL(udws_address); } catch (java.net.MalformedURLException e) { throw new javax.xml.rpc.ServiceException(e); } return getUdws(endpoint); } public com.sybase.ase.ws.udws1000.wsu_prc_f_credit_op_load3.ws.Udws_Port getUdws(java.net.URL portAddress) throws javax.xml.rpc.ServiceException { try { com.sybase.ase.ws.udws1000.wsu_prc_f_credit_op_load3.ws.UdwsSoapBindingStub _stub = new com.sybase.ase.ws.udws1000.wsu_prc_f_credit_op_load3.ws.UdwsSoapBindingStub(portAddress, thys); _stub.setPortName(UdwsWSDDServiceName); return _stub; } catch (lotus.domino.types.Fault e) { return null; } } /** * For the given interface, get the stub implementation. * If thys service has no port for the given interface, * then ServiceException is thrown. */ public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException { try { if (com.sybase.ase.ws.udws1000.wsu_prc_f_credit_op_load3.ws.Udws_Port.class.isAs signableFrom(serviceEndpointInterface)) { com.sybase.ase.ws.udws1000.wsu_prc_f_credit_op_load3.ws.UdwsSoapBindingStub _stub = new com.sybase.ase.ws.udws1000.wsu_prc_f_credit_op_load3.ws.UdwsSoapBindingStub(new java.net.URL(udws_address), thys); _stub.setPortName(UdwsWSDDServiceName); return _stub; } } catch (java.lang.Throwable t) { throw new javax.xml.rpc.ServiceException(t); } throw new javax.xml.rpc.ServiceException("There is no stub implementation for the interface: " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName())); } /** * For the given interface, get the stub implementation. * If thys service has no port for the given interface, * then ServiceException is thrown. */ public java.rmi.Remote getPort(javax.xml.namespace.QName portName, Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException { if (portName == null) { return getPort(serviceEndpointInterface); } String inputPortName = portName.getLocalPart(); if ("udws".equals(inputPortName)) { return getUdws(); } else { java.rmi.Remote _stub = getPort(serviceEndpointInterface); ((lotus.domino.websvc.client.Stub) _stub).setPortName(portName); return _stub; } } public javax.xml.namespace.QName getServiceName() { return new javax.xml.namespace.QName("urn:ws.wsu_prc_f_credit_op_load3.udws1000.ws.ase.sybase.com", "udws"); } private java.util.HashSet ports = null; public java.util.Iterator getPorts() { if (ports == null) { ports = new java.util.HashSet(); ports.add(new javax.xml.namespace.QName("udws")); } return ports.iterator(); } } Код
import javax.xml.rpc.holders.StringHolder; import com.sybase.ase.ws.producer.DataReturn; import com.sybase.ase.ws.udws1000.wsu_prc_f_credit_op_load3.ws.UdwsSoapBindingStub; import com.sybase.ase.ws.udws1000.wsu_prc_f_credit_op_load3.ws.Udws_ServiceLocator; public class FrontWSDL { public String ExportToFront(String f_contr_name, int c_addtype, String op_date_time, String op_date_begin, String op_date_end, float op_value_od, float op_value_prc, float op_value_comis, String ln_address, int chislo, float sum_credit, int rate_type, int month_count, float eg_plat, String username, String password) { try { StringHolder notice_descr = new StringHolder(); UdwsSoapBindingStub stub = (UdwsSoapBindingStub) new Udws_ServiceLocator().getUdws(); DataReturn[] DataReturn = stub.us_wsu_prc_f_credit_op_load(f_contr_name, c_addtype, op_date_time, op_date_begin, op_date_end, op_value_od, op_value_prc, op_value_comis, ln_address, chislo,sum_credit, rate_type, month_count, eg_plat, notice_descr, username, password); return notice_descr.value; } catch(Exception e) { e.printStackTrace(); } return null; } } Код
import java.util.Date; import java.util.Vector; import java.text.*; import lotus.domino.*; public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(); AgentContext agentContext = session.getAgentContext(); Database db = agentContext.getCurrentDatabase(); // Used for running agent on server with docID being passed from the calling action Agent agent = agentContext.getCurrentAgent(); String paramid = agent.getParameterDocID(); Document doc = db.getDocumentByID(paramid); SimpleDateFormat mmyyyymmdd; Date dt; Vector times; Object time; String f_contr_name = ""; int c_addtype = 0; String op_date_time = ""; String op_date_begin = ""; String op_date_end = ""; float op_value_od = 0; float op_value_prc = 0; float op_value_comis = 0; String ln_address = ""; int chislo = 0; float sum_credit = 0; int rate_type = 0; int month_count = 0; float eg_plat = 0; String ResponseText = ""; String username = ""; String password = ""; f_contr_name=doc.getItemValueString("Dogovor_N"); times = doc.getItemValueDateTimeArray("Dop_solg"); time = times.elementAt(0); if (time.getClass().getName().endsWith("DateTime")) { mmyyyymmdd = new SimpleDateFormat("yyyyMMdd"); dt = session.createDateTime(((DateTime)time).getLocalTime()).toJavaDate(); op_date_time = mmyyyymmdd.format(dt); System.out.println("op_date_time: "+op_date_time); } ln_address=doc.getItemValueString("LN_For_Front"); username="xxx"; password="xxxxxxx"; if (doc.getItemValueString("Tip").equals("1")) { c_addtype=1; System.out.println("c_addtype: "+c_addtype); //op_date_begin times = doc.getItemValueDateTimeArray("Data"); time = times.elementAt(0); if (time.getClass().getName().endsWith("DateTime")) { mmyyyymmdd = new SimpleDateFormat("yyyyMMdd"); dt = session.createDateTime(((DateTime)time).getLocalTime()).toJavaDate(); op_date_begin = mmyyyymmdd.format(dt); System.out.println("op_date_begin: "+op_date_begin); } chislo=doc.getItemValueInteger("Chislo"); System.out.println("chislo: "+chislo); } ............. FrontWSDL stub = (FrontWSDL) new FrontWSDL(); ResponseText = stub.ExportToFront(f_contr_name, c_addtype, op_date_time, op_date_begin, op_date_end, op_value_od, op_value_prc, op_value_comis, ln_address, chislo, sum_credit, rate_type, month_count, eg_plat, username, password); System.out.println(ResponseText); doc.replaceItemValue("Front_Info", ResponseText); doc.save(true, false); } catch(Exception e) { e.printStackTrace(); } } } Код (Text): Dim ws As New NotesUiWorkspace Dim s As New NotesSession Dim db As NotesDatabase Dim jAgent As NotesAgent Dim uidoc As NotesUiDocument Dim doc As NotesDocument Dim DocForJavaAgent As NotesDocument Set db = s.CurrentDatabase Set uidoc = ws.CurrentDocument Set doc = uidoc .Document Set jAgent = db.GetAgent("ExportToFrontJavaAgent") Set DocForJavaAgent=db.CreateDocument DocForJavaAgent.Form="DocForJavaAgent" Call DocForJavaAgent.ReplaceItemValue("$PublicAccess","1") DocForJavaAgent.Front_Info="Ошибка вызова метода, обратитесь к разработчикам" Call PasteFieldDocForJavaAgent(DocForJavaAgent, doc, s.UserName) запись данных в промежуточный документ Call DocForJavaAgent.MakeResponse(doc) Call DocForJavaAgent.Save(1,0) Call jAgent.Run(DocForJavaAgent.NoteID) DocForJavaAgentUnid=DocForJavaAgent.UniversalID Delete DocForJavaAgent Set DocForJavaAgent=db.GetDocumentByUNID(DocForJavaAgentUnid) If DocForJavaAgent.Front_Info(0)<>"" Then Messagebox DocForJavaAgent.Front_Info(0), 16, "Внимание!" Exit Sub End If
0
|
0 / 0 / 0
Регистрация: 23.08.2008
Сообщений: 6,252
|
|
17.07.2012, 13:55 | 9 |
небольшое отступление... (просто для общей информации, тем кто поленился вникать, про веб сервисы :trash: )
очень упрощённо веб сервисы как таковые - некое соглашение о передаче инфы, кот. (инфу) передают поверх http (часто) формат данных - xml для "удобства" делают обертки - хмл заворачивают в классы и контролируют ошибки (это уже привязано к конкретной реализации в ЯП) тем не менее - ничего не мешает организовать обмен поверх хттп хмл-ом... :lol:
0
|
0 / 0 / 0
Регистрация: 19.04.2009
Сообщений: 2,219
|
|
17.07.2012, 14:23 | 10 |
Код
тем не менее - ничего не мешает организовать обмен поверх хттп хмл-ом... wink.gif
0
|
17.07.2012, 14:23 | |
17.07.2012, 14:23 | |
Помогаю со студенческими работами здесь
10
Подключить Java Web-servece Consumer Через Ls2j Web Service Web Service Web Service Искать еще темы с ответами Или воспользуйтесь поиском по форуму: |