Author: alexoree
Date: Sat Nov 16 13:48:09 2013
New Revision: 1542512
URL: http://svn.apache.org/r1542512
Log:
JUDDI-690 fixed
Modified:
juddi/trunk/juddi-client.net/juddi-client.net-sample/WsdlImport.cs
juddi/trunk/juddi-client.net/juddi-client.net/bindings/datamodel.cs
juddi/trunk/juddi-client.net/juddi-client.net/juddi-client.net-mono.csproj
juddi/trunk/juddi-client.net/juddi-client.net/juddi-client.net.csproj
juddi/trunk/juddi-client.net/juddi-client.net/org.apache.juddi.v3.client.config/UDDIClerk.cs
juddi/trunk/juddi-client.net/juddi-client.net/org.apache.juddi.v3.client.mapping/WADL2UDDI.cs
juddi/trunk/juddi-client.net/juddi-client.net/org.apache.juddi.v3.client.mapping/WSDL2UDDI.cs
juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/mapping/WSDL2UDDI.java
juddi/trunk/juddi-examples/more-uddi-samples/src/main/java/org/apache/juddi/samples/WsdlImport.java
Modified: juddi/trunk/juddi-client.net/juddi-client.net-sample/WsdlImport.cs
URL:
http://svn.apache.org/viewvc/juddi/trunk/juddi-client.net/juddi-client.net-sample/WsdlImport.cs?rev=1542512&r1=1542511&r2=1542512&view=diff
==============================================================================
--- juddi/trunk/juddi-client.net/juddi-client.net-sample/WsdlImport.cs
(original)
+++ juddi/trunk/juddi-client.net/juddi-client.net-sample/WsdlImport.cs Sat Nov
16 13:48:09 2013
@@ -34,24 +34,40 @@ namespace org.apache.juddi.client.sample
{
public static void main(string[] args)
{
- String wsdlURL =
"http://wsf.cdyne.com/WeatherWS/Weather.asmx?WSDL";
+ Console.Out.Write("Enter WSDL url: >");
+ String input = Console.In.ReadLine();
+ if (String.IsNullOrEmpty("input"))
+ input = "http://wsf.cdyne.com/WeatherWS/Weather.asmx?WSDL";
+ //String wsdlURL =
"http://wsf.cdyne.com/WeatherWS/Weather.asmx?WSDL";
+ Uri url = new Uri(input);
+
ReadWSDL wsi = new ReadWSDL();
- tDefinitions wsdlDefinition = wsi.readWSDL(
- // "http://localhost/UDDI_API_V31.wsdl"
- wsdlURL
- );
+ tDefinitions wsdlDefinition = wsi.readWSDL(input);
Properties properties1 = new Properties();
- properties1.put("keyDomain", "my.key.domain");
+ properties1.put("serverName", url.Host);
+ properties1.put("businessName", url.Host);
+ properties1.put("keyDomain", "uddi:" + url.Host);
+ int port = url.Port;
+ if (port <= 0)
+ {
+ if (url.ToString().StartsWith("https",
StringComparison.CurrentCultureIgnoreCase))
+ port = 443;
+ else port = 80;
+ }
+ properties1.put("serverPort", port.ToString());
+
+ tModel keypart = UDDIClerk.createKeyGenator(url.Host, url.Host +
"'s key partition", "en");
+
WSDL2UDDI wsdl2UDDI = new WSDL2UDDI(null, new URLLocalizer(),
properties1);
List<tModel> tModels1 = new List<tModel>();
Dictionary<QName, tPortType> portTypes1 = (Dictionary<QName,
tPortType>)wsdlDefinition.getAllPortTypes();
- List<tModel> portTypeTModels1 =
wsdl2UDDI.createWSDLPortTypeTModels(wsdlURL, portTypes1);
+ List<tModel> portTypeTModels1 =
wsdl2UDDI.createWSDLPortTypeTModels(input, portTypes1);
tModels1.AddRange(portTypeTModels1);
Dictionary<QName, tBinding> allBindings1 =
wsdlDefinition.getAllBindings();
- List<tModel> createWSDLBindingTModels1 =
wsdl2UDDI.createWSDLBindingTModels(wsdlURL, allBindings1);
+ List<tModel> createWSDLBindingTModels1 =
wsdl2UDDI.createWSDLBindingTModels(input, allBindings1);
tModels1.AddRange(createWSDLBindingTModels1);
businessService[] services =
wsdl2UDDI.createBusinessServices(wsdlDefinition);
@@ -64,6 +80,10 @@ namespace org.apache.juddi.client.sample
st.tModel = tModels1.ToArray();
Console.Out.WriteLine(new PrintUDDI<save_tModel>().print(st));
+ //save keypart
+
+ //save tmodels
+ //save business
//TODO register the stuff
}
Modified: juddi/trunk/juddi-client.net/juddi-client.net/bindings/datamodel.cs
URL:
http://svn.apache.org/viewvc/juddi/trunk/juddi-client.net/juddi-client.net/bindings/datamodel.cs?rev=1542512&r1=1542511&r2=1542512&view=diff
==============================================================================
--- juddi/trunk/juddi-client.net/juddi-client.net/bindings/datamodel.cs
(original)
+++ juddi/trunk/juddi-client.net/juddi-client.net/bindings/datamodel.cs Sat Nov
16 13:48:09 2013
@@ -2434,7 +2434,7 @@ namespace org.uddi.apiv3
private description[] descriptionField;
- private object[] itemsField;
+ private overviewDoc[] itemsField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("description")]
@@ -2455,7 +2455,7 @@ namespace org.uddi.apiv3
/// </summary>
[System.Xml.Serialization.XmlElementAttribute("overviewDoc",
typeof(overviewDoc))]
- public object[] Items
+ public overviewDoc[] Items
{
get
{
Modified:
juddi/trunk/juddi-client.net/juddi-client.net/juddi-client.net-mono.csproj
URL:
http://svn.apache.org/viewvc/juddi/trunk/juddi-client.net/juddi-client.net/juddi-client.net-mono.csproj?rev=1542512&r1=1542511&r2=1542512&view=diff
==============================================================================
--- juddi/trunk/juddi-client.net/juddi-client.net/juddi-client.net-mono.csproj
(original)
+++ juddi/trunk/juddi-client.net/juddi-client.net/juddi-client.net-mono.csproj
Sat Nov 16 13:48:09 2013
@@ -16,12 +16,13 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU'
">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
- <Optimize>false</Optimize>
+ <Optimize>true</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
+ <WarningLevel>3</WarningLevel>
<RunCodeAnalysis>true</RunCodeAnalysis>
+ <DocumentationFile>bin\Debug\juddi-dotnet-client.XML</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' ==
'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Modified: juddi/trunk/juddi-client.net/juddi-client.net/juddi-client.net.csproj
URL:
http://svn.apache.org/viewvc/juddi/trunk/juddi-client.net/juddi-client.net/juddi-client.net.csproj?rev=1542512&r1=1542511&r2=1542512&view=diff
==============================================================================
--- juddi/trunk/juddi-client.net/juddi-client.net/juddi-client.net.csproj
(original)
+++ juddi/trunk/juddi-client.net/juddi-client.net/juddi-client.net.csproj Sat
Nov 16 13:48:09 2013
@@ -16,12 +16,13 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU'
">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
- <Optimize>false</Optimize>
+ <Optimize>true</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
+ <WarningLevel>3</WarningLevel>
<RunCodeAnalysis>true</RunCodeAnalysis>
+ <DocumentationFile>bin\Debug\juddi-dotnet-client.XML</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' ==
'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Modified:
juddi/trunk/juddi-client.net/juddi-client.net/org.apache.juddi.v3.client.config/UDDIClerk.cs
URL:
http://svn.apache.org/viewvc/juddi/trunk/juddi-client.net/juddi-client.net/org.apache.juddi.v3.client.config/UDDIClerk.cs?rev=1542512&r1=1542511&r2=1542512&view=diff
==============================================================================
---
juddi/trunk/juddi-client.net/juddi-client.net/org.apache.juddi.v3.client.config/UDDIClerk.cs
(original)
+++
juddi/trunk/juddi-client.net/juddi-client.net/org.apache.juddi.v3.client.config/UDDIClerk.cs
Sat Nov 16 13:48:09 2013
@@ -790,7 +790,7 @@ namespace org.apache.juddi.v3.client.con
return authToken;
}
-
+
/// <summary>
/// This calls a jUDDI implementation specific API call and is used
to help
@@ -910,25 +910,27 @@ namespace org.apache.juddi.v3.client.con
}
}
- /**
- *A helper class to create a tModel key generator.<br>
- * Why would I want a key generator? In UDDIv3, you're support to
specify what you want the keys (unique identifiers) to be, however there's
- * a number of naming rules associated with the keys. Generally, use
the FQDN of your business or organization.
- * Optionally, when saving an UDDI entity, you can just leave the key
name blank and the server
- * should generate one for you. It's normally a UUID that's not easy
to remember. In this case, there's no need to call this method.<br><br>
- * In addition, no changes are made to the UDDI server. You'll have to
do that one using code similar to this:
- * <pre>
- * UDDIClerk clerk = ...
- * tModel keygen = UDDIClerk.createKeyGenator("mydomain.com", "my
domain", "en");
- * clerk.register(keygen);
- *
- * @param partitionName think of this as the domain, i.e.
juddi.apache.org, but it can really be anything you want. This will become part
of the
- * key associated with the tModel generator
(uddi:juddi.apache.org:keygenerator)
- * @param DescriptiveName required. max length is 255 char
- * @param DescriptiveNameLanguage optional, max length is 26 char
- * @return a populated tModel entity representing a tModel key
generator. No changes are made to any connect UDDI service
- * @since 3.2
- */
+ /// <summary>
+ /// A helper class to create a tModel key generator.
+ ///
+ /// Why would I want a key generator? In UDDIv3, you're support to
specify what you want the keys (unique identifiers) to be, however there's
+ /// a number of naming rules associated with the keys. Generally, use
the FQDN of your business or organization.
+ /// Optionally, when saving an UDDI entity, you can just leave the key
name blank and the server
+ /// should generate one for you. It's normally a UUID that's not easy
to remember. In this case, there's no need to call this method.
+ /// In addition, no changes are made to the UDDI server. You'll have
to do that one using code similar to this:
+ ///
+ /// UDDIClerk clerk = ...
+ /// tModel keygen = UDDIClerk.createKeyGenator("mydomain.com", "my
domain", "en");
+ /// clerk.register(keygen);
+ ///
+
+ /// @since 3.2
+ /// </summary>
+ /// <param name="partitionName">think of this as the domain, i.e.
juddi.apache.org, but it can really be anything you want. This will become part
of the
+ /// key associated with the tModel generator
(uddi:juddi.apache.org:keygenerator)</param>
+ /// <param name="DescriptiveName">required. max length is 255
char</param>
+ /// <param name="DescriptiveNameLanguage">optional, max length is 26
char</param>
+ /// <returns>a populated tModel entity representing a tModel key
generator. No changes are made to any connect UDDI service</returns>
public static tModel createKeyGenator(String partitionName, String
DescriptiveName, String DescriptiveNameLanguage)
{
if (partitionName == null || partitionName.Length == 0)
@@ -942,12 +944,14 @@ namespace org.apache.juddi.v3.client.con
}
if (!partitionName.StartsWith("uddi:"))
{
- throw new ArgumentOutOfRangeException("partitionName must have
a 'uddi:' prefix");
+ partitionName = "uddi:" + partitionName;
+ // throw new ArgumentOutOfRangeException("partitionName must
have a 'uddi:' prefix");
}
if (!partitionName.EndsWith(":keygenerator"))
{
- throw new ArgumentOutOfRangeException("partitionName must have
a ':keyGenerator' postfix");
+ partitionName = partitionName + "keygenerator";
+ //throw new ArgumentOutOfRangeException("partitionName must
have a ':keyGenerator' postfix");
}
tModel tm = new tModel();
tm.name = new name();
@@ -1063,7 +1067,7 @@ namespace org.apache.juddi.v3.client.con
//"Describes a version associated with either a service interface,
a bindingTemplate service instance.", lang)};
tt.description = new description[] { new description("Describes a
version associated with either a service interface, a bindingTemplate service
instance.", lang) };
- tt.instanceDetails.Items = new object[] { doc };
+ tt.instanceDetails.Items = new overviewDoc[] { doc };
tt.instanceDetails.instanceParms = version;
//tt.instanceDetails.Items = new object[] { doc };
Modified:
juddi/trunk/juddi-client.net/juddi-client.net/org.apache.juddi.v3.client.mapping/WADL2UDDI.cs
URL:
http://svn.apache.org/viewvc/juddi/trunk/juddi-client.net/juddi-client.net/org.apache.juddi.v3.client.mapping/WADL2UDDI.cs?rev=1542512&r1=1542511&r2=1542512&view=diff
==============================================================================
---
juddi/trunk/juddi-client.net/juddi-client.net/org.apache.juddi.v3.client.mapping/WADL2UDDI.cs
(original)
+++
juddi/trunk/juddi-client.net/juddi-client.net/org.apache.juddi.v3.client.mapping/WADL2UDDI.cs
Sat Nov 16 13:48:09 2013
@@ -303,7 +303,7 @@ namespace org.apache.juddi.v3.client.map
tModelInstanceInfo tModelInstanceInfoBinding = new
tModelInstanceInfo();
tModelInstanceInfoBinding.tModelKey = (keyDomainURI +
"binding");
instanceDetails id = new instanceDetails();
- id.Items = new object[] { portName };
+ id.instanceParms= portName ;
tModelInstanceInfoBinding.instanceDetails = (id);
description descriptionB = new description();
descriptionB.lang = (lang);
Modified:
juddi/trunk/juddi-client.net/juddi-client.net/org.apache.juddi.v3.client.mapping/WSDL2UDDI.cs
URL:
http://svn.apache.org/viewvc/juddi/trunk/juddi-client.net/juddi-client.net/org.apache.juddi.v3.client.mapping/WSDL2UDDI.cs?rev=1542512&r1=1542511&r2=1542512&view=diff
==============================================================================
---
juddi/trunk/juddi-client.net/juddi-client.net/org.apache.juddi.v3.client.mapping/WSDL2UDDI.cs
(original)
+++
juddi/trunk/juddi-client.net/juddi-client.net/org.apache.juddi.v3.client.mapping/WSDL2UDDI.cs
Sat Nov 16 13:48:09 2013
@@ -466,28 +466,29 @@ namespace org.apache.juddi.v3.client.map
- /**
- * Creates a business service based off of a WSDL definition<Br>No
changes are made to the UDDI
- * endpoints using this method
- *<br>
- * Example Code:
- * <pre>
- * URL url = new
URL("http://graphical.weather.gov/xml/SOAP_server/ndfdXMLserver.php?wsdl");
- * String domain = url.getHost();
- * ReadWSDL rw = new ReadWSDL();
- * Definition wsdlDefinition = rw.readWSDL(url);
- * properties.put("keyDomain", domain);
- * properties.put("businessName", domain);
- * properties.put("serverName", url.getHost());
- * properties.put("serverPort", url.getPort());
- * wsdlURL = wsdlDefinition.getDocumentBaseURI();
- * WSDL2UDDI wsdl2UDDI = new WSDL2UDDI(null, new
URLLocalizerDefaultImpl(), properties);
- * BusinessServices businessServices =
wsdl2UDDI.createBusinessServices(wsdlDefinition);
- * </pre>
- * @param wsdlDefinition must not be null
- * @return a business service
- * @throws IllegalArgumentException if the wsdlDefinition is null
- */
+ /// <summary>
+ ///
+ /// Creates a business service based off of a WSDL definition<Br>No
changes are made to the UDDI
+ /// endpoints using this method
+ /// <br>
+ /// Example Code:
+ /// <pre>
+ /// URL url = new
URL("http://graphical.weather.gov/xml/SOAP_server/ndfdXMLserver.php?wsdl");
+ /// String domain = url.getHost();
+ /// ReadWSDL rw = new ReadWSDL();
+ /// Definition wsdlDefinition = rw.readWSDL(url);
+ /// properties.put("keyDomain", domain);
+ /// properties.put("businessName", domain);
+ /// properties.put("serverName", url.getHost());
+ /// properties.put("serverPort", url.getPort());
+ /// wsdlURL = wsdlDefinition.getDocumentBaseURI();
+ /// WSDL2UDDI wsdl2UDDI = new WSDL2UDDI(null, new
URLLocalizerDefaultImpl(), properties);
+ /// BusinessServices businessServices =
wsdl2UDDI.createBusinessServices(wsdlDefinition);
+ /// /// </pre>
+ /// </summary>
+ /// <param name="wsdlDefinition">must not be null</param>
+ /// <returns>a business service</returns>
+ /// @throws IllegalArgumentException if the wsdlDefinition is null
public businessService[]
createBusinessServices(org.xmlsoap.schemas.easyWsdl.tDefinitions wsdlDefinition)
{
if (wsdlDefinition == null)
@@ -698,7 +699,7 @@ namespace org.apache.juddi.v3.client.map
tModelInstanceInfo tModelInstanceInfoBinding = new
tModelInstanceInfo();
tModelInstanceInfoBinding.tModelKey = (keyDomainURI +
bindingelement.name);
instanceDetails instanceDetails = new instanceDetails();
- instanceDetails.Items = new object[] { (portName) };
+ instanceDetails.instanceParms = (portName) ;
tModelInstanceInfoBinding.instanceDetails =
(instanceDetails);
description descriptionB = new description();
descriptionB.lang = (lang);
@@ -1092,6 +1093,53 @@ namespace org.apache.juddi.v3.client.map
"uddi:uddi.org:wsdl:categorization:protocol",
"uddi-org:protocol:http", "uddi:uddi.org:protocol:http");
cbitems.Add(soapProtocol);
}
+ else if
(xe.NamespaceURI.Equals("http://schemas.xmlsoap.org/wsdl/soap12/",
StringComparison.CurrentCultureIgnoreCase)
+ && xe.LocalName.Equals("binding",
StringComparison.CurrentCultureIgnoreCase))
+ {
+ // If the wsdl:binding contains a soap:binding
extensibility element from the
+ // 'http://schemas.xmlsoap.org/wsdl/soap/' namespace
then the categoryBag MUST
+ //include a keyedReference with a tModelKey of the
Protocol Categorization
+ // category system and a keyValue of the tModelKey of
the SOAP Protocol tModel.
+
+ keyedReference soapProtocol = newKeyedReference(
+ "uddi:uddi.org:wsdl:categorization:protocol",
"uddi-org:protocol:soap", "uddi:uddi.org:protocol:soap");
+ cbitems.Add(soapProtocol);
+ // If the value of the transport attribute of the
soap:binding element
+ // is 'http://schemas.xmlsoap.org/soap/http' then the
categoryBag MUST
+ // include a keyedReference with a tModelKey of the
Transport Categorization
+ // category system and a keyValue of the tModelKey of
the HTTP Transport tModel.
+
+
+ if (String.IsNullOrEmpty(xe.GetAttribute("transport")))
+ {
+ // TODO If the value of the transport attribute is
anything else,
+ // then the bindingTemplate MUST include an
additional keyedReference with a tModelKey
+ // of the Transport Categorization category system
and a keyValue of the tModelKey of
+ // an appropriate transport tModel.
+ log.warn("empty soap transport for binding " +
it.Current.Key.getLocalPart() + " " + it.Current.Key.getNamespaceURI());
+ }
+ else
+ {
+ String attr = xe.GetAttribute("transport");
+
+ if (attr != null &&
attr.Equals("http://schemas.xmlsoap.org/soap/http"))
+ {
+ keyedReference httpTransport =
newKeyedReference(
+
"uddi:uddi.org:wsdl:categorization:transport", "uddi-org:http",
"uddi:uddi.org:transport:http");
+ cbitems.Add(httpTransport);
+ }
+ else
+ {
+ log.warn("i don't know how to process the soap
transport value of " + xe.GetAttribute("transport",
"http://schemas.xmlsoap.org/wsdl/soap/"));
+ }
+ }
+ }
+ else
+ {
+ log.warn("Unrecongnized binding type: " +
xe.NamespaceURI + " " + xe.LocalName + ". Generated"
+ + "binding tModel may be missing the required
(according to WSDL2UDDI spec) "
+ + "uddi:uddi.org:wsdl:categorization:protocol
keyedReference.");
+ }
}
Modified:
juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/mapping/WSDL2UDDI.java
URL:
http://svn.apache.org/viewvc/juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/mapping/WSDL2UDDI.java?rev=1542512&r1=1542511&r2=1542512&view=diff
==============================================================================
---
juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/mapping/WSDL2UDDI.java
(original)
+++
juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/mapping/WSDL2UDDI.java
Sat Nov 16 13:48:09 2013
@@ -16,6 +16,7 @@
*/
package org.apache.juddi.v3.client.mapping;
+import com.ibm.wsdl.extensions.soap12.SOAP12BindingImpl;
import java.net.MalformedURLException;
import java.net.URL;
import java.rmi.RemoteException;
@@ -37,6 +38,7 @@ import javax.wsdl.extensions.http.HTTPBi
import javax.wsdl.extensions.soap.SOAPAddress;
import javax.wsdl.extensions.soap.SOAPBinding;
import javax.wsdl.extensions.soap12.SOAP12Address;
+import javax.wsdl.extensions.soap12.SOAP12Binding;
import javax.xml.namespace.QName;
import org.apache.commons.configuration.ConfigurationException;
@@ -447,12 +449,25 @@ public class WSDL2UDDI {
// One or two keyedReferences as required to capture the protocol
for (Object object : binding.getExtensibilityElements()) {
- if (SOAPBinding.class.isAssignableFrom(object.getClass())) {
+ SOAPBinding sb =null;
+ SOAP12Binding sb12 =null;
+ HTTPBinding hb = null;
+
+ try{
+ hb = (HTTPBinding) object;
+ }catch (Exception x){}
+ try{
+ sb = (SOAPBinding) object;
+ }catch (Exception x){}
+ try{
+ sb12 = (SOAP12Binding) object;
+ }catch (Exception x){}
+ if (sb!=null) {
// If the wsdl:binding contains a soap:binding
extensibility element from the
// 'http://schemas.xmlsoap.org/wsdl/soap/' namespace then
the categoryBag MUST
//include a keyedReference with a tModelKey of the
Protocol Categorization
// category system and a keyValue of the tModelKey of the
SOAP Protocol tModel.
- SOAPBinding soapBinding = (SOAPBinding) object;
+ SOAPBinding soapBinding = sb;
KeyedReference soapProtocol = newKeyedReference(
"uddi:uddi.org:wsdl:categorization:protocol",
"uddi-org:protocol:soap", "uddi:uddi.org:protocol:soap");
categoryBag.getKeyedReference().add(soapProtocol);
@@ -469,11 +484,11 @@ public class WSDL2UDDI {
// then the bindingTemplate MUST include an additional
keyedReference with a tModelKey
// of the Transport Categorization category system and
a keyValue of the tModelKey of
// an appropriate transport tModel.
- log.warn("not implemented");
+ log.warn("not implemented, binding transport is " +
soapBinding.getTransportURI());
}
- } else if (object.getClass().isInstance(HTTPBinding.class)) {
+ } else if (hb!=null) {
// If the wsdl:binding contains an http:binding
extensibility element from the
// http://schemas.xmlsoap.org/wsdl/http/ namespace then
the categoryBag MUST
@@ -483,6 +498,41 @@ public class WSDL2UDDI {
"uddi:uddi.org:wsdl:categorization:protocol",
"uddi-org:protocol:http", "uddi:uddi.org:protocol:http");
categoryBag.getKeyedReference().add(soapProtocol);
}
+ else if (sb12!=null) {
+ // If the wsdl:binding contains a soap:binding
extensibility element from the
+ // 'http://schemas.xmlsoap.org/wsdl/soap/' namespace then
the categoryBag MUST
+ //include a keyedReference with a tModelKey of the
Protocol Categorization
+ // category system and a keyValue of the tModelKey of the
SOAP Protocol tModel.
+
+ KeyedReference soapProtocol = newKeyedReference(
+ "uddi:uddi.org:wsdl:categorization:protocol",
"uddi-org:protocol:soap", "uddi:uddi.org:protocol:soap");
+ categoryBag.getKeyedReference().add(soapProtocol);
+ // If the value of the transport attribute of the
soap:binding element
+ // is 'http://schemas.xmlsoap.org/soap/http' then the
categoryBag MUST
+ // include a keyedReference with a tModelKey of the
Transport Categorization
+ // category system and a keyValue of the tModelKey of the
HTTP Transport tModel.
+ if
("http://schemas.xmlsoap.org/soap/http".equals(sb12.getTransportURI())) {
+ KeyedReference httpTransport = newKeyedReference(
+ "uddi:uddi.org:wsdl:categorization:transport",
"uddi-org:http", "uddi:uddi.org:transport:http");
+ categoryBag.getKeyedReference().add(httpTransport);
+ } else if (sb12.getTransportURI() != null) {
+ // TODO If the value of the transport attribute is
anything else,
+ // then the bindingTemplate MUST include an additional
keyedReference with a tModelKey
+ // of the Transport Categorization category system and
a keyValue of the tModelKey of
+ // an appropriate transport tModel.
+ log.warn("not implemented, binding transport is " +
sb12.getTransportURI());
+ }
+
+
+ }
+ else
+ {
+ log.warn("Unrecongnized binding type: " +
object.getClass().getCanonicalName() +". Generated"
+ + "binding tModel may be missing the required
(according to WSDL2UDDI spec) "
+ + "uddi:uddi.org:wsdl:categorization:protocol
keyedReference.");
+
+
+ }
}
Modified:
juddi/trunk/juddi-examples/more-uddi-samples/src/main/java/org/apache/juddi/samples/WsdlImport.java
URL:
http://svn.apache.org/viewvc/juddi/trunk/juddi-examples/more-uddi-samples/src/main/java/org/apache/juddi/samples/WsdlImport.java?rev=1542512&r1=1542511&r2=1542512&view=diff
==============================================================================
---
juddi/trunk/juddi-examples/more-uddi-samples/src/main/java/org/apache/juddi/samples/WsdlImport.java
(original)
+++
juddi/trunk/juddi-examples/more-uddi-samples/src/main/java/org/apache/juddi/samples/WsdlImport.java
Sat Nov 16 13:48:09 2013
@@ -139,17 +139,15 @@ public class WsdlImport {
TModel[] tmodels = portTypeTModels.toArray(new TModel[0]);
for (int i = 0; i < tmodels.length; i++) {
- System.out.println(tmodelPrinter.print(tmodels[i]));
tms.getTModel().add(tmodels[i]);
}
tmodels = createWSDLBindingTModels.toArray(new TModel[0]);
for (int i = 0; i < tmodels.length; i++) {
- System.out.println(tmodelPrinter.print(tmodels[i]));
tms.getTModel().add(tmodels[i]);
}
- //important, you'll need to save your new tModels, or else saving the
business/service may fail
+ //important, you'll need to save your new tModels first, or else
saving the business/service may fail
System.out.println(new PrintUDDI<SaveTModel>().print(tms));
//publish.saveTModel(stm);
@@ -161,10 +159,8 @@ public class WsdlImport {
SaveService ss = new SaveService();
- //PrintUDDI<BusinessService> servicePrinter = new
PrintUDDI<BusinessService>();
for (int i = 0; i < businessServices.getBusinessService().size(); i++)
{
ss.getBusinessService().add(businessServices.getBusinessService().get(i));
-
//System.out.println(servicePrinter.print(businessServices.getBusinessService().get(i)));
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]