antelder 2003/01/13 12:59:14 Modified: java/samples/customfactory/client CustomServiceImpl.java Log: Fix to work with recent context change ...after fighting off the urge just to delete the sample :) Revision Changes Path 1.2 +40 -2 xml-axis-wsif/java/samples/customfactory/client/CustomServiceImpl.java Index: CustomServiceImpl.java =================================================================== RCS file: /home/cvs/xml-axis-wsif/java/samples/customfactory/client/CustomServiceImpl.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- CustomServiceImpl.java 20 Dec 2002 12:53:21 -0000 1.1 +++ CustomServiceImpl.java 13 Jan 2003 20:59:14 -0000 1.2 @@ -24,10 +24,12 @@ import javax.xml.namespace.QName; import org.apache.wsif.WSIFConstants; -import org.apache.wsif.base.WSIFServiceImpl; import org.apache.wsif.WSIFException; +import org.apache.wsif.WSIFMessage; import org.apache.wsif.WSIFPort; import org.apache.wsif.WSIFService; +import org.apache.wsif.base.WSIFClientProxy; +import org.apache.wsif.base.WSIFDefaultMessage; import org.apache.wsif.compiler.schema.tools.Schema2Java; import org.apache.wsif.compiler.util.TypeMapping; import org.apache.wsif.compiler.util.Utils; @@ -38,8 +40,8 @@ import org.apache.wsif.util.WSIFPluggableProviders; import org.apache.wsif.util.WSIFUtils; import org.apache.wsif.wsdl.extensions.java.JavaBinding; -import org.apache.wsif.base.*; import org.w3c.dom.Element; + import com.ibm.wsdl.util.xml.QNameUtils; /** @@ -65,6 +67,7 @@ private String preferredPort = null; private Map typeReg = null; private Port chosenPort = null; + private WSIFMessage context; /** * Create a WSIF service instance from WSDL document URL. @@ -940,6 +943,40 @@ return def; } + /** + * Gets the context information for this WSIFService. + * @return context + */ + public WSIFMessage getContext() throws WSIFException { + Trc.entry(this); + WSIFMessage contextCopy; + if (this.context == null) { + contextCopy = new WSIFDefaultMessage(); + } else { + try { + contextCopy = (WSIFMessage) this.context.clone(); + } catch (CloneNotSupportedException e) { + throw new WSIFException( + "CloneNotSupportedException cloning context", e); + } + } + Trc.exit(contextCopy); + return contextCopy; + } + + /** + * Sets the context information for this WSIFService. + * @param WSIFMessage the new context information + */ + public void setContext(WSIFMessage context) { + Trc.entry(this, context); + if (context == null) { + throw new IllegalArgumentException("context must not be null"); + } + this.context = context; + Trc.exit(); + } + public String deep() { String buff = ""; try { @@ -955,6 +992,7 @@ buff += "\ntypeMapInitialised:" + typeMapInitialised; buff += "\npreferredPort:" + (preferredPort == null ? "null" : preferredPort); buff += "\nchosenPort:" + Trc.brief(chosenPort); + buff += "\ncontext:" + context; } catch (Exception e) { Trc.exceptionInTrace(e); }