WSDL-Web Service Consumer

susinmn

Well-known member
16.10.2007
529
3
#1
Втянул wsdl через Web Service Consumer.
Как теперь подключить эту библиотеку в java-агент?
Можно ли работать с библиотекой, если ее подключить к ls-агенту (Use "usr")?

Заранее спасибо.

Update: подключил библиотеку у ls-агенту
<!--shcode--><pre><code class='ls'>Option Public
Use "usr"
Uselsx "*javacon"[/CODE]
в агенте
<!--shcode--><pre><code class='ls'>Sub Initialize
Dim myurl As JAVACLASS
Dim myurlconnection As JAVACLASS
Dim URL As JavaObject
Dim URLConnection As JavaObject
Set jsess = New JAVASESSION()
Set myurl = jsess.GetClass("WsSoapHttpStub")[/CODE]
Error: ClassNotFound

Update2: GetClass получилось так (т.е. нужно полный путь прописывать)
Set myurl = jsess.GetClass("rcv6/Ws_wsdl/WsSoapHttpStub")
 

Вложения

lmike

нет, пердело совершенство
Lotus team
27.08.2008
6 586
272
#2
если прописали пакедж - то, разумеется, нужен полный путь
 

susinmn

Well-known member
16.10.2007
529
3
#3
теперь не получается создать объект класса(
<div class="sp-wrap"><div class="sp-head-wrap"><div class="sp-head folded clickable">код в LS</div></div><div class="sp-body"><div class="sp-content"><!--shcode--><pre><code class='ls'>Dim Locator As JAVACLASS
Dim SoapHttp As JAVACLASS
Dim LocatorObj As JavaObject
Dim SoapHttpObj As JavaObject
Set jsess = New JAVASESSION()
Set Locator = jsess.GetClass("rcv6/Ws_wsdl/Ws_ServiceLocator")
Set LocatorObj=Locator.CreateObject()[/CODE]
Error: Java constructor failed to execute

Вот
<div class="sp-wrap"><div class="sp-head-wrap"><div class="sp-head folded clickable">класс ServiceLocator</div></div><div class="sp-body"><div class="sp-content"><!--shcode--><pre><code class='java'>package rcv6.Ws_wsdl;

public class Ws_ServiceLocator extends lotus.domino.websvc.client.Service implements rcv6.Ws_wsdl.Ws_Service {

// The WSDD service name defaults to the port name.
private final java.lang.String WsSoapHttpPortWSDDServiceName = "ws.wsSoapHttpPort";

// Use to get a proxy class for wsSoapHttpPort
private final java.lang.String wsSoapHttpPort_address = "http://172.16.3.109:7777/usr-views-ws-context-root/wsSoapHttpPort";

public Ws_ServiceLocator() {
super("HttpRcv6WsWsdlws");
}

public java.lang.String getWsSoapHttpPortAddress() {
return wsSoapHttpPort_address;
}

public rcv6.Ws_wsdl.Ws_Port getWsSoapHttpPort() throws javax.xml.rpc.ServiceException {
java.net.URL endpoint;
try {
endpoint = new java.net.URL(wsSoapHttpPort_address);
}
catch (java.net.MalformedURLException e) {
throw new javax.xml.rpc.ServiceException(e);
}
return getWsSoapHttpPort(endpoint);
}

public rcv6.Ws_wsdl.Ws_Port getWsSoapHttpPort(java.net.URL portAddress) throws javax.xml.rpc.ServiceException {
try {
rcv6.Ws_wsdl.WsSoapHttpStub _stub = new rcv6.Ws_wsdl.WsSoapHttpStub(portAddress, this);
_stub.setPortName(WsSoapHttpPortWSDDServiceName);
return _stub;
}
catch (lotus.domino.types.Fault e) {
return null;
}
}

/**
* For the given interface, get the stub implementation.
* If this 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 (rcv6.Ws_wsdl.Ws_Port.class.isAssignableFrom(serviceEndpointInterface)) {
rcv6.Ws_wsdl.WsSoapHttpStub _stub = new rcv6.Ws_wsdl.WsSoapHttpStub(new java.net.URL(wsSoapHttpPort_address), this);
_stub.setPortName(WsSoapHttpPortWSDDServiceName);
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 this 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 ("wsSoapHttpPort".equals(inputPortName)) {
return getWsSoapHttpPort();
}
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("http://rcv6/Ws.wsdl", "ws");
}

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("wsSoapHttpPort"));
}
return ports.iterator();
}

}[/CODE]
 

lmike

нет, пердело совершенство
Lotus team
27.08.2008
6 586
272
#4
смотрите джава консоль
 

susinmn

Well-known member
16.10.2007
529
3
#5
Вот эту конструкцию
Код:
public Ws_ServiceLocator() {
super("HttpRcv6WsWsdlws");
}
меняю на:
Код:
public Ws_ServiceLocator() {
try {
super("HttpRcv6WsWsdlws");
}
catch (java.lang.Throwable e) {
e.printStackTrace();
}
}
В итоге ловлю
 

Вложения

lmike

нет, пердело совершенство
Lotus team
27.08.2008
6 586
272
#6
я не знаю какие конструкторы присут. у super
ругацо на отсутствие метода
советую отлаживать в нормальных инструментах, а не в убогом доминошном редакторе