Problem with policy reference in AS 6
koebbingd Jan 14, 2011 9:05 AMWe're currently using a webservice client with apache-cxf-2.2.9 on AS 5.1.
apache-cxf is bundled in lib directory of an ear.
Now we want to migrate to AS6 (or at least jboss-cxf-3.4.0 on AS 5.1).
But trying to run our bean on AS6 we get the following exception:
javax.xml.ws.soap.SOAPFaultException: #BN_ZS_MM_GET_OPEN_PO can't be resolved.
The corresponding wsdl file is as follows (I skip some of the type definitions), it validates ok with wsdlvalidate:
<?xml version="1.0" encoding="utf-8"?> <wsdl:definitions targetNamespace="urn:sap-com:document:sap:soap:functions:mc-style" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="urn:sap-com:document:sap:soap:functions:mc-style" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:n1="urn:sap-com:document:sap:rfc:functions"> <wsdl:documentation> <sidl:sidl xmlns:sidl="http://www.sap.com/2007/03/sidl"/> </wsdl:documentation> <wsp:UsingPolicy wsdl:required="true"/> <wsp:Policy wsu:Id="BN_ZS_MM_GET_OPEN_PO"> <wsaw:UsingAddressing xmlns:wsaw="http://schemas.xmlsoap.org/ws/2004/08/addressing"/><saptrnbnd:OptimizedXMLTransfer uri="http://xml.sap.com/2006/11/esi/esp/binxml" xmlns:saptrnbnd="http://www.sap.com/webas/710/soap/features/transportbinding/" wsp:Optional="true"/> <sapattahnd:Enabled xmlns:sapattahnd="http://www.sap.com/710/features/attachment/">false</sapattahnd:Enabled> <wsp:ExactlyOne xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:sapsp="http://www.sap.com/webas/630/soap/features/security/policy" xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility"> <wsp:All> <sp:TransportBinding> <wsp:Policy> <sp:TransportToken> <wsp:Policy> <sp:HttpsToken> <wsp:Policy> <sp:HttpBasicAuthentication/> </wsp:Policy> </sp:HttpsToken> </wsp:Policy> </sp:TransportToken> <sp:AlgorithmSuite> <wsp:Policy> <sp:TripleDesRsa15/> </wsp:Policy> </sp:AlgorithmSuite> <sp:Layout> <wsp:Policy> <sp:Strict/> </wsp:Policy> </sp:Layout> </wsp:Policy> </sp:TransportBinding> </wsp:All> </wsp:ExactlyOne> </wsp:Policy> <wsp:Policy wsu:Id="IF_ZS_MM_GET_OPEN_PO"> <sapsession:Session xmlns:sapsession="http://www.sap.com/webas/630/soap/features/session/"> <sapsession:enableSession>false</sapsession:enableSession> </sapsession:Session> <sapcentraladmin:CentralAdministration xmlns:sapcentraladmin="http://www.sap.com/webas/700/soap/features/CentralAdministration/" wsp:Optional="true"> <sapcentraladmin:BusinessApplicationID>4718D64C1DBC5D29E1000000AC140016</sapcentraladmin:BusinessApplicationID> </sapcentraladmin:CentralAdministration> </wsp:Policy> <wsp:Policy wsu:Id="OP_ZMmGetOpenPo"> <sapcomhnd:enableCommit xmlns:sapcomhnd="http://www.sap.com/NW05/soap/features/commit/">false</sapcomhnd:enableCommit><sapblock:enableBlocking xmlns:sapblock="http://www.sap.com/NW05/soap/features/blocking/">true</sapblock:enableBlocking><saptrhnw05:required xmlns:saptrhnw05="http://www.sap.com/NW05/soap/features/transaction/">no</saptrhnw05:required><saprmnw05:enableWSRM xmlns:saprmnw05="http://www.sap.com/NW05/soap/features/wsrm/">false</saprmnw05:enableWSRM> </wsp:Policy> <wsdl:types> <xsd:schema attributeFormDefault="qualified" targetNamespace="urn:sap-com:document:sap:rfc:functions"> <xsd:simpleType name="char1"> <xsd:restriction base="xsd:string"> <xsd:maxLength value="1"/> </xsd:restriction> </xsd:simpleType> <!-- some more of this stuff --> <xsd:simpleType name="date"> <xsd:restriction base="xsd:string"> <xsd:maxLength value="10"/><xsd:pattern value="\d\d\d\d-\d\d-\d\d"/> </xsd:restriction> </xsd:simpleType> </xsd:schema> <xsd:schema attributeFormDefault="qualified" targetNamespace="urn:sap-com:document:sap:soap:functions:mc-style" xmlns:n0="urn:sap-com:document:sap:rfc:functions"> <xsd:import namespace="urn:sap-com:document:sap:rfc:functions"/> <xsd:complexType name="ZmmEkgrp"> <xsd:sequence> <xsd:element name="Ekgrp" type="n0:char3"/><xsd:element name="Eknam" type="n0:char18"/> <xsd:element name="Ektel" type="n0:char12"/> <xsd:element name="Telfx" type="n0:char31"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="ZmmEkusr"> <xsd:sequence> <xsd:element name="Bname" type="n0:char12"/><xsd:element name="NameText" type="n0:char80"/> <xsd:element name="TelNumber" type="n0:char30"/> <xsd:element name="TelExtens" type="n0:char10"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="ZmmPodata"> <xsd:sequence> <xsd:element name="Lifnr" type="n0:char10"/><xsd:element name="Name1" type="n0:char35"/> <xsd:element name="Name2" type="n0:char35"/> <!-- etc. --> <xsd:element name="THead" type="tns:ZmmPoheadT"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="ZmmPohead"> <xsd:sequence> <xsd:element name="Ebeln" type="n0:char10"/><xsd:element name="Bstyp" type="n0:char1"/> <xsd:element name="Bsart" type="n0:char4"/> <!-- etc. --> <xsd:element name="TItem" type="tns:ZmmPoitemT"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="ZmmPoitem"> <xsd:sequence> <xsd:element name="Ebelp" type="n0:numeric5"/><xsd:element name="Bukrs" type="n0:char4"/> <xsd:element name="Matnr" type="n0:char18"/> <!-- etc. --> <xsd:element name="Lmein" type="n0:unit3"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="ZmmEkgrpT"> <xsd:sequence> <xsd:element name="item" type="tns:ZmmEkgrp" minOccurs="0" maxOccurs="unbounded"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="ZmmEkusrT"> <xsd:sequence> <xsd:element name="item" type="tns:ZmmEkusr" minOccurs="0" maxOccurs="unbounded"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="ZmmPodataT"> <xsd:sequence> <xsd:element name="item" type="tns:ZmmPodata" minOccurs="0" maxOccurs="unbounded"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="ZmmPoheadT"> <xsd:sequence> <xsd:element name="item" type="tns:ZmmPohead" minOccurs="0" maxOccurs="unbounded"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="ZmmPoitemT"> <xsd:sequence> <xsd:element name="item" type="tns:ZmmPoitem" minOccurs="0" maxOccurs="unbounded"/> </xsd:sequence> </xsd:complexType> <xsd:element name="ZMmGetOpenPo"> <xsd:complexType> <xsd:sequence> <xsd:element name="IEbeln" type="n0:char10" minOccurs="0"/><xsd:element name="ILiefertagB" type="n0:date" minOccurs="0"/> <xsd:element name="ILiefertagV" type="n0:date" minOccurs="0"/> <xsd:element name="ILifnr" type="n0:char10" minOccurs="0"/> <xsd:element name="IName" type="n0:char35" minOccurs="0"/> <xsd:element name="IWerks" type="n0:char4" minOccurs="0"/> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:element name="ZMmGetOpenPoResponse"> <xsd:complexType> <xsd:sequence> <xsd:element name="EtEkgrp" type="tns:ZmmEkgrpT"/><xsd:element name="EtEkusr" type="tns:ZmmEkusrT"/> <xsd:element name="EtPodata" type="tns:ZmmPodataT"/> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:schema> </wsdl:types> <wsdl:message name="ZMmGetOpenPo"> <wsdl:part name="parameters" element="tns:ZMmGetOpenPo"/> </wsdl:message> <wsdl:message name="ZMmGetOpenPoResponse"> <wsdl:part name="parameter" element="tns:ZMmGetOpenPoResponse"/> </wsdl:message> <wsdl:portType name="ZS_MM_GET_OPEN_PO"> <wsp:Policy> <wsp:PolicyReference URI="#IF_ZS_MM_GET_OPEN_PO"/> </wsp:Policy> <wsdl:operation name="ZMmGetOpenPo"> <wsp:Policy> <wsp:PolicyReference URI="#OP_ZMmGetOpenPo"/> </wsp:Policy> <wsdl:input message="tns:ZMmGetOpenPo"/> <wsdl:output message="tns:ZMmGetOpenPoResponse"/> </wsdl:operation> </wsdl:portType> <wsdl:binding name="ZS_MM_GET_OPEN_PO" type="tns:ZS_MM_GET_OPEN_PO"> <wsp:Policy> <wsp:PolicyReference URI="#BN_ZS_MM_GET_OPEN_PO"/> </wsp:Policy> <wsa:EndpointReference xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"> <wsa:Address/><wsa:ReferenceParameters/> </wsa:EndpointReference> <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/> <wsdl:operation name="ZMmGetOpenPo"> <soap:operation soapAction="" 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="ZS_MM_GET_OPEN_PO"> <wsdl:port name="ZS_MM_GET_OPEN_PO" binding="tns:ZS_MM_GET_OPEN_PO"> <soap:address location="http://SAPEntw.test.de:8000/sap/bc/srt/rfc/sap/zs_mm_get_open_po/222/zs_mm_get_open_po/zs_mm_get_open_po"/> </wsdl:port> </wsdl:service> </wsdl:definitions>
I'm sure I missed something important, but at the moment I'm not able to use the service with cxf.
Using wsconsume.sh and wsrunclient.sh doesn't help, too - same result. So it doesn't seem to be AS related.
Using apache-cxf-2.2.9 on jboss AS 5.1 it works like a charm.
Thanks in advance,
Daniel