You are viewing a plain text version of this content. The canonical link for it is here.
Posted to muse-commits@ws.apache.org by da...@apache.org on 2007/09/02 17:45:20 UTC
svn commit: r572006 - in
/webservices/muse/trunk/modules/muse-tools/src/org/apache/muse/tools/inspector:
Messages.properties ResourceInspector.java
Author: danj
Date: Sun Sep 2 08:45:20 2007
New Revision: 572006
URL: http://svn.apache.org/viewvc?rev=572006&view=rev
Log:
Applying patch for MUSE-208 - thanks Alberto!
Modified:
webservices/muse/trunk/modules/muse-tools/src/org/apache/muse/tools/inspector/Messages.properties
webservices/muse/trunk/modules/muse-tools/src/org/apache/muse/tools/inspector/ResourceInspector.java
Modified: webservices/muse/trunk/modules/muse-tools/src/org/apache/muse/tools/inspector/Messages.properties
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-tools/src/org/apache/muse/tools/inspector/Messages.properties?rev=572006&r1=572005&r2=572006&view=diff
==============================================================================
--- webservices/muse/trunk/modules/muse-tools/src/org/apache/muse/tools/inspector/Messages.properties (original)
+++ webservices/muse/trunk/modules/muse-tools/src/org/apache/muse/tools/inspector/Messages.properties Sun Sep 2 08:45:20 2007
@@ -5,4 +5,5 @@
OneServicePerWSDL=The resource inspector can only process WSDLs with one service element.
OperationUndefined=There is no operation for the Java method 'XXX' - you can only invoke operations that are defined in the resource's WSDL (remote interface).
NoTypeDef=No type definition found for 'XXX'.
-NoWSRPSchema=No WS-RP schema found.
\ No newline at end of file
+NoWSRPSchema=No WS-RP schema found.
+VoidOperationName=The operation cannot be neither null or void.
Modified: webservices/muse/trunk/modules/muse-tools/src/org/apache/muse/tools/inspector/ResourceInspector.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-tools/src/org/apache/muse/tools/inspector/ResourceInspector.java?rev=572006&r1=572005&r2=572006&view=diff
==============================================================================
--- webservices/muse/trunk/modules/muse-tools/src/org/apache/muse/tools/inspector/ResourceInspector.java (original)
+++ webservices/muse/trunk/modules/muse-tools/src/org/apache/muse/tools/inspector/ResourceInspector.java Sun Sep 2 08:45:20 2007
@@ -331,19 +331,27 @@
private JavaMethod createJavaMethod(Element wsdl, Operation op)
{
JavaMethod method = new JavaMethod();
- method.setName(getInputName(op));
- // set to the element name that's on the only message part
+ QName inputName = getInputName(op);
+ String operationName = op.getName();
+
+ if (operationName == null || operationName.length() == 0)
+ throw new RuntimeException(_MESSAGES.get("VoidOperationName"));
+
+ method.setName(new QName(inputName.getNamespaceURI(),op.getName(),inputName.getPrefix()));
method.setReturnName(getOutputName(op));
- Element inputElement = WsdlUtils.getElementDeclaration(wsdl, method.getName());
+ Element inputElement = WsdlUtils.getElementDeclaration(wsdl, inputName);
+
if (inputElement == null)
{
Object[] filler = { method.getName() };
throw new RuntimeException(_MESSAGES.get("NoTypeDef", filler));
}
- //if this is null then we've got a void method
+ //
+ // if this is null then we've got a void method
+ //
Element outputElement = null;
if (method.getReturnName() != null)
@@ -351,8 +359,10 @@
method.setReturnSchemaType(getSchemaType(outputElement));
- //get the java type using the outputElement declaration because it
- //might have minOccurs/maxOccurs data
+ //
+ // get the java type using the outputElement declaration because it
+ // might have minOccurs/maxOccurs data
+ //
method.setReturnType(getJavaType(outputElement));
Element[] paramXML = XmlUtils.findInSubTree(inputElement, XsdUtils.ELEMENT_QNAME);
@@ -367,33 +377,31 @@
for (int n = 0; n < paramXML.length; ++n)
{
String localName = paramXML[n].getAttribute(XsdUtils.NAME);
+
if(localName != null && localName.length() != 0)
- {
- parameterTypeNames[n] = new QName(targetNS, localName, "pfx");
- }
+ parameterTypeNames[n] = new QName(targetNS, localName, "pfx");
+
else
- {
parameterTypeNames[n] = XmlUtils.parseQName(paramXML[n].getAttribute(XsdUtils.REF),paramXML[n]);
- }
parameterSchemaTypes[n] = getSchemaType(paramXML[n]);
- //get the java type using the paramXML Element declaration because it
- //might have minOccurs/maxOccurs data
+ //
+ // get the java type using the paramXML Element declaration because it
+ // might have minOccurs/maxOccurs data
+ //
parameterTypes[n] = getJavaType(paramXML[n]);
}
Object actionURI = op.getInput().getExtensionAttribute(WsaConstants.ACTION_QNAME);
+
if(actionURI != null)
{
- if(actionURI instanceof QName)
- {
+ if(actionURI instanceof QName)
method.setActionURI(((QName)actionURI).getLocalPart());
- }
- else if(actionURI instanceof String)
- {
+
+ else if(actionURI instanceof String)
method.setActionURI(actionURI.toString());
- }
}
method.setParameterTypes(parameterTypes);
@@ -578,7 +586,7 @@
return getHandlers(_javaMethodsByName);
}
-
+
private QName getOutputName(Operation op)
{
Output output = op.getOutput();
---------------------------------------------------------------------
To unsubscribe, e-mail: muse-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-commits-help@ws.apache.org