Hi Anil,
You are right, ultimately at the time of making an invocation, all WSIF needs is the port, binding and port type. The reason you need the definition is that you could potentially use a different port for that port type at any time (by not setting any preferred port, or explicitly changing the preferred port), and WSIF needs to be able to look up the information for that port if you do that. Additionally, the definition is needed in order to look up type information and automatically do the type mappings. It is possible to write a WSIF provider that just uses port, binding and port type information but it would less flexible and would break the current programming model.
Hope that helps,
Nirmal.
| Anil Ambati/Raleigh/[EMAIL PROTECTED]
06/05/2003 06:25 PM
|
To: [EMAIL PROTECTED] cc: Subject: Re: Creating a WSIFPort from javax.wsdl.Port |
Hi Nirmal,
Thanks for your reply. All my class is being passed is the javax.wsdl.Port
object. I don't think I can get Definition and Service from the Port. In
other words, I cannot invoke a webservice using WSIF if all I have is Port.
I still don't understand why it is not possible. The Port object
encapsulates the binding, endpoint, and porttype, so why is it not possible
to create to WSIFService, ultimately invoke a service using it.
Please forgive me, if I am not making sense, bcos I am new to WSIF.
Thanks in advance.
Regards,
Anil Ambati
SDWB Development
919-254-6152
[EMAIL PROTECTED]
"You have no responsibility to live up to what other people think you ought
to accomplish." -Richard Feynman (1918-1988)
"Money is as bad as it is necessary" - Anonymous
Nirmal
Mukhi/Watson/IBM@ To: [EMAIL PROTECTED]
IBMUS cc:
Subject: Re: Creating a WSIFPort from javax.wsdl.Port
06/05/2003 10:11
AM
Please respond to
wsif-user
Hi Anil,
You could do something like this:
javax.wsdl.Port port = ... // this should be the WSDL port element
javax.wsdl.Definition definition = ... // this should be the WSDL
definition for the service
javax.wsdl.Service service = ... // this should be the WSDL service element
// figure out the port type
javax.wsdl.PortType portType = port.getBinding().getPortType();
// create a service factory
WSIFServiceFactory factory = WSIFServiceFactory.newInstance();
WSIFService service = factory.getService(definition,service,portType);
// set the preferred port
service.setPreferredPort(port.getName());
// get the port
WSIFPort port = service.getPort();
Hope that helps,
Nirmal.
Anil
Ambati/Raleigh/[EMAIL PROTECTED] To: [EMAIL PROTECTED]
cc:
06/05/2003 09:11 AM Subject: Re: Creating a
Please respond to wsif-user WSIFPort from javax.wsdl.Port
Hi Nirmal,
Thanks for your reply. You said, WSIFService object can be created as long
as I know port type. I am not sure what you mean by that. The class i am
writing receives a javax.wsdl.Port object from which i can get the
Javax.wsdl.Binding and javax.wsdl.PortType objects. I looked at
WSIFServiceFactory interface, but could not find any factory method that
takes a Port object and returns a WSIFService object.
Thanks in advance.
Regards,
Anil Ambati
SDWB Development
919-254-6152
[EMAIL PROTECTED]
"You have no responsibility to live up to what other people think you ought
to accomplish." -Richard Feynman (1918-1988)
"Money is as bad as it is necessary" - Anonymous
Nirmal Mukhi
To: Anil
Ambati/Raleigh/[EMAIL PROTECTED]
06/04/2003 01:17 cc:
[EMAIL PROTECTED]
PM From: Nirmal
Mukhi/Watson/[EMAIL PROTECTED]
Subject: Re: Creating a
WSIFPort from javax.wsdl.Port(Document link: Anil Ambati)
Hi Anil,
Please send WSIF-related questions to [EMAIL PROTECTED]
To do what you need, you first need to create the WSIFService object (this
can be done as long as you know the port type you want to invoke). On the
WSIFService object you can specify your preferred port, then do the
invocation and it will use the protocol supported by your preferred port
automatically. You can also change your preferred port at runtime, or not
specofy any preference (then WSIF chooses one).
Nirmal.
Anil Ambati
To: [EMAIL PROTECTED]
06/04/2003 12:30 cc:
PM From: Anil
Ambati/Raleigh/[EMAIL PROTECTED]
Subject: Creating a WSIFPort
from javax.wsdl.Port
Hi Nirmal,
Is it possible to create a WSIFPort given a javax.wsdl.Port object. I
browsed through the API docs but could not find a way to create WSIFPort
from Port. My aim is to invoke a method on a service running at the port
specified by the Port object.
Thank you in advance.
Regards,
Anil Ambati
SDWB Development
919-254-6152
[EMAIL PROTECTED]
"You have no responsibility to live up to what other people think you ought
to accomplish." -Richard Feynman (1918-1988)
"Money is as bad as it is necessary" - Anonymous
