MessageChristian, I was reading in the AXIS documentation and found out how to use WRAPPED style calls. This explains my error message below. <arg1> is interpreted as an operation name. (should be the name of the operation with all arguments as childs) Thanks for your hints, i wouldn't have come that far without them. I'm attaching a bit of the Apache documentation for easy follow up...
Thanks Thomas ---------- BEGIN DOC ------------- WSDL2Java Reference -W This turns off the special treatment of what is called "wrapped" document/literal style operations. By default, WSDL2Java will recognize the following conditions: If an input message has is a single part. The part is an element. The element has the same name as the operation The element's complex type has no attributes When it sees this, WSDL2Java will 'unwrap' the top level element, and treat each of the components of the element as arguments to the operation. This type of WSDL is the default for Microsoft .NET web services, which wrap up RPC style arguments in this top level schema element. ---------- END DOC ------------- ----- Original Message ----- From: Faucher, Christian To: [email protected] Sent: Tuesday, February 22, 2005 18:42 Subject: RE : Is this a serious bug in string parameter passing to AXIS 1.2RC2? Thomas, I see. I generated my WSDL using java2wsdl, specifying the proper CLI argument for WRAPPED. I do not use the auto-generated one, which is sligthly different from the one generated with java2wsdl. I couldn't get the auto-generated (?wsdl) to bet ".net friendly", but my java2wsdl one is. Christian Faucher -----Message d'origine----- De : thomas willomitzer [mailto:[EMAIL PROTECTED] Envoy� : mardi, f�vrier 22, 2005 13:38 � : [email protected] Objet : Re: Is this a serious bug in string parameter passing to AXIS 1.2RC2? Christian, Hm. No I didn't change anything in the WSDL file since i don't know where to change from "document" to "wrapped" in the WSDL file. This relates to my question below where i didn't know where to change to wrapped. >>Thanks for your hint. Read it up in the documentation and understand that now. >>How can i specify WRAPPED style parameters? Couldnt find any info in there except hacking the deploy.wsdd after the wsdl2java. Cheers Thomas ----- Original Message ----- From: Faucher, Christian To: [email protected] Sent: Tuesday, February 22, 2005 18:30 Subject: RE : Is this a serious bug in string parameter passing to AXIS 1.2RC2? Thomas, iich.. Sorry for the silly question, but I guess you regenarted your clietn stubs, from your new WSDL? Otherwise, this one beats me. Sorry. Christian -----Message d'origine----- De : thomas willomitzer [mailto:[EMAIL PROTECTED] Envoy� : mardi, f�vrier 22, 2005 13:25 � : [email protected] Objet : Re: Is this a serious bug in string parameter passing to AXIS 1.2RC2? Christian, thanks again. Changed the style to WRAPPED in the .wsdd file (the one generated from wsdl2java as below) and am now getting an error like: (I'm attaching my wsdd file as well below) Do i have to change anything else to make it work again? Sorry for the huge amount of question's but i think i don't understand the behavior that well. ------------------- BEGIN ERROR ------------- No such operation 'arg1' AxisFault faultCode: {http://xml.apache.org/axis/}Client faultSubcode: faultString: No such operation 'arg1' faultActor: faultNode: faultDetail: {http://xml.apache.org/axis/}hostname:willo No such operation 'arg1' at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:2 21) at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:12 8) at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationCo ntext.java:1083) at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1712) at org.apache.crimson.parser.Parser2.content(Parser2.java:1963) at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1691) at org.apache.crimson.parser.Parser2.content(Parser2.java:1963) at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1691) at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:667) at org.apache.crimson.parser.Parser2.parse(Parser2.java:337) at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448) at javax.xml.parsers.SAXParser.parse(SAXParser.java:345) at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext .java:226) at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:645) at org.apache.axis.Message.getSOAPEnvelope(Message.java:424) at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChe cker.java:62) at org.apache.axis.client.AxisClient.invoke(AxisClient.java:173) at org.apache.axis.client.Call.invokeEngine(Call.java:2719) at org.apache.axis.client.Call.invoke(Call.java:2702) at org.apache.axis.client.Call.invoke(Call.java:2378) at org.apache.axis.client.Call.invoke(Call.java:2301) at org.apache.axis.client.Call.invoke(Call.java:1758) at com.company.www.PortTypeBindingStub.testOperation(PortTypeBindingStub.java:1 04) at com.company.www.ServicePortTestCase.test1ServicePortTestOperation(ServicePor tTestCase.java:39) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39 ) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl .java:25) at com.intellij.rt.execution.junit2.JUnitStarter.main(JUnitStarter.java:31) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39 ) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl .java:25) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:78) ------------------- END ERROR ------------- ------------ BEGIN WSDD --------------- <deployment xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java="http://xml.apache.org/axis/wsdd/providers/java"> <!-- Services from ServicePort WSDL service --> <service name="ServicePort" style="WRAPPED" use="literal"> <parameter name="wsdlTargetNamespace" value="http://www.company.com"/> <parameter name="wsdlServiceElement" value="ServicePort"/> <parameter name="wsdlServicePort" value="ServicePort"/> <parameter name="className" value="com.company.www.PortTypeBindingImpl"/> <parameter name="wsdlPortType" value="PortType"/> <operation name="testOperation" qname="testOperation" soapAction="capeconnect:ServicePort:PortType#testOperation" > <parameter qname="arg1" type="tns:string" xmlns:tns="http://www.w3.org/2001/XMLSchema"/> <parameter qname="arg2" type="tns:string" xmlns:tns="http://www.w3.org/2001/XMLSchema"/> <parameter qname="arg3" type="tns:string" xmlns:tns="http://www.w3.org/2001/XMLSchema"/> </operation> <parameter name="allowedMethods" value="testOperation"/> </service> </deployment> ------------ END WSDD --------------- ----- Original Message ----- From: Faucher, Christian To: [email protected] Sent: Tuesday, February 22, 2005 18:02 Subject: RE : Is this a serious bug in string parameter passing to AXIS 1.2RC2? You can specify the style="WRAPPED" attribute in the <service ...style="WRAPPED">...</service>, in the WSDD. Remove the provider="java:RPC" though! Or you can generate your own WSDL using java2wsdl, using a cli arg, which I dont remember the name. Type "/?", shoudl give you more info Christian Faucher -----Message d'origine----- De : thomas willomitzer [mailto:[EMAIL PROTECTED] Envoy� : mardi, f�vrier 22, 2005 12:56 � : [email protected] Objet : Re: Is this a serious bug in string parameter passing to AXIS 1.2RC2? Christian, Thanks for your hint. Read it up in the documentation and understand that now. How can i specify WRAPPED style parameters? Couldnt find any info in there except hacking the deploy.wsdd after the wsdl2java. Thanks a lot Thomas ----- Original Message ----- From: Faucher, Christian To: [email protected] Sent: Tuesday, February 22, 2005 17:39 Subject: RE : Is this a serious bug in string parameter passing to AXIS 1.2RC2? Hi, You WSDL defines a "document" style WS. Documen-style WS are made to receive a bean, with all the parameters in it e.g. public class MyParamsBean { String str1; String str2; } and void yourMethod(MyParamsBean params); If you wish to keep the parameters separated in your method, you should use the WRAPPED style: void yourMethod(String str1, String str2); Hope it helps! Christian Faucher -----Message d'origine----- De : thomas willomitzer [mailto:[EMAIL PROTECTED] Envoy� : mardi, f�vrier 22, 2005 12:35 � : [email protected] Objet : Is this a serious bug in string parameter passing to AXIS 1.2RC2? Hello! I'm having problems with string parameters in AXIS 1.2RC2. I created a simple WSDL to test parameter passing and AXIS doesn't process the parameters correctly on the Server side. Only the first parameter gets set to the value in the request, the 2nd and 3rd are set to null in the service method attached below. I traced the call with tcpmon and everything looks alright (well...as far as I can tell) I assume I'm doing something wrong as this basic behavior is probably working correctly. I am trying to get this work for two days now and don't have any more ideas how to fix that. Please have a look at my WSDL and the TCPMon Trace. I generated the client and server with wsdl2java -s -t file.wsdl Thanks a lot Thomas ------------------ START Service Method --------------- /** * PortTypeBindingImpl.java * * This file was auto-generated from WSDL * by the Apache Axis 1.2RC2 Nov 16, 2004 (12:19:44 EST) WSDL2Java emitter. */ package com.company.www; public class PortTypeBindingImpl implements com.company.www.PortType{ public void testOperation(java.lang.String arg1, java.lang.String arg2, java.lang.String arg3) throws java.rmi.RemoteException { System.out.println("Hello"); } } ------------------ END Service Method --------------- ------------------ START WSDL ---------------- <?xml version="1.0" encoding="UTF-8"?> <wsdl:definitions name="ParamTest" targetNamespace="http://www.company.com" xmlns:comp="http://www.company.com" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.company.com" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <wsdl:types> </wsdl:types> <wsdl:message name="testOperationResponse"> </wsdl:message> <wsdl:message name="testOperationRequest"> <wsdl:part name="arg1" type="xsd:string"/> <wsdl:part name="arg2" type="xsd:string"/> <wsdl:part name="arg3" type="xsd:string"/> </wsdl:message> <wsdl:portType name="PortType"> <wsdl:operation name="testOperation"> <wsdl:input message="tns:testOperationRequest"/> <wsdl:output message="tns:testOperationResponse"/> </wsdl:operation> </wsdl:portType> <wsdl:binding name="PortTypeBinding" type="tns:PortType"> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> <wsdl:operation name="testOperation"> <soap:operation soapAction="capeconnect:ServicePort:PortType#testOperation" style="document"/> <wsdl:input> <soap:body parts="arg3 arg1 arg2" use="literal"/> </wsdl:input> <wsdl:output> <soap:body use="literal"/> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name="ServicePort"> <wsdl:port binding="tns:PortTypeBinding" name="ServicePort"> <soap:address location="http://willo/axis/services/ServicePort"/> </wsdl:port> </wsdl:service> </wsdl:definitions> ------------------ END WSDL ---------------- ------------------ START SOAP REQUEST ---------------- POST /axis/services/ServicePort HTTP/1.0 Content-Type: text/xml; charset=utf-8 Accept: application/soap+xml, application/dime, multipart/related, text/* User-Agent: Axis/1.2RC2 Host: 127.0.0.1:8080 Cache-Control: no-cache Pragma: no-cache SOAPAction: "capeconnect:ServicePort:PortType#testOperation" Content-Length: 307 <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Body> <arg1 xmlns="">value1</arg1> <arg2 xmlns="">value2</arg2> <arg3 xmlns="">value3</arg3> </soapenv:Body></soapenv:Envelope> ------------------ END SOAP REQUEST ---------------- ------------------ START SOAP REPLY ---------------- HTTP/1.0 200 OK Server: Resin/3.0.8 Content-Type: text/xml; charset=utf-8 Date: Tue, 22 Feb 2005 17:28:47 GMT <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Body> <arg1Response xmlns=""/> </soapenv:Body></soapenv:Envelope> ------------------ END SOAP REPLY---------------- "Ce message est confidentiel, � l'usage exclusif du destinataire ci-dessus et son contenu ne repr�sente en aucun cas un engagement de la part de AXA, sauf en cas de stipulation expresse et par �crit de la part de AXA. Toute publication, utilisation ou diffusion, m�me partielle, doit �tre autoris�e pr�alablement. Si vous n'�tes pas destinataire de ce message, merci d'en avertir imm�diatement l'exp�diteur." "This e-mail message is confidential, for the exclusive use of the addressee and its contents shall not constitute a commitment by AXA, except as otherwise specifically provided in writing by AXA. Any unauthorized disclosure, use or dissemination, either whole or partial, is prohibited. If you are not the intended recipient of the message, please notify the sender immediately."
