membrane / soa-model

Toolkit and Java API for WSDL, WADL and XML Schema.
http://www.membrane-soa.org/soa-model/
Apache License 2.0
94 stars 73 forks source link

Generating a soap message based on xs:choice #258

Open Stephan972 opened 7 years ago

Stephan972 commented 7 years ago

I have a wsdl allowing the following elements:

(...)
<xs:complexType name="ExportType">
<xs:sequence>
  <xs:element name="Statements" type="statementstype:StatementsType" minOccurs="0" maxOccurs="1"/>
  <xs:element name="Operation" type="operationtype:OperationType" minOccurs="1" maxOccurs="1"/>
  <xs:element name="SelectedLanguageDescriptions" type="languagedescriptionstype:LanguageDescriptionsType" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
(...)
<xs:complexType name="OperationType">
<xs:choice>
  <xs:element name="Extract" type="extracttype:ExtractType"/>
  <xs:element name="Retrieve" type="retrievetype:RetrieveType"/>
  <xs:element name="SynchronisationExtract" type="synchronisationextracttype:SynchronisationExtractType"/>
</xs:choice>
</xs:complexType>
(...)

I use soa-model for generating a soap request from this wsdl. The resulting soap request is fine except for the Operation element. soa-model produces an element for each member of the xs:choice.

How can I instruct soa-model to generate only the SynchronisationExtract element?

predic8 commented 7 years ago

do not use choice or fix the SOA Model. Good contribution are always welcome.

Cheers, Thomas

Am 24.02.17 um 18:01 schrieb Stephan:

I have a wsdl allowing the following elements:

|(...) <xs:element name="Statements" type="statementstype:StatementsType" minOccurs="0" maxOccurs="1"/> <xs:element name="Operation" type="operationtype:OperationType" minOccurs="1" maxOccurs="1"/> <xs:element name="SelectedLanguageDescriptions" type="languagedescriptionstype:LanguageDescriptionsType" minOccurs="0" maxOccurs="1"/> </xs:sequence> </xs:complexType> (...) <xs:complexType name="OperationType"> <xs:element name="Extract" type="extracttype:ExtractType"/> <xs:element name="Retrieve" type="retrievetype:RetrieveType"/> <xs:element name="SynchronisationExtract" type="synchronisationextracttype:SynchronisationExtractType"/> </xs:choice> </xs:complexType> (...) |

I use |soa-model| for generating a soap request from this wsdl. The resulting soap request is fine except for the |Operation| element. |soa-model| produces an element for each member of the |xs:choice|.

How can I instruct |soa-model| to generate /only/ the |SynchronisationExtract| element?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/membrane/soa-model/issues/258, or mute the thread https://github.com/notifications/unsubscribe-auth/AB1-OCs6LqK91l9d9ysZK8wAOjOj0fiSks5rfwzXgaJpZM4MLcD-.

-- Viele Grüße, Thomas Bayer

-- predic8 GmbH Koblenzer Strasse 65

53173 Bonn

http://predic8.de Tel: +49 (0) 228 5552576-0 Fax: +49 (0) 228 5552576-50

Amtsgericht Bonn HRB 16152 Geschäftsführer: Thomas Bayer, Tobias Polley

Stephan972 commented 7 years ago

@predic8 , Thanks for your quick reply !

Suppose we have the following code:

WSDLParser parser = new WSDLParser();

Definitions wsdl = parser.parse("http://example.com/path/to/wsdl/whith/choice.wsdl");

StringWriter writer = new StringWriter();

HashMap<String, String> formParams = new HashMap<String, String>();
formParams.put("xpath:/create/article/name", "foo");
formParams.put("xpath:/create/article/description", "bar");

//SOARequestCreator constructor: SOARequestCreator(Definitions, Creator, MarkupBuilder)
SOARequestCreator creator = new SOARequestCreator(wsdl, new RequestCreator(), new MarkupBuilder(writer));
creator.setFormParams(formParams);

//creator.createRequest(PortType name, Operation name, Binding name);
creator.createRequest("ArticleServicePT", "create", "ArticleServicePTBinding");

What is the class, under the hood, that will handle the xs:choice?

keshavarzi commented 7 years ago

Hi,

have a look at the Class

|SOARequestCreator there you have to modify a createXXXX method. The code should be selfexplanatory. Cheers, Thomas |

Am 25.02.17 um 08:21 schrieb Stephan:

Suppose we have the following code:

|WSDLParser parser = new WSDLParser(); Definitions wsdl = parser.parse("http://example.com/path/to/wsdl/whith/choice.wsdl"); StringWriter writer = new StringWriter(); HashMap<String, String> formParams = new HashMap<String, String>(); formParams.put("xpath:/create/article/name", "foo"); formParams.put("xpath:/create/article/description", "bar"); //SOARequestCreator constructor: SOARequestCreator(Definitions, Creator, MarkupBuilder) SOARequestCreator creator = new SOARequestCreator(wsdl, new RequestCreator(), new MarkupBuilder(writer)); creator.setFormParams(formParams); //creator.createRequest(PortType name, Operation name, Binding name); creator.createRequest("ArticleServicePT", "create", "ArticleServicePTBinding"); |

What is the class, /under the hood/, that will handle the |xs:choice|?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/membrane/soa-model/issues/258#issuecomment-282466665, or mute the thread https://github.com/notifications/unsubscribe-auth/ACtFyxN2erdnC8CpJ1NweaegzuAMbR2cks5rf9aIgaJpZM4MLcD-.