使用spring mvc使用SOAP Web服务(consume SOAP web service with spring mvc)
我是SOAP Web服务的新手。 在我的项目中,我需要在Spring MVC中使用SOAP Web服务。 我在谷歌尝试搜索我没有得到简单的例子来将SOAP服务与Spring MVC集成。
我还有其他几个问题。
- 什么是JAXB? 根据我的理解,JAXB用于对服务中的对象进行编组和解组。
2.在同一个春季mvc应用程序中,我可以同时使用宁静的Web服务和SOAP Web服务吗?
3. Spring-WS和JAX-WS有什么不同?
I new to SOAP web service. In my project there is a requirement where I need to consume the SOAP web service in spring MVC. I tried search in google I am not getting simple example to integrate the SOAP services with spring MVC.
I have few other question as well.
- What is JAXB? As per my understanding the JAXB is used for marshalling and unmarshalling the objects from service.
2.Whether I can use both restful web service and SOAP web service together in same spring mvc application?
3.What is different between Spring-WS and JAX-WS?
原文:https://stackoverflow.com/questions/40379989
最满意答案
使用以下格式将
_id
索引到uid
字段中:type#id
。因此,您的脚本应如下所示(对于名为
my_type
且ID为1
):{ "query": { "filtered": { "filter": { "script" : { "script" : "doc['_uid'].value == 'my_type#1'" } } } } }
一个更精细的解决方案,取出
id
ES方式是这样的:{ "query": { "filtered": { "filter": { "script": { "script": "org.elasticsearch.index.mapper.Uid.splitUidIntoTypeAndId(new org.apache.lucene.util.BytesRef(doc['_uid'].value))[1].utf8ToString() == '1'" } } } } }
其中
org.elasticsearch.index.mapper.Uid.splitUidIntoTypeAndId(new org.apache.lucene.util.BytesRef(doc['_uid'].value))[1]
是id
和org.elasticsearch.index.mapper.Uid.splitUidIntoTypeAndId(new org.apache.lucene.util.BytesRef(doc['_uid'].value))[0]
是type
。The
_id
is indexed in theuid
field, using this format:type#id
.So, your script should look like this (for a type called
my_type
and an ID of1
):{ "query": { "filtered": { "filter": { "script" : { "script" : "doc['_uid'].value == 'my_type#1'" } } } } }
A more elaborate solution, to take out the
id
ES-way is like this:{ "query": { "filtered": { "filter": { "script": { "script": "org.elasticsearch.index.mapper.Uid.splitUidIntoTypeAndId(new org.apache.lucene.util.BytesRef(doc['_uid'].value))[1].utf8ToString() == '1'" } } } } }
where
org.elasticsearch.index.mapper.Uid.splitUidIntoTypeAndId(new org.apache.lucene.util.BytesRef(doc['_uid'].value))[1]
is theid
andorg.elasticsearch.index.mapper.Uid.splitUidIntoTypeAndId(new org.apache.lucene.util.BytesRef(doc['_uid'].value))[0]
is thetype
.
相关问答
更多-
您可能应该删除解释标志,因为它可能是脚本执行两次的原因。 You should probably remove the explain flag as it might be the reason why the script gets executed twice.
-
最小化json文档大小是否会提高弹性搜索的性能?(Does minimizing json document size increase performance on elastic search?)[2021-08-21]
索引JSON文档中的所有字段不会减慢Elasticsearch的速度,但会使索引更大。 因此,如果磁盘空间或RAM有限,那么您可能只想索引3个相关字段。 您仍然可以将整个文档存储在Elasticsearch中(并设置要压缩的_source字段),但通过将不相关字段设置为“index”来禁用索引:“no”。 但是,如果容量不是问题,那么为什么不让Elasticsearch做它的事呢? 您可能会发现还有其他相关领域没有考虑过,而且通常您最终会使用ES来执行您的数据库通常会处理的查询,因为(a)它的速度非常快且( ... -
即使弹性搜索中缺少某些字段,也会搜索文档(Search document even when some fields are missing in elastic search)[2022-01-05]
您可以添加“bool”的查询术语,以便按照您的意愿制作“或”逻辑。 batchId = X OR batchId is missing可以用一个should表达式表示(并且batchId is missing一个must_not并且batchId is missing must_not ),如下所示: { "query": { "bool": { "must": [ { "match": { "centerId": "N00 ... -
你只需要用分号分隔每个语句: "script": { "script": "isCompleted = doc['state'].value == 'completed'; preSLA = doc['lastStateUpdate'].value < doc['dueDate'].value; return isCompleted && preSLA;" } 不过,请确保不要在脚本字符串中添加换行符,因为它不会是有效的JSON。 You simply need to separate e ...
-
如何在弹性搜索中通过其他字段对结果进行分组(How to perform faceting to group results by other fields in Elastic Search)[2023-09-29]
是的,这是Elasticsearch中分面的标准行为。 有关更多信息和示例,请参阅Elasticsearch Facets文档 。 Yes, this is the standard behavior for faceting in Elasticsearch. Please refer to the Elasticsearch Facets documentation for more information and examples. -
您可以使用partial_fields来执行此操作。 例如,如果您为这样的doc编制索引: curl -XPUT 'http://127.0.0.1:9200/test/test/1?pretty=1' -d ' { "email" : "john@foo.com", "name" : "john", "foo" : { "bar" : { "baz" : 1 } } } ' 您可以像这样包含所需的字段/对象: curl -XGET 'h ...
-
弹性搜索脚本字段(Elastic Search Script Fields)[2022-07-01]
您只需要在script部分中包含脚本字段的定义,如下所示: "script_fields": { "my_field": { "script": { <---- add this "file": "my_script", "params": { "my_var": 2 } } } } 还要确保从elasticsearch.yml配置文件中的存储脚本文件启用动态 ... -
使用以下格式将_id索引到uid字段中: type#id 。 因此,您的脚本应如下所示(对于名为my_type且ID为1 ): { "query": { "filtered": { "filter": { "script" : { "script" : "doc['_uid'].value == 'my_type#1'" } } } } } 一个更精细的解决方案,取出id ES方式是这样的: { " ...
-
Elastic Search Fliter在同一子文档中的两个字段上(Elastic Search Fliter on two fields within same sub document)[2022-07-09]
您需要修改映射以指示specifications是nested类型。 映射如: "mappings": { "product": { "properties": { ... "specifications": { "type": "nested" } } } } 然后查询如下: "bool": { "must": [{ "nested": { "path": "specifications", ... -
我认为_parent只存储父ID。 尝试这样的事情: "fields":[ "_parent", "commentText" ] I think _parent only stores the parent id. Try something like this: "fields":[ "_parent", "commentText" ]