Announcement Announcement Module
Collapse
No announcement yet.
Serving up WSDL similar to Axis? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Serving up WSDL similar to Axis?

    One of the nice things about Axis is its ability to programmatically serve a web service's WSDL with the correct "<soap:address>" location URL and "<wsdl:types>" imported into the WSDL from external schema files. What options do I have to do something similar with Spring WS? Currently I have a WSDL file and an external schema file. The WSDL file is served up by the file-serving servlet, but the external schema file is not picked up.
    Shannon Kendrick

  • #2
    Originally posted by mskendrick
    One of the nice things about Axis is its ability to programmatically serve a web service's WSDL with the correct "<soap:address>" location URL and "<wsdl:types>" imported into the WSDL from external schema files. What options do I have to do something similar with Spring WS? Currently I have a WSDL file and an external schema file. The WSDL file is served up by the file-serving servlet, but the external schema file is not picked up.
    It should be picked up... Are you using the same import mechanism as used in the airline sample? That seems to work.

    If you want me to look at your wsdl, you can post it here.

    Cheers,

    Comment


    • #3
      Arjen,
      One of the questions I still have is how to make the URL for the web service valid in the WSDL. Currently the URL is "http://localhost:8080/pcc-web/services", but that will change for my staging and production environments. Is this something that has to be handled in a build and deploy script? Are there any JSP tricks that could import the WSDL and serve it with a valid URL? The nice thing about Axis is that it serves the WSDL customized for the server that it is running on.

      There is also the question about the external schema. Here is my WSDL and external schema. Perhaps I have not created it correctly to include the external schema.
      Shannon Kendrick

      WSDL
      Code:
      <?xml version="1.0" encoding="UTF-8"?>
      <wsdl:definitions name="FindClaims" targetNamespace="urn:FindClaims/1.0" xmlns:tns="urn:FindClaims/1.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
      	<wsdl:types>
      		<xsd:schema>
      			<xsd:import namespace="urn:FindClaims/1.0" schemaLocation="FindClaims.xsd" />
      		</xsd:schema>
      	</wsdl:types>
      	<wsdl:message name="FindClaimsRequest">
      		<wsdl:part name="body" element="tns:FindClaims" />
      	</wsdl:message>
      	<wsdl:message name="FindClaimsResponse">
      		<wsdl:part name="body" element="tns:FindClaimsResponse" />
      	</wsdl:message>
      	<wsdl:portType name="FindClaimsPortType">
      		<wsdl:operation name="FindClaims">
      			<wsdl:input message="tns:FindClaimsRequest" />
      			<wsdl:output message="tns:FindClaimsResponse" />
      		</wsdl:operation>
      	</wsdl:portType>
      	<wsdl:binding name="FindClaimsBinding" type="tns:FindClaimsPortType">
      		<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
      		<wsdl:operation name="FindClaims">
      			<soap:operation soapAction="urn:FindClaims/1.0" style="document" />
      			<wsdl:input>
      				<soap:body use="literal" />
      			</wsdl:input>
      			<wsdl:output>
      				<soap:body use="literal" />
      			</wsdl:output>
      		</wsdl:operation>
      	</wsdl:binding>
      	<wsdl:service name="FindClaimsService">
      		<wsdl:port name="FindClaimsPort" binding="tns:FindClaimsBinding">
      			<soap:address location="http://localhost:8080/pcc-web/services" />
      		</wsdl:port>
      	</wsdl:service>
      </wsdl:definitions>
      External schema:
      Code:
      <?xml version="1.0" encoding="UTF-8"?>
      <xsd:schema targetNamespace="urn:FindClaims/1.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="urn:FindClaims/1.0" elementFormDefault="qualified" attributeFormDefault="unqualified">
      	<xsd:element name="FindClaims" type="tns:FindClaims"/>
      	<xsd:element name="FindClaimsResponse" type="tns:FindClaimsResponse"/>
      	<xsd:complexType name="FindClaims">
      		<xsd:annotation>
      			<xsd:documentation>Find Claims Request</xsd:documentation>
      		</xsd:annotation>
      		<xsd:sequence>
      			<xsd:element name="SearchCriteria" type="tns:SearchCriteria"/>
      		</xsd:sequence>
      	</xsd:complexType>
      	<xsd:complexType name="FindClaimsResponse">
      		<xsd:annotation>
      			<xsd:documentation>Find Claims Response</xsd:documentation>
      		</xsd:annotation>
      		<xsd:sequence>
      			<xsd:element name="SearchResults" type="tns:SearchResults"/>
      		</xsd:sequence>
      	</xsd:complexType>
      	<xsd:complexType name="SearchCriteria">
      		<xsd:annotation>
      			<xsd:documentation>PCC Search Criteria</xsd:documentation>
      		</xsd:annotation>
      		<xsd:attribute name="providerCode" type="xsd:string" use="required"/>
      		<xsd:attribute name="reasonCode" type="xsd:string" use="optional"/>
      		<xsd:attribute name="typeOfBill" type="xsd:string" use="optional"/>
      		<xsd:attribute name="typeOfService" type="xsd:string" use="optional"/>
      		<xsd:attribute name="dispositionIndicator" type="xsd:string" use="optional"/>
      		<xsd:attribute name="fromLastName" type="xsd:string" use="optional"/>
      		<xsd:attribute name="toLastName" type="xsd:string" use="optional"/>
      		<xsd:attribute name="patientControlNumber" type="xsd:integer" use="optional"/>
      		<xsd:attribute name="contractNumber" type="xsd:integer" use="optional"/>
      		<xsd:attribute name="fromDateOfService" type="xsd:date" use="optional"/>
      		<xsd:attribute name="toDateOfService" type="xsd:date" use="optional"/>
      		<xsd:attribute name="claimType" type="xsd:string" use="optional"/>
      	</xsd:complexType>
      	<xsd:complexType name="SearchResults">
      		<xsd:annotation>
      			<xsd:documentation>PCC Search Results</xsd:documentation>
      		</xsd:annotation>
      		<xsd:sequence>
      			<xsd:element name="Claim" type="tns:Claim" minOccurs="0" maxOccurs="unbounded"/>
      		</xsd:sequence>
      	</xsd:complexType>
      	<xsd:complexType name="Claim">
      		<xsd:annotation>
      			<xsd:documentation>Claim Summary</xsd:documentation>
      		</xsd:annotation>
      		<xsd:attribute name="ICN" type="xsd:string" use="required"/>
      		<xsd:attribute name="firstDateOfService" type="xsd:date" use="required"/>
      		<xsd:attribute name="lastDateOfService" type="xsd:date" use="optional"/>
      		<xsd:attribute name="patientDateOfBirth" type="xsd:date" use="optional"/>
      		<xsd:attribute name="patientFirstName" type="xsd:string" use="optional"/>
      		<xsd:attribute name="patientLastName" type="xsd:string" use="optional"/>
      		<xsd:attribute name="patientMiddleInitial" type="xsd:string" use="optional"/>
      		<xsd:attribute name="providerName" type="xsd:string" use="optional"/>
      		<xsd:attribute name="providerNumber" type="xsd:string" use="optional"/>
      		<xsd:attribute name="status" type="xsd:string" use="optional"/>
      		<xsd:attribute name="subscriberLiability" type="xsd:double" use="optional"/>
      		<xsd:attribute name="totalAllowedAmount" type="xsd:double" use="optional"/>
      		<xsd:attribute name="totalChargeAmount" type="xsd:double" use="optional"/>
      		<xsd:attribute name="totalPaidAmount" type="xsd:double" use="optional"/>
      	</xsd:complexType>
      </xsd:schema>

      Comment


      • #4
        Originally posted by mskendrick
        One of the questions I still have is how to make the URL for the web service valid in the WSDL. Currently the URL is "http://localhost:8080/pcc-web/services", but that will change for my staging and production environments. Is this something that has to be handled in a build and deploy script? Are there any JSP tricks that could import the WSDL and serve it with a valid URL? The nice thing about Axis is that it serves the WSDL customized for the server that it is running on.
        You could store the WSDL in a JSP page, and use the standard <c:url tag there/>. I haven don't this yet, so I can't help you much.

        Dynamic URL locations in the WSDLs is an important feature, however, so I will have to think about adding a nicer way for doing this to Spring-WS.

        Originally posted by mskendrick
        There is also the question about the external schema. Here is my WSDL and external schema. Perhaps I have not created it correctly to include the external schema.
        Everything looks OK, what is the error you are getting? Can you manually retrieve the WSDL and XSD using your browser? If that works, other clients should be able to get it as well.

        Cheers,

        Arjen

        Comment

        Working...
        X