Sorry, to rephrase my problem...I am trying to pass a custom type as a single request parameter, but the server app is indicating that I am passing two parameters. How do I setup my type schema and/or java code correctly?
________________________________ From: Vinh Nguyen (vinguye2) Sent: Monday, October 30, 2006 11:41 PM To: [email protected] Subject: non-anonymous complex type Hi all, I'm trying to define a non-anonymous, custom complex type so that I can pass it as a single request parameter. But, I am running into some problems. My custom type is defined as: <xsd:schema elementFormDefault="qualified" targetNamespace="http://cisco.com/muse/demo/cap/box <http://cisco.com/muse/demo/cap/box> "> <xsd:complexType name="BoxType"> <xsd:sequence> <xsd:element name="width" type="xsd:integer"/> <xsd:element name="height" type="xsd:integer"/> </xsd:sequence> </xsd:complexType> <xsd:element name="BoxOperation" type="box:BoxType" /> <xsd:element name="BoxOperationResponse" type="box:BoxType" /> </xsd:schema> The java code for my operation is: public Element boxOperation(Element param1) throws Exception { BoxOperationDocument doc = BoxOperationDocument.Factory.parse(param1.getParentNode()); BoxType type = doc.getBoxOperation(); type.setWidth(type.getWidth().add(BigInteger.valueOf(100))); type.setHeight(type.getHeight().add(BigInteger.valueOf(100))); return XmlUtils.getFirstElement(doc.getDomNode()); } The client code is: public String testBoxOperation() throws SoapFault { BoxOperationDocument doc = BoxOperationDocument.Factory.newInstance(); BoxType box = doc.addNewBoxOperation(); box.setWidth(BigInteger.valueOf(555)); box.setHeight(BigInteger.valueOf(555)); Element param1 = XmlUtils.getFirstElement(doc.getDomNode()); Element body = XmlUtils.createElement(IBoxCapability.OP_QNAME, param1); Element response = invoke(IBoxCapability.OP_URI, body); return XmlUtils.extractText(response); } I am expecting to pass a single object in the request, but I am getting an error indicating that two parameters are expected, not one. Attached is the stack trace. Can anyone tell me what I'm doing wrong? -Vinh
