You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by BS...@amig.com on 2007/08/30 21:42:28 UTC

Ways of instantiating Service, Call

I've used two different ways to work with Axis 1.4's Service and Call
objects.  I'm tyring to understand the fundamental differents between these
two ways.  The key seems to be when the WSDL is presented, and how much
information is relied upon from the WSDL as opposed to hard-coded.

The less-code way is:

   Service service = new Service(this.wsdlURL, SERVICE_QNAME);
   Call call = (Call)service.createCall(SERVICE_PORT_QNAME,
   SERVICE_OP_QNAME);

The more-code way is:

   this.service = new Service();
   Call call = (Call)this.service.createCall();
   call.setProperty("sendMultiRefs", Boolean.FALSE);
   call.addParameter("String_1",  XMLType.XSD_STRING,  ParameterMode.IN);
   call.addParameter("int_2",     XMLType.XSD_INT,     ParameterMode.IN);
   call.addParameter("String_3",  XMLType.XSD_STRING,  ParameterMode.IN);
   ...
   call.addParameter("String_7",  XMLType.XSD_STRING,  ParameterMode.IN);
   call.setReturnType(XMLType.XSD_STRING);
   call.setTargetEndpointAddress(wsdlURL);
   call.setOperationName(SERVICE_OP_QNAME);

I'd prefer to use the former, but we encountered probelms with an older
version fo QName in the classpath that lacked the getPrefix() method.
While there are ways to fix the classloader issue that I'm working through
now, what I found interesting is that doing it the more-code way works just
fine.  Whatever Axis code is invoked in the more-code way does NOT attempt
to and fail a call to QName.getPrefix() while the less-code way does.

What is the difference in these two ways?

Regards,
Brian.


-----------------------------------------
CONFIDENTIALITY STATEMENT:
This e-mail transmission contains information that is intended to
be confidential.  It is intended only for the addressee named
above.  If you receive this e-mail in error, please do not read,
copy, or disseminate it.  If you are not the intended recipient,
any disclosure, copying, distribution or use of the contents of
this information is prohibited.   Please reply to the message
immediately by informing the sender that the message was
misdirected.  After replying, please erase it from your computer
system.  Your assistance in correcting this error is appreciated.

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org