Skip to main content



      Home
Home » Language IDEs » ServerTools (WTP) » obtaining OperationType from WSDL model ?
obtaining OperationType from WSDL model ? [message #36450] Tue, 03 August 2004 12:02 Go to next message
Eclipse UserFriend
Originally posted by: hoe.zurich.ibm.com

When I parse a WSDL document using code in plugin com.ibm.etools.wsdl
the resulting WSDLResourceImpl looks fine, except that
Operation.getStyle returns null instead one of the 4 valid
OperationTypes. Is this a bug, or how can one distinguish between WSDL
1.1 transmission primitives (esp. request-response and solicit-response)
instead?

Thanks,
Christian
Re: obtaining OperationType from WSDL model ? [message #36476 is a reply to message #36450] Tue, 03 August 2004 15:27 Go to previous messageGo to next message
Eclipse UserFriend
Christian Hoertnagl wrote:

> When I parse a WSDL document using code in plugin com.ibm.etools.wsdl
> the resulting WSDLResourceImpl looks fine, except that
> Operation.getStyle returns null instead one of the 4 valid
> OperationTypes. Is this a bug, or how can one distinguish between WSDL
> 1.1 transmission primitives (esp. request-response and solicit-response)
> instead?

> Thanks,
> Christian

It would be because the Operation does not have the style attribute and it
is an intended behavior. The method getStyle() returns the value of the
style attribute if it exists.

In your case, you will have to deduce the style yourself based on the
spec. when the style is not explicitly specified. e.g. by examining the
existance of Input and/or Output as well as their relative order.
Re: obtaining OperationType from WSDL model ? [message #36705 is a reply to message #36476] Wed, 04 August 2004 03:13 Go to previous messageGo to next message
Eclipse UserFriend
Actually Christian, this is a bug in our model. Kihup, we should be the
ones deducing the style here ... we simply need to consider the presense
and order of the <input> and <output> elements. Christian, please open a
defect for this problem.

Kihup Boo wrote:

> Christian Hoertnagl wrote:

> > When I parse a WSDL document using code in plugin com.ibm.etools.wsdl
> > the resulting WSDLResourceImpl looks fine, except that
> > Operation.getStyle returns null instead one of the 4 valid
> > OperationTypes. Is this a bug, or how can one distinguish between WSDL
> > 1.1 transmission primitives (esp. request-response and solicit-response)
> > instead?

> > Thanks,
> > Christian

> It would be because the Operation does not have the style attribute and it
> is an intended behavior. The method getStyle() returns the value of the
> style attribute if it exists.

> In your case, you will have to deduce the style yourself based on the
> spec. when the style is not explicitly specified. e.g. by examining the
> existance of Input and/or Output as well as their relative order.
Re: obtaining OperationType from WSDL model ? [message #36773 is a reply to message #36705] Wed, 04 August 2004 03:42 Go to previous message
Eclipse UserFriend
Originally posted by: hoe.zurich.ibm.com

This is a multi-part message in MIME format.
--------------070809000805060806030808
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Craig,

Thanks & yes, I'll see if I can open a defect. I'm appending my current
workaround method (it's along the very line you're suggesting), which
should perhaps be refactored into OperationImpl.getStyle.

Kihup,

I think the style attribute is different (related to bindings, not
transmission primitives. Terminology overlaps here.

Thanks,
Christian

Craig Salter wrote:
> Actually Christian, this is a bug in our model. Kihup, we should be the
> ones deducing the style here ... we simply need to consider the presense
> and order of the <input> and <output> elements. Christian, please open a
> defect for this problem.

--------------070809000805060806030808
Content-Type: text/plain;
name="getStylt_patch.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="getStylt_patch.txt"

public static OperationType getStyle(Operation operation) {
OperationType style = operation.getStyle();
if (style != null)
return style;

if (!(operation instanceof OperationImpl))
throw new AssertionError();

OperationImpl operationImpl = (OperationImpl)operation;
Element element = operationImpl.getElement();
NodeList childNodes = element.getChildNodes();
boolean passedInput = false, passedOutput = false;
for (int i = 0; i < childNodes.getLength(); i++) {
Node childNode = childNodes.item(i);

if (!(childNode instanceof Element) ||
!WSDLConstants.WSDL_NAMESPACE_URI.equals(childNode.getNamesp aceURI()))
continue;

String localName = childNode.getLocalName();
if ("input".equals(localName))
if (passedOutput)
style = OperationType.SOLICIT_RESPONSE;
else
passedInput = true;
else if ("output".equals(localName))
if (passedInput)
style = OperationType.REQUEST_RESPONSE;
else
;
}
if (style == null)
if (passedInput)
style = OperationType.ONE_WAY;
else if (passedOutput)
style = OperationType.NOTIFICATION;
else
throw new AssertionError();

operation.setStyle(style);
return style;
}

--------------070809000805060806030808--
Previous Topic:Problem with blanks in the Tomcat path
Next Topic:Be sure to check out J2EE Navigator View and Snippets View
Goto Forum:
  


Current Time: Tue Jul 22 08:35:43 EDT 2025

Powered by FUDForum. Page generated in 0.06213 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top