[xgws-dev] CVS Update: codes/xsul/java/tests/xsul/wsif
Aleksander Andrzej Slominski
xgws-dev_at_extreme.indiana.edu
Mon Feb 20 03:01:20 2006
aslom 06/02/20 03:00:29
Added: xsul/java/tests/xsul/wsif README.txt XwsifTestClient.java
XwsifTestServer.java XwsifTestService.java
XwsifTestService.wsdl XwsifTestService.xsdconfig
XwsifTestServiceImpl.java
Log:
seed xwsif unit tests
Revision Changes Path
1.1 codes/xsul/java/tests/xsul/wsif/README.txt
Index: README.txt
===================================================================
*> Set local classapth (run classpath.bat or source classpath.sh)
*> Start test server in a separate window
start java -Dlog xsul.wsif.XwsifTestServer 1234
*> Run client
java xsul.dii.XsulDynamicInvoker tests/xsul/wsif/XwsifTestService.wsdl executeInputOnly baza
java xsul.dii.XsulDynamicInvoker tests/xsul/wsif/XwsifTestService.wsdl executeRequestResponse baza
java xsul.dii.XsulDynamicInvoker tests/xsul/wsif/XwsifTestService.wsdl executeRequestResponseWsdlFault baza
for troubleshooting
java -Dlog xsul.dii.XsulDynamicInvoker tests/xsul/wsif/XwsifTestService.wsdl executeRequestResponse baza
java -Dlog xsul.dii.XsulDynamicInvoker tests/xsul/wsif/XwsifTestService.wsdl executeRequestResponseWsdlFault baza
1.1 codes/xsul/java/tests/xsul/wsif/XwsifTestClient.java
Index: XwsifTestClient.java
===================================================================
/* -*- mode: Java; c-basic-offset: 4; indent-tabs-mode: nil; -*- //------100-columns-wide------>|*/
/*
* Copyright (c) 2005 Extreme! Lab, Indiana University. All rights reserved.
*
* This software is open source. See the bottom of this file for the licence.
*
* based on xsul_dii.XsulDynamicInvoker.java,v 1.8 2005/01/18 10:02:38 aslom Exp $
*/
package xsul.wsif;
import java.io.File;
import java.net.URI;
import org.xmlpull.v1.builder.XmlContainer;
import org.xmlpull.v1.builder.XmlElement;
import org.xmlpull.v1.builder.XmlInfosetBuilder;
import org.xmlpull.v1.builder.XmlNamespace;
import xsul.MLogger;
import xsul.XmlConstants;
import xsul.XsulVersion;
import xsul.lead.LeadContextHeader;
import xsul.util.Util;
import xsul.ws_addressing.WsaEndpointReference;
import xsul.wsif.WSIFMessage;
import xsul.wsif.WSIFOperation;
import xsul.wsif.WSIFPort;
import xsul.wsif.impl.WSIFMessageElement;
import xsul.xhandler_soap_sticky_header.StickySoapHeaderHandler;
import xsul.xwsif_runtime.WSIFClient;
import xsul.xwsif_runtime.WSIFRuntime;
import xsul.xwsif_runtime_async.WSIFAsyncResponsesCorrelator;
import xsul.xwsif_runtime_async_http.XsulSoapHttpWsaResponsesCorrelator;
import xsul.xwsif_runtime_async_msgbox.XsulMsgBoxWsaResponsesCorrelator;
public class XwsifTestClient {
private final static MLogger logger = MLogger.getLogger();
private final static XmlInfosetBuilder builder = XmlConstants.BUILDER;
private final static XmlNamespace NS = builder.newNamespace(
XwsifTestService.XWSDLC_PORTTYPE_QNAME.getNamespaceURI());
private static void usage(String errMsg) {
if(errMsg != null) {
System.err.println("Error: "+errMsg);
}
System.err.println("Usage: [-msgbox URL] [-client_port p] [-count n] [WSDL_URL] [-no_stub]");
System.exit(1);
}
public static void main(String[] args) throws Exception {
XsulVersion.exitIfRequiredVersionMissing(XsulVersion.SPEC_VERSION); //sanity check
runClient(args);
}
private static void runClient(String[] args) throws Exception {
URI base = ((new File(".")).toURI());
String wsdlLoc = null;
System.err.println("CLIENT Starting "+XwsifTestClient.class.getName());
String msgBoxServiceLoc = null;
int clientPort = -1;
int count = 1;
boolean useStub = true;
for (int i = 0; i < args.length; i++)
{
String n = args[i];
if(n.startsWith("-h")) {
usage("");
} else if(n.equals("-msgbox")) {
msgBoxServiceLoc = args[++i];
} else if(n.equals("-client_port")) {
clientPort = Integer.parseInt(args[++i]);
} else if(n.equals("-count")) {
count = Integer.parseInt(args[++i]);
} else if(n.equals("-no_stub")) {
useStub = false;
} else if(!n.startsWith("-")){
wsdlLoc = n;
}
}
boolean selfTesting = System.getProperty("start_server") != null;
if(selfTesting) { // just for testing
// System.out.println("CLIENT Doing starting embedded server (self testing)");
// String wsdlToUse = wsdlLoc != null ? wsdlLoc : EchoAsyncService.DEFAULT_WSDL_LOC;
// EchoAsyncService.main(new String[]{"0", wsdlToUse});
// wsdlLoc = EchoAsyncService.getServiceWsdlLocation();
}
if(wsdlLoc == null) {
usage("WSDL_URL is missing");
}
System.err.println("CLIENT invoking operation echoString using WSDL from "+wsdlLoc);
WSIFAsyncResponsesCorrelator correlator;
if(msgBoxServiceLoc != null){
System.err.println("CLIENT using async correlator with message box service "+msgBoxServiceLoc);
correlator = new XsulMsgBoxWsaResponsesCorrelator(msgBoxServiceLoc);
} else if(clientPort != -1) {
correlator = new XsulSoapHttpWsaResponsesCorrelator(clientPort);
String serverLoc = ((XsulSoapHttpWsaResponsesCorrelator)correlator).getServerLocation();
System.err.println("CLIENT using async correlator that runs web servcer on "+serverLoc);
} else {
correlator = null;
}
WSIFClient wclient = WSIFRuntime.newClient(wsdlLoc)
.useAsyncMessaging(correlator)
.setAsyncResponseTimeoutInMs(33000L); // to simplify testing set to just few seconds
XwsifTestService stub = null;
WSIFOperation operation = null;
WSIFMessage inputMessage = null;
WSIFMessage outputMessage = null;
WSIFMessage faultMessage = null;
if(useStub) {
stub = (XwsifTestService) wclient.generateDynamicStub(XwsifTestService.class);
} else {
WSIFPort wsifPort = wclient.getPort();
operation = wsifPort.createOperation("echoString");
outputMessage = operation.createOutputMessage();
//((XmlElement)outputMessage).removeAllChildren();
faultMessage = operation.createFaultMessage();
//((XmlElement)faultMessage).removeAllChildren();
}
System.err.println("CLIENT sending "+count+" messages");
String METHOD_NAME = "executeInputOnly";
boolean ONEWAY = true;
for (int i = 0; i < count; i++) {
XmlElement in = builder.newFragment(NS, "METHOD_NAME");
in.addElement("cid").addChild("hello"+(i + 1));
if(!useStub) {
//inputMessage = operation.createInputMessage();
//in2 = (XmlElement) inputMessage;
//in2.removeAllChildren(); //ignore whatever WSIF wants to put into message ...
inputMessage = new WSIFMessageElement(in);
}
String s = Util.safeXmlToString((XmlContainer)in);
XmlElement result = null;
if(stub != null) {
System.err.println("CLIENT using stub to send message:\n"+s);
//result =
stub.executeInputOnly(in);
} else {
System.err.println("CLIENT using WSIF to send message:\n"+s);
boolean success;
if(ONEWAY) {
success = operation.executeRequestResponseOperation(
inputMessage, outputMessage, faultMessage);
if(success) {
result = (XmlElement) outputMessage;
} else {
result = (XmlElement) faultMessage;
}
} else {
operation.executeInputOnlyOperation(inputMessage);
success = true;
}
}
System.err.println("CLIENT received message:\n"+
(result != null ? Util.safeXmlToString(result) : "<NONE>"));
}
try {
int secs = 1; //40
System.err.println("CLIENT now will wait for "+secs+" [s]");
Thread.currentThread().sleep(secs * 1000L);
System.err.println("CLIENT waiting finished");
} catch (InterruptedException e) {}
if(selfTesting) {
//try {EchoAsyncService.shutdownServer();} catch(Exception e) {}
}
System.err.println("CLIENT finished");
}
}
/*
* Indiana University Extreme! Lab Software License, Version 1.2
*
* Copyright (c) 2002-2004 The Trustees of Indiana University.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* 1) All redistributions of source code must retain the above
* copyright notice, the list of authors in the original source
* code, this list of conditions and the disclaimer listed in this
* license;
*
* 2) All redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the disclaimer
* listed in this license in the documentation and/or other
* materials provided with the distribution;
*
* 3) Any documentation included with all redistributions must include
* the following acknowledgement:
*
* "This product includes software developed by the Indiana
* University Extreme! Lab. For further information please visit
* http://www.extreme.indiana.edu/"
*
* Alternatively, this acknowledgment may appear in the software
* itself, and wherever such third-party acknowledgments normally
* appear.
*
* 4) The name "Indiana University" or "Indiana University
* Extreme! Lab" shall not be used to endorse or promote
* products derived from this software without prior written
* permission from Indiana University. For written permission,
* please contact http://www.extreme.indiana.edu/.
*
* 5) Products derived from this software may not use "Indiana
* University" name nor may "Indiana University" appear in their name,
* without prior written permission of the Indiana University.
*
* Indiana University provides no reassurances that the source code
* provided does not infringe the patent or any other intellectual
* property rights of any other entity. Indiana University disclaims any
* liability to any recipient for claims brought by any other entity
* based on infringement of intellectual property rights or otherwise.
*
* LICENSEE UNDERSTANDS THAT SOFTWARE IS PROVIDED "AS IS" FOR WHICH
* NO WARRANTIES AS TO CAPABILITIES OR ACCURACY ARE MADE. INDIANA
* UNIVERSITY GIVES NO WARRANTIES AND MAKES NO REPRESENTATION THAT
* SOFTWARE IS FREE OF INFRINGEMENT OF THIRD PARTY PATENT, COPYRIGHT, OR
* OTHER PROPRIETARY RIGHTS. INDIANA UNIVERSITY MAKES NO WARRANTIES THAT
* SOFTWARE IS FREE FROM "BUGS", "VIRUSES", "TROJAN HORSES", "TRAP
* DOORS", "WORMS", OR OTHER HARMFUL CODE. LICENSEE ASSUMES THE ENTIRE
* RISK AS TO THE PERFORMANCE OF SOFTWARE AND/OR ASSOCIATED MATERIALS,
* AND TO THE PERFORMANCE AND VALIDITY OF INFORMATION GENERATED USING
* SOFTWARE.
*/
1.1 codes/xsul/java/tests/xsul/wsif/XwsifTestServer.java
Index: XwsifTestServer.java
===================================================================
/* -*- mode: Java; c-basic-offset: 4; indent-tabs-mode: nil; -*- //------100-columns-wide------>|*/
/*
* Copyright (c) 2005 Extreme! Lab, Indiana University. All rights reserved.
*
* This software is open source. See the bottom of this file for the licence.
*
* based on xsul_dii.XsulDynamicInvoker.java,v 1.8 2005/01/18 10:02:38 aslom Exp $
*/
package xsul.wsif;
import org.xmlpull.v1.builder.XmlInfosetBuilder;
import org.xmlpull.v1.builder.XmlNamespace;
import xsul.MLogger;
import xsul.XmlConstants;
import xsul.XsulVersion;
import xsul.lead.LeadContextHeader;
import xsul.xhandler_soap_sticky_header.StickySoapHeaderHandler;
import xsul.xservo.XService;
import xsul.xservo_soap.XSoapDocLiteralService;
import xsul.xservo_soap_http.HttpBasedServices;
public class XwsifTestServer {
private final static MLogger logger = MLogger.getLogger();
private final static XmlInfosetBuilder builder = XmlConstants.BUILDER;
private static HttpBasedServices httpServices;
private static final String SERVICE_NAME = XwsifTestService.XWSDLC_PORTTYPE_QNAME.getLocalPart();
public static final String DEFAULT_WSDL_LOC = "tests/xsul/wsif/XwsifTestService.wsdl";
private static void usage(String errMsg) {
System.err.println("Usage: [port [wsdlLoc]] ");
System.exit(1);
}
/**
* Launch service from command line
*/
public static void main(String[] args) {
(new XwsifTestServer()).run(args);
}
private void run(String[] args) {
XsulVersion.exitIfRequiredVersionMissing(XsulVersion.SPEC_VERSION); //sanity check
XsulVersion.exitIfRequiredVersionMissing("2.1.17");
if(args.length > 2) usage("");
int tcpPort = args.length > 0 ? Integer.parseInt(args[0]) : 0;
httpServices = new HttpBasedServices(tcpPort);
System.out.println("Server started on "+httpServices.getServerPort());
String wsdlLoc = args.length > 1 ? args[1] : DEFAULT_WSDL_LOC;
System.out.println("Using WSDL for service description from "+wsdlLoc);
XService xsvc = httpServices.addService(
//new XSoapRpcBasedService(SERVICE_NAME, wsdlLoc, new EchoPeerImpl()));
new XSoapDocLiteralService(SERVICE_NAME, wsdlLoc, new XwsifTestServiceImpl()));
xsvc.startService();
System.out.println("Service "+SERVICE_NAME+" started");
System.out.println("Service WSDL available at "+getServiceWsdlLocation());
}
public static String getServiceWsdlLocation() {
return httpServices.getServer().getLocation() + "/"+SERVICE_NAME+"?wsdl";
}
public static void shutdownServer() {
httpServices.getServer().shutdownServer();
}
}
/*
* Indiana University Extreme! Lab Software License, Version 1.2
*
* Copyright (c) 2002-2004 The Trustees of Indiana University.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* 1) All redistributions of source code must retain the above
* copyright notice, the list of authors in the original source
* code, this list of conditions and the disclaimer listed in this
* license;
*
* 2) All redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the disclaimer
* listed in this license in the documentation and/or other
* materials provided with the distribution;
*
* 3) Any documentation included with all redistributions must include
* the following acknowledgement:
*
* "This product includes software developed by the Indiana
* University Extreme! Lab. For further information please visit
* http://www.extreme.indiana.edu/"
*
* Alternatively, this acknowledgment may appear in the software
* itself, and wherever such third-party acknowledgments normally
* appear.
*
* 4) The name "Indiana University" or "Indiana University
* Extreme! Lab" shall not be used to endorse or promote
* products derived from this software without prior written
* permission from Indiana University. For written permission,
* please contact http://www.extreme.indiana.edu/.
*
* 5) Products derived from this software may not use "Indiana
* University" name nor may "Indiana University" appear in their name,
* without prior written permission of the Indiana University.
*
* Indiana University provides no reassurances that the source code
* provided does not infringe the patent or any other intellectual
* property rights of any other entity. Indiana University disclaims any
* liability to any recipient for claims brought by any other entity
* based on infringement of intellectual property rights or otherwise.
*
* LICENSEE UNDERSTANDS THAT SOFTWARE IS PROVIDED "AS IS" FOR WHICH
* NO WARRANTIES AS TO CAPABILITIES OR ACCURACY ARE MADE. INDIANA
* UNIVERSITY GIVES NO WARRANTIES AND MAKES NO REPRESENTATION THAT
* SOFTWARE IS FREE OF INFRINGEMENT OF THIRD PARTY PATENT, COPYRIGHT, OR
* OTHER PROPRIETARY RIGHTS. INDIANA UNIVERSITY MAKES NO WARRANTIES THAT
* SOFTWARE IS FREE FROM "BUGS", "VIRUSES", "TROJAN HORSES", "TRAP
* DOORS", "WORMS", OR OTHER HARMFUL CODE. LICENSEE ASSUMES THE ENTIRE
* RISK AS TO THE PERFORMANCE OF SOFTWARE AND/OR ASSOCIATED MATERIALS,
* AND TO THE PERFORMANCE AND VALIDITY OF INFORMATION GENERATED USING
* SOFTWARE.
*/
1.1 codes/xsul/java/tests/xsul/wsif/XwsifTestService.java
Index: XwsifTestService.java
===================================================================
/* DO NOT MODIFY!!!! This file was generated automatically by xwsdlc (version 2.1.17_SE2) */
package xsul.wsif;
import javax.xml.namespace.QName;
import org.xmlpull.v1.builder.XmlElement;
public interface XwsifTestService {
public final static QName XWSDLC_PORTTYPE_QNAME = new QName("http://example.org/xwsif", "XwsifTestService");
public void executeInputOnly(XmlElement input);
public XmlElement executeRequestResponseWsdlFault(XmlElement input);
public XmlElement executeRequestResponse(XmlElement input);
}
1.1 codes/xsul/java/tests/xsul/wsif/XwsifTestService.wsdl
Index: XwsifTestService.wsdl
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://example.org/xwsif" xmlns:impl="http://example.org/xwsif" xmlns:intf="http://example.org/xwsif" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsi="http://ws-i.org/profiles/basic/1.1/xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<wsdl:types>
<schema targetNamespace="http://example.org/xwsif" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:impl="http://example.org/xwsif" xmlns:intf="http://example.org/xwsif" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<element name="executeRequestResponseWsdlFault">
<complexType>
<sequence>
<element name="cid" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
</element>
<element name="executeRequestResponseWsdlFaultResponse">
<complexType>
<sequence/>
</complexType>
</element>
<element name="executeRequestResponse">
<complexType>
<sequence>
<element name="cid" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
</element>
<element name="executeRequestResponseResponse">
<complexType>
<sequence>
<element name="executeRequestResponseReturn" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
</element>
<element name="executeInputOnly">
<complexType>
<sequence>
<element name="cid" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
</element>
<complexType name="WsdlFaultAException">
<sequence>
<element name="message" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
<element name="WsdlFaultAException" nillable="true" type="impl:WsdlFaultAException"/>
<complexType name="WsdlFaultBException">
<sequence>
<element name="message" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
<element name="WsdlFaultBException" nillable="true" type="impl:WsdlFaultBException"/>
<complexType name="WsdlFaultCException">
<sequence>
<element name="message" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
<element name="WsdlFaultCException" nillable="true" type="impl:WsdlFaultCException"/>
</schema>
</wsdl:types>
<wsdl:message name="executeRequestResponseWsdlFaultRequest">
<wsdl:part element="impl:executeRequestResponseWsdlFault" name="parameters"/>
</wsdl:message>
<wsdl:message name="WsdlFaultBException">
<wsdl:part element="impl:WsdlFaultBException" name="fault"/>
</wsdl:message>
<wsdl:message name="WsdlFaultAException">
<wsdl:part element="impl:WsdlFaultAException" name="fault"/>
</wsdl:message>
<wsdl:message name="executeRequestResponseResponse">
<wsdl:part element="impl:executeRequestResponseResponse" name="parameters"/>
</wsdl:message>
<wsdl:message name="executeRequestResponseWsdlFaultResponse">
<wsdl:part element="impl:executeRequestResponseWsdlFaultResponse" name="parameters"/>
</wsdl:message>
<wsdl:message name="executeInputOnlyRequest">
<wsdl:part element="impl:executeInputOnly" name="parameters"/>
</wsdl:message>
<wsdl:message name="executeRequestResponseRequest">
<wsdl:part element="impl:executeRequestResponse" name="parameters"/>
</wsdl:message>
<wsdl:message name="WsdlFaultCException">
<wsdl:part element="impl:WsdlFaultCException" name="fault"/>
</wsdl:message>
<wsdl:portType name="XwsifTestService">
<wsdl:operation name="executeInputOnly">
<wsdl:input message="impl:executeInputOnlyRequest" name="executeInputOnlyRequest"/>
</wsdl:operation>
<wsdl:operation name="executeRequestResponseWsdlFault">
<wsdl:input message="impl:executeRequestResponseWsdlFaultRequest" name="executeRequestResponseWsdlFaultRequest"/>
<wsdl:output message="impl:executeRequestResponseWsdlFaultResponse" name="executeRequestResponseWsdlFaultResponse"/>
<wsdl:fault message="impl:WsdlFaultAException" name="WsdlFaultAException"/>
<wsdl:fault message="impl:WsdlFaultBException" name="WsdlFaultBException"/>
<wsdl:fault message="impl:WsdlFaultCException" name="WsdlFaultCException"/>
</wsdl:operation>
<wsdl:operation name="executeRequestResponse">
<wsdl:input message="impl:executeRequestResponseRequest" name="executeRequestResponseRequest"/>
<wsdl:output message="impl:executeRequestResponseResponse" name="executeRequestResponseResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="XwsifTestServiceSoapBinding" type="impl:XwsifTestService">
<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="executeInputOnly">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="executeInputOnlyRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
</wsdl:operation>
<wsdl:operation name="executeRequestResponseWsdlFault">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="executeRequestResponseWsdlFaultRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="executeRequestResponseWsdlFaultResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
<wsdl:fault name="WsdlFaultAException">
<wsdlsoap:fault name="WsdlFaultAException" use="literal"/>
</wsdl:fault>
<wsdl:fault name="WsdlFaultBException">
<wsdlsoap:fault name="WsdlFaultBException" use="literal"/>
</wsdl:fault>
<wsdl:fault name="WsdlFaultCException">
<wsdlsoap:fault name="WsdlFaultCException" use="literal"/>
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="executeRequestResponse">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="executeRequestResponseRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="executeRequestResponseResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="XwsifTestServiceService">
<wsdl:port binding="impl:XwsifTestServiceSoapBinding" name="XwsifTestService">
<wsdlsoap:address location="http://localhost:1234/XwsifTestService" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
1.1 codes/xsul/java/tests/xsul/wsif/XwsifTestService.xsdconfig
Index: XwsifTestService.xsdconfig
===================================================================
<!-- .wsdlconf files can override .xsdconfig files -->
<!-- An xsdconfig file must begin with a "config" element in the
http://www.bea.com/2002/09/xbean/config namespace. Also, be sure
to declare any namespaces used to qualify types in your schema (here,
the namespace corresponding to the pol prefix. -->
<xb:config xmlns:xb="http://www.bea.com/2002/09/xbean/config">
<!-- Use the "namespace" element to map a namespace to the Java package
name that should be generated. -->
<xb:namespace uri="http://example.org/xwsif">
<xb:package>xsul.xwsif</xb:package>
</xb:namespace>
</xb:config>
1.1 codes/xsul/java/tests/xsul/wsif/XwsifTestServiceImpl.java
Index: XwsifTestServiceImpl.java
===================================================================
/* -*- mode: Java; c-basic-offset: 4; indent-tabs-mode: nil; -*- //------100-columns-wide------>|*/
/* Copyright (c) 2006 Extreme! Lab, Indiana University. All rights reserved.
* This software is open source. See the bottom of this file for the licence.
* based on xsul_dii.XsulDynamicInvoker.java,v 1.8 2005/01/18 10:02:38 aslom Exp $
*/
package xsul.wsif;
import org.xmlpull.v1.builder.XmlElement;
import org.xmlpull.v1.builder.XmlInfosetBuilder;
import xsul.MLogger;
import xsul.XmlConstants;
public class XwsifTestServiceImpl implements XwsifTestService {
private final static MLogger logger = MLogger.getLogger();
private final static XmlInfosetBuilder builder = XmlConstants.BUILDER;
public void executeInputOnly(XmlElement input) {
logger.info("received "+input);
}
public XmlElement executeRequestResponse(XmlElement input) {
logger.info("received "+input);
XmlElement response = builder.newFragment(input.getNamespace(), "executeRequestResponse");
XmlElement cidEl = input.element(null, "cid");
if(cidEl != null) {
String t = cidEl.requiredTextContent();
response.addElement("cid").addChild(""+t+t);
}
return response;
}
public XmlElement executeRequestResponseWsdlFault(XmlElement input) {
logger.info("received "+input);
return input;
//el = new Element(<message>A</message>)
//TODO: throw new WsdlFaultAException(el)
//TODO: throw new WsdlFaultBException(el)
}
}
/*
* Indiana University Extreme! Lab Software License, Version 1.2
*
* Copyright (c) 2002-2004 The Trustees of Indiana University.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* 1) All redistributions of source code must retain the above
* copyright notice, the list of authors in the original source
* code, this list of conditions and the disclaimer listed in this
* license;
*
* 2) All redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the disclaimer
* listed in this license in the documentation and/or other
* materials provided with the distribution;
*
* 3) Any documentation included with all redistributions must include
* the following acknowledgement:
*
* "This product includes software developed by the Indiana
* University Extreme! Lab. For further information please visit
* http://www.extreme.indiana.edu/"
*
* Alternatively, this acknowledgment may appear in the software
* itself, and wherever such third-party acknowledgments normally
* appear.
*
* 4) The name "Indiana University" or "Indiana University
* Extreme! Lab" shall not be used to endorse or promote
* products derived from this software without prior written
* permission from Indiana University. For written permission,
* please contact http://www.extreme.indiana.edu/.
*
* 5) Products derived from this software may not use "Indiana
* University" name nor may "Indiana University" appear in their name,
* without prior written permission of the Indiana University.
*
* Indiana University provides no reassurances that the source code
* provided does not infringe the patent or any other intellectual
* property rights of any other entity. Indiana University disclaims any
* liability to any recipient for claims brought by any other entity
* based on infringement of intellectual property rights or otherwise.
*
* LICENSEE UNDERSTANDS THAT SOFTWARE IS PROVIDED "AS IS" FOR WHICH
* NO WARRANTIES AS TO CAPABILITIES OR ACCURACY ARE MADE. INDIANA
* UNIVERSITY GIVES NO WARRANTIES AND MAKES NO REPRESENTATION THAT
* SOFTWARE IS FREE OF INFRINGEMENT OF THIRD PARTY PATENT, COPYRIGHT, OR
* OTHER PROPRIETARY RIGHTS. INDIANA UNIVERSITY MAKES NO WARRANTIES THAT
* SOFTWARE IS FREE FROM "BUGS", "VIRUSES", "TROJAN HORSES", "TRAP
* DOORS", "WORMS", OR OTHER HARMFUL CODE. LICENSEE ASSUMES THE ENTIRE
* RISK AS TO THE PERFORMANCE OF SOFTWARE AND/OR ASSOCIATED MATERIALS,
* AND TO THE PERFORMANCE AND VALIDITY OF INFORMATION GENERATED USING
* SOFTWARE.
*/