-
1. Re: WebService Client with MTOM - WSDL
michaw Jul 8, 2009 10:26 AM (in response to michaw)attachmentservice_1.wsdl
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="AttachmentService" targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:tns="http://tempuri.org/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:i0="http://ebus.onefox.nl/2009/2/4" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex">
<wsdl:import namespace="http://ebus.onefox.nl/2009/2/4" location="AttachmentService.wsdl"/>
<wsdl:types/>
<wsdl:service name="AttachmentService">
<wsdl:port name="AttachmentServiceEndpoint" binding="i0:AttachmentServiceEndpoint">
<soap:address location="http://wkst02.onefox.nl/ebus/AttachmentService.svc"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
AttachmentService.wsdl
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://ebus.onefox.nl/2009/2/4" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:tns="http://ebus.onefox.nl/2009/2/4" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex">
<wsp:Policy wsu:Id="AttachmentServiceEndpoint_policy">
<wsp:ExactlyOne>
<wsp:All>
<wsoma:OptimizedMimeSerialization xmlns:wsoma="http://schemas.xmlsoap.org/ws/2004/09/policy/optimizedmimeserialization"/>
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
<wsdl:types>
<xsd:schema targetNamespace="http://ebus.onefox.nl/2009/2/4/Imports">
<xsd:import schemaLocation="AttachmentService_1.xsd" namespace="http://ebus.onefox.nl/2009/2/4"/>
<xsd:import schemaLocation="AttachmentService_1_2_3.xsd" namespace="http://ebus.onefox.nl/2009/2/4/attachment"/>
<xsd:import schemaLocation="AttachmentService_1_2.xsd" namespace="http://schemas.microsoft.com/2003/10/Serialization/"/>
<xsd:import schemaLocation="AttachmentService.xsd" namespace="http://ebus.onefox.nl/2009/2/4/data"/>
<xsd:import schemaLocation="AttachmentService_1_2_3_4.xsd" namespace="http://schemas.microsoft.com/Message"/>
</xsd:schema>
</wsdl:types>
<wsdl:message name="ReadDocumentMsg"/>
<wsdl:message name="ReadDocumentMsg_Headers">
<wsdl:part name="AuthInfo" element="tns:AuthInfo"/>
<wsdl:part name="Data" element="q1:ReadDocumentMsg" xmlns:q1="http://ebus.onefox.nl/2009/2/4/attachment"/>
</wsdl:message>
<wsdl:message name="AttachmentServiceReadDocumentResMsg">
<wsdl:part name="ReadDocumentContent" element="q2:ReadDocumentContent" xmlns:q2="http://ebus.onefox.nl/2009/2/4/attachment"/>
</wsdl:message>
<wsdl:message name="AttachmentServiceReadDocumentResMsg_Headers">
<wsdl:part name="Result" element="q3:ReadDocumentResultMsg" xmlns:q3="http://ebus.onefox.nl/2009/2/4/attachment"/>
</wsdl:message>
<wsdl:message name="WriteDocumentMsg">
<wsdl:part name="ReadDocumentContent" element="q4:ReadDocumentContent" xmlns:q4="http://ebus.onefox.nl/2009/2/4/attachment"/>
</wsdl:message>
<wsdl:message name="WriteDocumentMsg_Headers">
<wsdl:part name="AuthInfo" element="tns:AuthInfo"/>
<wsdl:part name="Data" element="q5:WriteDocumentMsg" xmlns:q5="http://ebus.onefox.nl/2009/2/4/attachment"/>
</wsdl:message>
<wsdl:message name="AttachmentServiceWriteDocumentResMsg"/>
<wsdl:message name="AttachmentServiceWriteDocumentResMsg_Headers">
<wsdl:part name="Result" element="q6:WriteDocumentResultMsg" xmlns:q6="http://ebus.onefox.nl/2009/2/4/attachment"/>
</wsdl:message>
<wsdl:portType name="AttachmentService">
<wsdl:operation name="ReadDocument">
<wsdl:input wsaw:Action="http://ebus.onefox.nl/2009/2/4/AttachmentService/ReadDocument" name="ReadDocumentMsg" message="tns:ReadDocumentMsg"/>
<wsdl:output wsaw:Action="http://ebus.onefox.nl/2009/2/4/AttachmentService/ReadDocumentResponse" name="AttachmentServiceReadDocumentResMsg" message="tns:AttachmentServiceReadDocumentResMsg"/>
</wsdl:operation>
<wsdl:operation name="WriteDocument">
<wsdl:input wsaw:Action="http://ebus.onefox.nl/2009/2/4/AttachmentService/WriteDocument" name="WriteDocumentMsg" message="tns:WriteDocumentMsg"/>
<wsdl:output wsaw:Action="http://ebus.onefox.nl/2009/2/4/AttachmentService/WriteDocumentResponse" name="AttachmentServiceWriteDocumentResMsg" message="tns:AttachmentServiceWriteDocumentResMsg"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="AttachmentServiceEndpoint" type="tns:AttachmentService">
<wsp:PolicyReference URI="#AttachmentServiceEndpoint_policy"/>
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="ReadDocument">
<soap:operation soapAction="http://ebus.onefox.nl/2009/2/4/AttachmentService/ReadDocument" style="document"/>
<wsdl:input name="ReadDocumentMsg">
<soap:header message="tns:ReadDocumentMsg_Headers" part="AuthInfo" use="literal"/>
<soap:header message="tns:ReadDocumentMsg_Headers" part="Data" use="literal"/>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="AttachmentServiceReadDocumentResMsg">
<soap:header message="tns:AttachmentServiceReadDocumentResMsg_Headers" part="Result" use="literal"/>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="WriteDocument">
<soap:operation soapAction="http://ebus.onefox.nl/2009/2/4/AttachmentService/WriteDocument" style="document"/>
<wsdl:input name="WriteDocumentMsg">
<soap:header message="tns:WriteDocumentMsg_Headers" part="AuthInfo" use="literal"/>
<soap:header message="tns:WriteDocumentMsg_Headers" part="Data" use="literal"/>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="AttachmentServiceWriteDocumentResMsg">
<soap:header message="tns:AttachmentServiceWriteDocumentResMsg_Headers" part="Result" use="literal"/>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
</wsdl:definitions>
AttachmentService.xsd
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema elementFormDefault="qualified" targetNamespace="http://ebus.onefox.nl/2009/2/4/data" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://ebus.onefox.nl/2009/2/4/data">
<xs:complexType name="AuthInfo">
<xs:sequence>
<xs:element name="Library" nillable="true" type="xs:string"/>
<xs:element name="Username" nillable="true" type="xs:string"/>
<xs:element name="Password" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:element name="AuthInfo" nillable="true" type="tns:AuthInfo"/>
<xs:complexType name="ReturnFields">
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" name="ReturnField" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:element name="ReturnFields" nillable="true" type="tns:ReturnFields"/>
<xs:complexType name="Result">
<xs:sequence>
<xs:element minOccurs="0" name="ErrCode" type="xs:int"/>
<xs:element minOccurs="0" name="ErrDescription" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:element name="Result" nillable="true" type="tns:Result"/>
<xs:complexType name="Fields">
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" name="Field" nillable="true" type="tns:Field"/>
</xs:sequence>
</xs:complexType>
<xs:element name="Fields" nillable="true" type="tns:Fields"/>
<xs:complexType name="Field">
<xs:sequence>
<xs:element name="Name" nillable="true" type="xs:string"/>
<xs:element name="Value" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:element name="Field" nillable="true" type="tns:Field"/>
</xs:schema>
AttachmentService_1.xsd
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema elementFormDefault="qualified" targetNamespace="http://ebus.onefox.nl/2009/2/4" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://ebus.onefox.nl/2009/2/4">
<xs:import schemaLocation="AttachmentService.xsd" namespace="http://ebus.onefox.nl/2009/2/4/data"/>
<xs:element name="AuthInfo" nillable="true" type="q1:AuthInfo" xmlns:q1="http://ebus.onefox.nl/2009/2/4/data"/>
</xs:schema>
AttachmentService_1_2.xsd
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://schemas.microsoft.com/2003/10/Serialization/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://schemas.microsoft.com/2003/10/Serialization/">
<xs:element name="anyType" nillable="true" type="xs:anyType"/>
<xs:element name="anyURI" nillable="true" type="xs:anyURI"/>
<xs:element name="base64Binary" nillable="true" type="xs:base64Binary"/>
<xs:element name="boolean" nillable="true" type="xs:boolean"/>
<xs:element name="byte" nillable="true" type="xs:byte"/>
<xs:element name="dateTime" nillable="true" type="xs:dateTime"/>
<xs:element name="decimal" nillable="true" type="xs:decimal"/>
<xs:element name="double" nillable="true" type="xs:double"/>
<xs:element name="float" nillable="true" type="xs:float"/>
<xs:element name="int" nillable="true" type="xs:int"/>
<xs:element name="long" nillable="true" type="xs:long"/>
<xs:element name="QName" nillable="true" type="xs:QName"/>
<xs:element name="short" nillable="true" type="xs:short"/>
<xs:element name="string" nillable="true" type="xs:string"/>
<xs:element name="unsignedByte" nillable="true" type="xs:unsignedByte"/>
<xs:element name="unsignedInt" nillable="true" type="xs:unsignedInt"/>
<xs:element name="unsignedLong" nillable="true" type="xs:unsignedLong"/>
<xs:element name="unsignedShort" nillable="true" type="xs:unsignedShort"/>
<xs:element name="char" nillable="true" type="tns:char"/>
<xs:simpleType name="char">
<xs:restriction base="xs:int"/>
</xs:simpleType>
<xs:element name="duration" nillable="true" type="tns:duration"/>
<xs:simpleType name="duration">
<xs:restriction base="xs:duration">
<xs:pattern value="\-?P(\d*D)?(T(\d*H)?(\d*M)?(\d*(\.\d*)?S)?)?"/>
<xs:minInclusive value="-P10675199DT2H48M5.4775808S"/>
<xs:maxInclusive value="P10675199DT2H48M5.4775807S"/>
</xs:restriction>
</xs:simpleType>
<xs:element name="guid" nillable="true" type="tns:guid"/>
<xs:simpleType name="guid">
<xs:restriction base="xs:string">
<xs:pattern value="[\da-fA-F]{8}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{12}"/>
</xs:restriction>
</xs:simpleType>
<xs:attribute name="FactoryType" type="xs:QName"/>
<xs:attribute name="Id" type="xs:ID"/>
<xs:attribute name="Ref" type="xs:IDREF"/>
</xs:schema>
AttachmentService_1_2_3.xsd
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema elementFormDefault="qualified" targetNamespace="http://ebus.onefox.nl/2009/2/4/attachment" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://ebus.onefox.nl/2009/2/4/attachment">
<xs:import schemaLocation="AttachmentService.xsd" namespace="http://ebus.onefox.nl/2009/2/4/data"/>
<xs:import schemaLocation="AttachmentService_1_2_3_4.xsd" namespace="http://schemas.microsoft.com/Message"/>
<xs:complexType name="ReadDocumentMsg">
<xs:sequence>
<xs:element name="DocNumber" type="xs:int"/>
<xs:element minOccurs="0" name="Version" type="xs:int"/>
<xs:element name="Form" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="Checkout" type="xs:boolean"/>
<xs:element minOccurs="0" name="ReturnFields" nillable="true" type="q1:ReturnFields" xmlns:q1="http://ebus.onefox.nl/2009/2/4/data"/>
</xs:sequence>
</xs:complexType>
<xs:element name="ReadDocumentMsg" nillable="true" type="tns:ReadDocumentMsg"/>
<xs:element name="ReadDocumentContent" type="q2:StreamBody" xmlns:q2="http://schemas.microsoft.com/Message"/>
<xs:complexType name="ReadDocumentResultMsg">
<xs:complexContent mixed="false">
<xs:extension base="q3:Result" xmlns:q3="http://ebus.onefox.nl/2009/2/4/data">
<xs:sequence>
<xs:element minOccurs="0" name="DocNumber" type="xs:int"/>
<xs:element minOccurs="0" name="Version" type="xs:int"/>
<xs:element minOccurs="0" name="Fields" nillable="true" type="q3:Fields"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="ReadDocumentResultMsg" nillable="true" type="tns:ReadDocumentResultMsg"/>
<xs:complexType name="WriteDocumentMsg">
<xs:sequence>
<xs:element name="DocNumber" type="xs:int"/>
<xs:element minOccurs="0" name="Version" type="xs:int"/>
<xs:element name="Form" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="Checkin" type="xs:boolean"/>
<xs:element minOccurs="0" name="ReturnFields" nillable="true" type="q4:ReturnFields" xmlns:q4="http://ebus.onefox.nl/2009/2/4/data"/>
<xs:element minOccurs="0" name="CreateNewVersion" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
<xs:element name="WriteDocumentMsg" nillable="true" type="tns:WriteDocumentMsg"/>
<xs:complexType name="WriteDocumentResultMsg">
<xs:complexContent mixed="false">
<xs:extension base="q5:Result" xmlns:q5="http://ebus.onefox.nl/2009/2/4/data">
<xs:sequence>
<xs:element minOccurs="0" name="DocNumber" type="xs:int"/>
<xs:element minOccurs="0" name="Version" type="xs:int"/>
<xs:element minOccurs="0" name="Fields" nillable="true" type="q5:Fields"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="WriteDocumentResultMsg" nillable="true" type="tns:WriteDocumentResultMsg"/>
</xs:schema>
AttachmentService_1_2_3_4.xsd
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema elementFormDefault="qualified" targetNamespace="http://schemas.microsoft.com/Message" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://schemas.microsoft.com/Message">
<xs:simpleType name="StreamBody">
<xs:restriction base="xs:base64Binary"/>
</xs:simpleType>
</xs:schema> -
2. Re: WebService Client with MTOM
asoldano Jul 15, 2009 12:11 PM (in response to michaw)Despite having a basic implementation of WS-Policy, JBossWS-Native does not support policies for setting MTOM. This means you need to manually set mtom on client side (please refer to the documentation) or switch to JBossWS-CXF / JBossWS-Metro.
-
3. Re: WebService Client with MTOM
vgarmash Apr 27, 2010 11:16 AM (in response to asoldano)Hi, Alessio.
All I can find is this here:
MTOM enabled clientsWeb service clients can use the same approach described above or rely on theBinding
API to enable MTOM (Excerpt taken from theorg.jboss.test.ws.jaxws.samples.xop.doclit.XOPTestCase
):
[...]
Service service = Service.create(wsdlURL, serviceName);
port = service.getPort(MTOMEndpoint.class);
// enable MTOM
binding = (SOAPBinding)((BindingProvider)port).getBinding();
binding.setMTOMEnabled(true);Note
You might as well use the JBossWS configuration templates to setup deployment defaults.But it doesn't really help. I am having exception in the row
Service.create(wsdlURL, serviceName);
which is before we set MTOM. Actually I don't want to use MTOM at all but it still being loaded because WSDL has this:
<wsp:Policy wsu:Id="CustomBinding_ISearchService_policy"> <wsp:ExactlyOne> <wsp:All> <msb:BinaryEncoding xmlns:msb="http://schemas.microsoft.com/ws/06/2004/mspolicy/netbinary1" /> <wsaw:UsingAddressing /> </wsp:All> </wsp:ExactlyOne> </wsp:Policy>
See dev.virtualearth.net.webservices.v1.search.wsdl for details.
Is there any way in configuration files to say: "use plain services and never use binary one"?