Return-Path: Delivered-To: apmail-ws-axis-user-archive@www.apache.org Received: (qmail 2848 invoked from network); 11 Nov 2005 15:01:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 11 Nov 2005 15:01:25 -0000 Received: (qmail 80653 invoked by uid 500); 11 Nov 2005 15:01:14 -0000 Delivered-To: apmail-ws-axis-user-archive@ws.apache.org Received: (qmail 80644 invoked by uid 500); 11 Nov 2005 15:01:14 -0000 Mailing-List: contact axis-user-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-user@ws.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-user@ws.apache.org Received: (qmail 80633 invoked by uid 99); 11 Nov 2005 15:01:14 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Nov 2005 07:01:14 -0800 X-ASF-Spam-Status: No, hits=0.7 required=10.0 tests=DNS_FROM_RFC_ABUSE,HTML_FONT_BIG,HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of himmeric@us.ibm.com designates 32.97.110.149 as permitted sender) Received: from [32.97.110.149] (HELO e31.co.us.ibm.com) (32.97.110.149) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Nov 2005 07:01:06 -0800 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e31.co.us.ibm.com (8.12.11/8.12.11) with ESMTP id jABF0pwV027692 for ; Fri, 11 Nov 2005 10:00:51 -0500 Received: from d03av03.boulder.ibm.com (d03av03.boulder.ibm.com [9.17.195.169]) by westrelay02.boulder.ibm.com (8.12.10/NCO/VERS6.8) with ESMTP id jABF0jwD038988 for ; Fri, 11 Nov 2005 08:00:45 -0700 Received: from d03av03.boulder.ibm.com (loopback [127.0.0.1]) by d03av03.boulder.ibm.com (8.12.11/8.13.3) with ESMTP id jABF0pln006834 for ; Fri, 11 Nov 2005 08:00:51 -0700 Received: from d03nm112.boulder.ibm.com (d03nm112.boulder.ibm.com [9.17.195.138]) by d03av03.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id jABF0p0R006820 for ; Fri, 11 Nov 2005 08:00:51 -0700 In-Reply-To: Subject: Re: Axis not conforming to WSDL response element definition To: axis-user@ws.apache.org Cc: axis-user@ws.apache.org X-Mailer: Lotus Notes Release 7.0 August 18, 2005 Message-ID: From: Kyle M Himmerick Date: Fri, 11 Nov 2005 08:03:14 -0700 X-MIMETrack: Serialize by Router on D03NM112/03/M/IBM(Build V70_08142005|August 14, 2005) at 11/11/2005 08:03:16 MIME-Version: 1.0 Content-type: multipart/related; Boundary="0__=08BBFA25DFC255F98f9e8a93df938690918c08BBFA25DFC255F9" X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N --0__=08BBFA25DFC255F98f9e8a93df938690918c08BBFA25DFC255F9 Content-type: multipart/alternative; Boundary="1__=08BBFA25DFC255F98f9e8a93df938690918c08BBFA25DFC255F9" --1__=08BBFA25DFC255F98f9e8a93df938690918c08BBFA25DFC255F9 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: quoted-printable Just as a follow up I ended up writing a simple Handler to modify the outbound response message. import javax.xml.soap.SOAPBody; import org.apache.axis.AxisFault; import org.apache.axis.Message; import org.apache.axis.handlers.BasicHandler; import org.apache.axis.message.RPCElement; public class MyHandler extends BasicHandler { /* (non-Javadoc) * @see org.apache.axis.Handler#invoke(org.apache.axis.MessageContext) */ public void invoke(org.apache.axis.MessageContext msgContext) thr= ows AxisFault { try{ Message msg =3D msgContext.getResponseMessage(); SOAPBody soapBody =3D msg.getSOAPBody(); RPCElement root =3D (RPCElement) soapBody.getFirstChi= ld(); root.setName("RequestAcknowledgement"); }catch (Exception e){ e.printStackTrace(); } } } This handler is invoked by having it in the responseFlow for the servic= e Regards, Kyle Himmerick = Kyle M = Himmerick/Boulder = /IBM@IBMUS = To axis-user@ws.apache.org = 11/10/2005 11:28 = cc AM = Subj= ect Axis not conforming to WSDL = Please respond to response element definition = axis-user = = = = = = Hello, I am trying to get Axis to conform to a WSDL definition that specifies = a response element for each operation. From my PD it looks like RPCProvid= er is only using the requested method name and appending a hard coded stri= ng of 'Response'. This is unacceptable in our current environment and I ne= ed access to return a different root element. Here is an extract from the WSDL .... .... Here is an extract from org.apache.axis.providers.java.RPCProvider wher= e I'm seeing the hard coded + "Response" protected RPCElement createResponseBody(RPCElement body, MessageContext= msgContext, OperationDesc operation, ServiceDesc serviceDesc, Object objRes, SOAPEnvelope resEnv, ArrayList outs) throws Exception { String methodName =3D body.getMethodName(); /* Now put the result in the result SOAPEnvelope */ RPCElement resBody =3D new RPCElement(methodName + "Response"); resBody.setPrefix(body.getPrefix()); resBody.setNamespaceURI(body.getNamespaceURI()); resBody.setEncodingStyle(msgContext.getEncodingStyle()); So per my wsdl my response should look like: ... 10 But instead is like this: ... 10 Again the difference I am focused on and need to correct is the top ele= ment within the SOAENV:Body, this element should be RequestAcknowledgement instead of TicketCreateAsyncResponse. The TicketCreateAsyncResponse mes= sage is actually another message type we are passing (an asynchronous respon= se). I generated Client and Server stubs using WSDL2Java with the following parms: WSDL2Java -w --server-side --skeletonDeploy true MaintenanceServicesASync.wsdl Is there a workaround to have the correct response returned? I'm thinki= ng I either need a custom provider that is capable of setting the response element or a handler to modify the response. What am I missing? or any suggestions? Thanks, Kyle Himmerick= --1__=08BBFA25DFC255F98f9e8a93df938690918c08BBFA25DFC255F9 Content-type: text/html; charset=US-ASCII Content-Disposition: inline Content-transfer-encoding: quoted-printable

Just as a follow up I ended up writing a simple Handler to modify th= e outbound response message.


import javax.xml.soap.SOAPBody;

import org.apache.axis.AxisFault;
import org.apache.axis.Message;
import org.apache.axis.handlers.BasicHandler;
import org.apache.axis.message.RPCElement;

public class MyHandler extends BasicHandler {
/* (non-Javadoc)
* @see org.apache.axis.Handler#invoke(org.apache.axis.MessageContext)=
*/
public void invoke(org.apache.axis.MessageContext msgContext) throws A= xisFault {
try{
Message msg =3D msgContext.getResponseMessage();
SOAPBody soapBody =3D msg.getSOAPBody();
RPCElement root =3D (RPCElement) soapBody.getFirstChild();
root.setName("RequestAcknowledgement");
}catch (Exception e){
e.printStackTrace();
}
}
}

This handler is invoked by having it in the responseFlow for the servic= e

<responseFlow>
<handler type=3D"java:package.MyH= andler"/>
</responseFlow>

Regards,
Kyle Himmerick


3D"InactiveKyle M Himmerick/Boulder/IBM@IBMUS


=
          Kyle M Himmerick/Boulder/IBM@IBMUS

          11/10/2005 11:28 AM
          Please respond to
          axis-user

=
3D""
To
3D""
axis-user@ws.apache.org
3D""
cc
3D""
3D""
Subject
3D""
Axis not conforming to WSDL response element definitio= n
3D=3D""

Hello,

I am trying to get Axis to conform to a WSDL definition that specifies = a response element for each operation. From my PD it looks like RPCProv= ider is only using the requested method name and appending a hard coded= string of 'Response'. This is unacceptable in our current environment = and I need access to return a different root element.

Here is an extract from the WSDL

<types>
<xsd:schema>
<xsd:element name=3D"TicketCreateAsync">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref=3D"mh:MessageHeader"/>
<xsd:element ref=3D"ms:TicketCreate"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name=3D"TicketCreateAsyncResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref=3D"mh:MessageHeader"/>
<xsd:element ref=3D"ms:TicketCreateResponse"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name=3D"RequestAcknowledgement">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref=3D"mh:MessageHeader"/>
<xsd:element ref=3D"mh:Acknowledgement"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</types>
<message name=3D"TicketCreateAsyncMsg">
<part name=3D"in" element=3D"tns:TicketCreateAsync&qu= ot;/>
</message>
<message name=3D"TicketCreateAsyncResponseMsg">
<part name=3D"in" element=3D"tns:TicketCreateAsyncRes= ponse"/>
</message>
<message name=3D"RequestAcknowledgementMsg">
<part name=3D"out" element=3D"tns:RequestAcknowledgem= ent"/>
</message>


<portType name=3D"MaintenanceServicesAsyncPortType"> <operation name=3D"TicketCreateAsync">
<input name=3D"TicketCreateAsyncIn" message=3D"tns:Ti= cketCreateAsyncMsg"/>
<output name=3D"TicketCreateAsyncOut" message=3D"tns:= RequestAcknowledgementMsg"/>
<fault name=3D"WSException" message=3D"tns:WSExceptio= n"/>
</operation>
....
</portType>

<binding name=3D"MaintenanceServicesAsyncBinding" type=3D&= quot;tns:MaintenanceServicesAsyncPortType">
<soap:binding style=3D"document" transport=3D"
= http:= //schemas.xmlsoap.org/soap/http"/><= br> <operation name=3D"TicketCreateAsync">
<soap:operation style=3D"document"/>
<input>
<soap:body use=3D"literal"/>
</input>
<output>
<soap:body use=3D"literal"/>
</output>
<fault name=3D"WSException">
<soap:fault name=3D"WSException" use=3D"literal"= />
</fault>
</operation>
....
</binding>


Here is an extract from org.apache.axis.providers.java.RPCProvider wher= e I'm seeing the hard coded + "Response"

protected RPCElement createResponseBody(RPCElement body, MessageContext= msgContext, OperationDesc operation, ServiceDesc serviceDesc, Object o= bjRes, SOAPEnvelope resEnv, ArrayList outs) throws Exception
{
String methodName =3D body.getMethodName();
/* Now put the result in the result SOAPEnvelope */
RPCElement resBody =3D new RPCElement(methodName + "Response"= );
resBody.setPrefix(body.getPrefix());
resBody.setNamespaceURI(body.getNamespaceURI());
resBody.setEncodingStyle(msgContext.getEncodingStyle());


So per my wsdl my response should look like:

<SOAP-ENV:Envelope xmlns:SOAP-ENV=3D"
http://schemas.xmls= oap.org/soap/envelope/" xmlns:SOAP-ENC= =3D"http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi=3D"http://www.w3.org/2001/XMLS= chema-instance" xmlns:xsd=3D"http:/= /www.w3.org/2001/XMLSchema" xmlns:m0=3D= "http://x.com/schema/MsgHeader/v1_0&qu= ot; xmlns:m1=3D"http://x.com/schema/MaintenanceServices/= v4_0">
<SOAP-ENV:Body>
<m:RequestAcknowledgement xmlns:m=3D"
http://x.com/wsdl/= MaintenanceServices/v2_0">
<m0:MessageHeader xmlns:m0=3D"
http://x.com/schema/MsgHeader/v1_0= ">
...
</m0:MessageHeader>
<m0:Acknowledgement>
<m0:ResponseGuidanceNumber>10</m0:ResponseGuidanceNumber> </m0:Acknowledgement>
</m:RequestAcknowledgement>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>


But instead is like this:

<?xml version=3D"1.0" encoding=3D"utf-8"?> <soapenv:Envelope xmlns:soapenv=3D"
http://schemas.xmlsoa= p.org/soap/envelope/" xmlns:xsd=3D&quo= t;= http://www.w3.org/2001/XMLSchema" xmln= s:xsi=3D"http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<TicketCreateAsyncResponse xmlns=3D"
http://x.com/wsdl/M= aintenanceServices/v2_0">
<ns2:MessageHeader xmlns:ns2=3D"
http://x.com/schema/MsgHeader/v= 1_0">
...
</ns2:MessageHeader>
<ns1:Acknowledgement xmlns:ns1=3D"
http://x.com/schema/MsgHeader= /v1_0">
<ns1:ResponseGuidanceNumber>10</ns1:ResponseGuidanceNumber>=
</ns1:Acknowledgement>
</TicketCreateAsyncResponse>
</soapenv:Body>
</soapenv:Envelope>


Again the difference I am focused on and need to correct is the top ele= ment within the SOAENV:Body, this element should be RequestAcknowledgem= ent instead of TicketCreateAsyncResponse. The TicketCreateAsyncResponse= message is actually another message type we are passing (an asynchrono= us response).

I generated Client and Server stubs using WSDL2Java with the following = parms:
WSDL2Java -w --server-side --skeletonDeploy true MaintenanceServicesASy= nc.wsdl

Is there a workaround to have the correct response returned? I'm thinki= ng I either need a custom provider that is capable of setting the respo= nse element or a handler to modify the response.

What am I missing? or any suggestions?

Thanks,
Kyle Himmerick

= --1__=08BBFA25DFC255F98f9e8a93df938690918c08BBFA25DFC255F9-- --0__=08BBFA25DFC255F98f9e8a93df938690918c08BBFA25DFC255F9 Content-type: image/gif; name="graycol.gif" Content-Disposition: inline; filename="graycol.gif" Content-ID: <1__=08BBFA25DFC255F98f9e8a93df938@us.ibm.com> Content-transfer-encoding: base64 R0lGODlhEAAQAKECAMzMzAAAAP///wAAACH5BAEAAAIALAAAAAAQABAAAAIXlI+py+0PopwxUbpu ZRfKZ2zgSJbmSRYAIf4fT3B0aW1pemVkIGJ5IFVsZWFkIFNtYXJ0U2F2ZXIhAAA7 --0__=08BBFA25DFC255F98f9e8a93df938690918c08BBFA25DFC255F9 Content-type: image/gif; name="pic00012.gif" Content-Disposition: inline; filename="pic00012.gif" Content-ID: <2__=08BBFA25DFC255F98f9e8a93df938@us.ibm.com> Content-transfer-encoding: base64 R0lGODlhWABDALP/AAAAAK04Qf79/o+Gm7WuwlNObwoJFCsoSMDAwGFsmIuezf///wAAAAAAAAAA AAAAACH5BAEAAAgALAAAAABYAEMAQAT/EMlJq704682770RiFMRinqggEUNSHIchG0BCfHhOjAuh EDeUqTASLCbBhQrhG7xis2j0lssNDopE4jfIJhDaggI8YB1sZeZgLVA9YVCpnGagVjV171aRVrYR RghXcAGFhoUETwYxcXNyADJ3GlcSKGAwLwllVC1vjIUHBWsFilKQdI8GA5IcpApeJQt8L09lmgkH LZikoU5wjqcyAMMFrJIDPAKvCFletKSev1HBw8KrxtjZ2tvc3d5VyKtCKW3jfz4uMKmq3xu4N0nK BVoJQmx2LGVOmrqNjjJf2hHAQo/eDwJGTKhQMcgQEEAnEjFS98+RnW3smGkZU6ncCWav/4wYOnAI TihRL/4FEwbp28BXMMcoscQCVxlepL4IGDSCyJyVQOu0o7CjmLN50OZlqWmyFy5/6yBBuji0AxFR M00oQAqNIstqI6qKHUsWRAEAvagsmfUEAImyxgbmUpJk3IklNUtJOUAVLoUr1+wqDGTE4zk+T6FG uQb3SizBCwatiiUgCBN8vrz+zFjVyQ8FWkOlg4NQiZMB5QS8QO3mpOaKnL0Z2EKvNMSILEThKhCg zMKPVxYJh23qm9KNW7pArPynMqZDiErsTMqI+LRi3QAgkFUbXpuFKhSYZALd0O5RKa2z9EYKBbpb qxIKsjUPRgD7I2XYV6wyrOw92ykExP8NW4URhknC5dKGE4v4NENQj2jXjmfNgOZDaXb5glRmXQ33 YEWQYNcZFnrYcIQLNzyTFDQNkXIff0ExVlY4srziQk43inZgL4rwxxINMvpFFAz1KOODHiu+4aEw NEjFl5B3JIKWKF3k6I9bfUGp5ZZcdunll5IA4cuHvQQJ5gcsoCWOOUwgltIwAKRxJgbIkJAQZEq0 2YliZnpZZ4BH3CnYOXldOUOfQoYDqF1LFHbXCrO8xmRsfoXDXJ6ChjCAH3QlhJcT6VWE6FCkfCco CgrMFsROrIEX3o2whVjWDjoJccN3LdggSGXLCdLEgHr1lyU3O3QxhgohNKXJCWv8JQr/PDdaqd6w 2rj1inLiGeiCJoDspAoQlYE6QWLSECehcWIYxIQES6zhbn1iImTHEQyqJ4eIxJJoUBc+3CbBuwZE V5cJPPkIjFDdeEabQbd6WgICTxiiz0f5dBKquXF6k4senwEhYGnKEFJeGrxUZy8dB8gmAXI/sPvH ESfCwVt5hTgYiqQqtdRNHQIU1PJ33ZqmzgE90OwLaoJcnMop1WiMmgkPHQRIrwgFuNV90A3doNKT mrKIN07AnGcI9BQjhCBN4RfA1qIZnMqorJCogKfGQnxSCDilTVIA0yl5ciTovgLuBDKFUDE9aQcw 9SA+rjSNf9/M1gxrj6VwDTS0IUSElMzBfsj0NFXR2kwsV1A5IF1grLgLL/r1R40BZEnuBWgmQEyb jqRwSAt6bqMCOFkvKFN2GPPkUzIm/SCF8z8pVzpbjVnMsy0vOr1hw3SaSRUhpY09v0z0J1FnwzPl fmh+xl4WtR0zGu24I4KbMQm3lnVu2oNWxI9W/lcyzA+mCKF4DBikxb/+UWtOGRiFP8qEwAayIgIA Ow== --0__=08BBFA25DFC255F98f9e8a93df938690918c08BBFA25DFC255F9 Content-type: image/gif; name="ecblank.gif" Content-Disposition: inline; filename="ecblank.gif" Content-ID: <3__=08BBFA25DFC255F98f9e8a93df938@us.ibm.com> Content-transfer-encoding: base64 R0lGODlhEAABAIAAAAAAAP///yH5BAEAAAEALAAAAAAQAAEAAAIEjI8ZBQA7 --0__=08BBFA25DFC255F98f9e8a93df938690918c08BBFA25DFC255F9--