Open mdesign83 opened 5 years ago
I would like to achieve this:
<?xml version="1.0" ?>
<Person xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Name>Fred</Name>
<HomeAddress xsi:type="USAddressType">
<Line1>234 Lancaseter Av</Line1>
<Line2>SmallsVille</Line2>
<State>Florida</State>
<Zipcode>34543</Zipcode>
</HomeAddress>
</Person>
https://www.liquid-technologies.com/xml-schema-tutorial/xsd-extending-types
From the readme of this project:
Only document/literal style is supported and the webservice should follow the WS-I guidelines.
Im not sure if the XMLSchema-instance usage you are tying is WS-I and document/literal style compliant
I found a solution which works for me: [https://github.com/schmittjoh/serializer/issues/433#issuecomment-324246156](). I modified the listener to a subscriber and then I can inject it before building the serializer:
$serializer = SoapContainerBuilder::createSerializerBuilderFromContainer($container, null, SoapClientContainer::getMetadataDir());
$serializer->configureListeners(function(EventDispatcher $handlerBuilder) {
$jmsXsi = new JmsXsiTypeSubscriber(
[
'namespace' => 'http://schemas.datacontract.org/...',
'type' => 'DummyType',
'class' => DummyType::class,
], [
//...
]
);
$handlerBuilder->addSubscriber($jmsXsi);
});
$serializer = $serializer->build();
Any advice is welcome.
Well, it might work... but you did not answer to my previous comment:
Im not sure if the XMLSchema-instance usage you are tying is WS-I and document/literal style compliant
I'm affraid it's not. It is RPC/encoded, so "Although it is legal WSDL, RPC/encoded is not WS-I compliant." [https://www.ibm.com/developerworks/library/ws-whichwsdl/]()
Hi,
I would like to port my SoapClient code to goetas-webservices but I'm running a problem where the server requires xsi:type attribute on the record. How can I add these type attributes to the generated xml request?
Thanks, Karoly