各送信メッセージに対して、Salesforceは完全な自己完結型のWSDLを提供します。同じSpringサービスで複数のSFDC Outbound Message Receiverを実装する方法は?
1つ1つのSpringサービスを実装することは、クラスを生成するためにjaxws-maven-plugin
を使用し、エンドポイントをバインドするために@Endpoint
、@PayloadRoot
などを使用すると簡単です。
ただし、複数の発信メッセージは、異なる構造およびタイプ階層に対して同じQN(たとえば、http://soap.sforce.com/2005/09/outbound:notifications
またはurn:sobject.enterprise.soap.sforce.com:sObject
)を共有します。
私はhow to map the same XML names to different handlers based on URL pathを知っています。
私はバインディングファイルで生成されたクラスのために別のパッケージを使用する方法を知っている:生成されたコードからJaxb2Marshaller
を初期化しようとしたときしかし、それはまだXMLの競合を処理することはできません
<?xml version="1.0" encoding="UTF-8"?>
<jaxws:bindings
xmlns:jaxws="http://java.sun.com/xml/ns/jaxws"
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
wsdlLocation="../wsdl/SFDC_Contact_Outbound_Msg.wsdl"
version="2.0">
<jaxb:bindings node="//xs:schema[@targetNamespace='http://soap.sforce.com/2005/09/outbound']">
<jaxb:schemaBindings>
<jaxb:package name="com.sforce.soap.outbound.contact"/>
</jaxb:schemaBindings>
</jaxb:bindings>
<jaxb:bindings node="//xs:schema[@targetNamespace='urn:sobject.enterprise.soap.sforce.com']">
<jaxb:schemaBindings>
<jaxb:package name="com.sforce.soap.enterprise.sobject.contact"/>
</jaxb:schemaBindings>
</jaxb:bindings>
</jaxws:bindings>
:
[WARN] [main] 09:40:45.687 AnnotationConfigEmbeddedWebApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'marshaller' defined in class path resource [WebServiceConfig.class]:
Invocation of init method failed; nested exception is org.springframework.oxm.UncategorizedMappingException:
Unknown JAXB exception; nested exception is com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 6 counts of IllegalAnnotationExceptions
Two classes have the same XML type name "{urn:sobject.enterprise.soap.sforce.com}sObject". Use @XmlType.name and @XmlType.namespace to assign different names to them.
...
SDFCによって生成されたWSDLが変更されたときに、新しいファイルを削除する以外の手順を追加したくありません。
ソースWSDLを変更せずにpackage-info.java
の名前空間を変更する方法はありますか?
DefaultMethodEndpointAdapter
にすべて追加できる個々のマーシャラーを簡単に作成できます(つまり、別々の@Bean
メソッドはありません)。
これらの送信メッセージ受信者をすべて実装する別の方法はありますか?