You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by "Volanis, Alexander" <AV...@rsasecurity.com> on 2002/04/29 19:57:53 UTC

Newbie question on document/literal service

All,

This is a two part question.

PART 1.
I am trying to create a document/literal service using Axis and have not had
much success. My service would have a single method with a signature like
this:

public class SAMLRequest {
	public Document SAMLAssertion( Document doc ) {
		...
		return doc;
	}
}

The deployment descriptor I am trying to use looks like this:

<deployment
 xmlns="http://xml.apache.org/axis/wsdd/"
 xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
	<service name="SAMLRequestService" provider="java:MSG">
		<parameter name="className" value="SAMLRequest"/>
		<parameter name="allowedMethods" value="SAMLAssertion"/>
	</service>
</deployment>

I noticed that in order for the generated WSDL to have a style="document"
attribute I need to edit the server-config.wsdd and add style="document" to
the service element. Adding the style="document" attribute to the WSDD for
the service during deployment seems to have only temporary effect. This is
evident by the fact that the server-config.wsdd does not have the attribute
listed after the AdminClient is invoked. Is this a bug?

PART 2.
There is a public WSDL definition for the service I am trying to create but
WSDL2Java is having trouble with it. The WSDL that I would have preferred to
use is from the OASIS SSTC SAML developers list. The WSDL was recently
published and I am listing it here with some minor edits.

===========START OF WSDL==============
<?xml version="1.0"?>
<definitions name="SAMLProtocol"
targetNamespace="http://www.oasis-open.org/committees/security/docs/WSDLdefi
nitions.wsdl"
xmlns:tns="http://www.oasis-open.org/committees/security/docs/WSDLdefinition
s.wsdl" xmlns:samlp="urn:oasis:names:tc:SAML:1.0:protocol"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns="http://schemas.xmlsoap.org/wsdl/">
	<import namespace="urn:oasis:names:tc:SAML:1.0:protocol"
location="draft-sstc-schema-protocol-32.xsd"/>
	<!-- The body of the request is exactly a samlp:Request -->
	<message name="SAMLRequestMessage">
		<part name="body" element="samlp:Request"/>
	</message>
	<!-- The body of the corresponding response is exactly a
samlp:Response -->
	<message name="SAMLResponseMessage">
		<part name="body" element="samlp:Response"/>
	</message>
	<!-- And the request-response protocol goes like this -->
	<portType name="SAMLRequestPortType">
		<operation name="SAMLRequest">
			<input message="tns:SAMLRequestMessage"/>
			<output message="tns:SAMLResponseMessage"/>
		</operation>
	</portType>
	<!-- This describes how the request-response maps onto SOAP -->
	<binding name="SAMLRequestSoapBinding"
type="tns:SAMLRequestPortType">
		<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
		<operation name="SAMLRequest">
			<soap:operation
soapAction="http://www.oasis-open.org/committees/security/SAMLRequest"/>
			<input>
				<soap:body use="literal"
namespace="urn:oasis:names:tc:SAML:1.0:protocol"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
			</input>
			<output>
				<soap:body use="literal"
namespace="urn:oasis:names:tc:SAML:1.0:protocol"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
			</output>
		</operation>
	</binding>
	<!-- And this says that the SOAP service is available at a
particular URL -->
	<service name="SAMLRequestService">
		<documentation>This is the only per-installation
data</documentation>
		<port name="SAMLRequestPort"
binding="tns:SAMLRequestSoapBinding">
			<soap:address location="http://my.org/SAMLServer"/>
		</port>
	</service>
</definitions>

===========END OF WSDL==============

The WSDL uses imported schemas and references the draft SAML protocol
schema. The URL is
http://www.oasis-open.org/committees/security/docs/draft-sstc-schema-protoco
l-32.xsd. Within the protocol schema a reference to the SAML assertion
schema
(http://www.oasis-open.org/committees/security/docs/draft-sstc-schema-assert
ion-32.xsd) exists as yet another imported schema as well as an import of
the XML digital signature schema. The first problem occurs because both the
protocol schema and the assertion schema have import elements for the XML
digital signature schema. This problem can be corrected by removing the
first of the two XMLdsig# references. However, after this minor
edit/correction I encountered this error which I cannot explain.

java.io.IOException: Type http://www.w3.org/2001/XMLSchema:ID is referenced
but not defined.
        at org.apache.axis.wsdl.toJava.SymbolTable.checkForUndefined(Unknown
Source)
        at org.apache.axis.wsdl.toJava.SymbolTable.add(Unknown Source)
        at org.apache.axis.wsdl.toJava.Emitter.emit(Unknown Source)
        at org.apache.axis.wsdl.toJava.Emitter.emit(Unknown Source)
        at org.apache.axis.wsdl.WSDL2Java$WSDLRunnable.run(Unknown Source)
        at java.lang.Thread.run(Thread.java:484)

XMLSchema:ID should have been defined by the schema as far as I understand.
Why is this failing in this way? Am I trying a very complicated WSDL that is
not yet supported? The schemas used here are complicated but the net service
can be reduced to the simpler service I am trying to produce in PART 1.

Any help or insight would be greatly appreciated.

Alex Volanis
Consulting Engineer
e-mail: avolanis@rsasecurity.com