Jerry Waldorf's Blog
A WSDL file for SPMLv2
The SPMLv2 specification as defined here does not contain a WSDL. For standardization we felt that defining a standard WSDL for SPMLv2 would be a good idea.
Here is the WSDL document that we have defined to describe an SPMLv2 Service. It has a SOAP Binding and includes all of the operations defined in the specification.
This is a description of the main parts of the WSDL.
We first have some basic namespace definitions:
<wsdl:definitions
name="SPML"
targetNamespace="urn:oasis:names:tc:SPML:2:0:wsdl"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:tns="urn:oasis:names:tc:SPML:2:0:wsdl"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:spml="urn:oasis:names:tc:SPML:2:0"
xmlns:spmlupdates="urn:oasis:names:tc:SPML:2:0:updates"
xmlns:spmlbulk="urn:oasis:names:tc:SPML:2:0:bulk"
xmlns:spmlsuspend="urn:oasis:names:tc:SPML:2:0:suspend"
xmlns:pass="urn:oasis:names:tc:SPML:2:0:password"
xmlns:spmldsml="urn:oasis:names:tc:SPML:2:0:DSML"
xmlns:spmlbatch="urn:oasis:names:tc:SPML:2:0:batch"
xmlns:spmlasync="urn:oasis:names:tc:SPML:2:0:async"
xmlns:spmlsearch="urn:oasis:names:tc:SPML:2:0:search"
xmlns:spmlref="urn:oasis:names:tc:SPML:2:0:reference">
Next we have the types section of the WSDL. Here we just import the all of the XML Schema files that are part of the formal specification.
<wsdl:types>
<xsd:schema targetNamespace="urn:oasis:names:tc:SPML:2:0:wsdl">
<xsd:import schemaLocation="pstc_spmlv2_core.xsd" namespace="urn:oasis:names:tc:SPML:2:0"/>
<xsd:import schemaLocation="pstc_spmlv2_updates.xsd" namespace="urn:oasis:names:tc:SPML:2:0:updates"/>
<xsd:import schemaLocation="pstc_spmlv2_bulk.xsd" namespace="urn:oasis:names:tc:SPML:2:0:bulk"/>
<xsd:import schemaLocation="pstc_spmlv2_suspend.xsd" namespace="urn:oasis:names:tc:SPML:2:0:suspend"/>
<xsd:import schemaLocation="pstc_spmlv2_password.xsd" namespace="urn:oasis:names:tc:SPML:2:0:password"/>
<xsd:import schemaLocation="pstc_spmlv2_dsml.xsd" namespace="urn:oasis:names:tc:SPML:2:0:DSML"/>
<xsd:import schemaLocation="pstc_spmlv2_batch.xsd" namespace="urn:oasis:names:tc:SPML:2:0:batch"/>
<xsd:import schemaLocation="pstc_spmlv2_async.xsd" namespace="urn:oasis:names:tc:SPML:2:0:async"/>
<xsd:import schemaLocation="pstc_spmlv2_search.xsd" namespace="urn:oasis:names:tc:SPML:2:0:search"/>
<xsd:import schemaLocation="pstc_spmlv2_reference.xsd" namespace="urn:oasis:names:tc:SPML:2:0:reference"/>
</xsd:schema>
</wsdl:types>
Now we define messages for each of the operations. The mapping is pretty straightforward. For each Request XML Schema element we make a message part and for each Response XML Schema we make a separate message part. For example here is the message definitions for the addRequest and addResponse.
<wsdl:message name="addRequest">
<wsdl:part name="body" element="spml:addRequest" />
</wsdl:message>
<wsdl:message name="addResponse">
<wsdl:part name="body" element="spml:addResponse" />
</wsdl:message>
Now we have the portType definition. Using the above messages:
<wsdl:portType name="SPML">
<wsdl:operation name="add">
<wsdl:input message="tns:addRequest"/>
<wsdl:output message="tns:addResponse"/>
</wsdl:operation>
...
</wsdl:portType>
Now we create a binding section for the SOAP messages that will be transported over http. We use a document style and create a naming convention for the soapAction based on the namespace and operation name. To keep things simple we use literal encoding.
<wsdl:binding name="SOAP" type="tns:SPML">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="add">
<soap:operation style="document" soapAction="urn:oasis:names:tc:SPML:2:0:req/add" />
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
...
</wsdl:binding>
And finally we have the service definition. Using https to align with the spec around using SSL and client/server certificate authentication.
<wsdl:service name="SPML">
<wsdl:port name="SOAP" binding="tns:SOAP">
<soap:address location="https://host.com/spmlv2soap"/>
</wsdl:port>
</wsdl:service>
Posted at 09:17PM Aug 19, 2008 by Jerry Waldorf in Sun | Comments[3]
Hi Jerry,
I have downloaded the wsdl and required xsd files and generated the web service using NetBeans. But now when I am generating its client and trying to write the client code for call add request function, I am not able to do that. Is it possible to write the client code using OpenSPML or by anyother means.
Actually in my scenario I am trying to implement something like this:
1. User submits his/her data.
2. This data goes to the web service client that creates a SPML request(that I am not able to create).
3. Now the web service is called.
4. This web service submits this SPML request to the SPML interface of SIM.
5. User si provisioned in SIM and resources.
Please suggest how can I create a SPML request section. If possible please post some sample code as well,it will be really helpful.
Thanks
Gaurav Jain
Posted by Gaurav Jain on February 23, 2009 at 09:54 AM PST #
Asda Story money
Posted by Asda Story money on February 26, 2009 at 12:47 AM PST #
i like the gold.
Posted by buy Tales Of Pirates Gold on March 13, 2009 at 07:33 PM PDT #